Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

scim::ServerInstanceBase Class Reference
[Server]

The base class of the real input methods' ServerInstance classes. More...

#include <scim_server.h>

Inheritance diagram for scim::ServerInstanceBase:

Inheritance graph
[legend]
Collaboration diagram for scim::ServerInstanceBase:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ServerInstanceBase (ServerFactoryBase *factory, const String &encoding, int id=-1)
 Constructor.

virtual ~ServerInstanceBase ()
 Virtual destructor.

bool set_encoding (const String &encoding)
 Set the working encoding for this instance.

String get_encoding () const
 Get the working encoding of this instance.

int get_id () const
 Get the unique id of this instance.

String get_factory_uuid () const
 Get the UUID of the server factory.

Signal connection functions.
These functions are used by FrontEnds to connect their corresponding slots to this ServerInstance's signals.

Connection signal_connect_show_preedit_string (ServerSlotVoid *slot)
Connection signal_connect_show_status_string (ServerSlotVoid *slot)
Connection signal_connect_show_aux_string (ServerSlotVoid *slot)
Connection signal_connect_show_lookup_table (ServerSlotVoid *slot)
Connection signal_connect_hide_preedit_string (ServerSlotVoid *slot)
Connection signal_connect_hide_status_string (ServerSlotVoid *slot)
Connection signal_connect_hide_aux_string (ServerSlotVoid *slot)
Connection signal_connect_hide_lookup_table (ServerSlotVoid *slot)
Connection signal_connect_update_preedit_caret (ServerSlotInt *slot)
Connection signal_connect_update_preedit_string (ServerSlotWideStringAttributeList *slot)
Connection signal_connect_update_status_string (ServerSlotWideStringAttributeList *slot)
Connection signal_connect_update_aux_string (ServerSlotWideStringAttributeList *slot)
Connection signal_connect_update_lookup_table (ServerSlotLookupTable *slot)
Connection signal_connect_commit_string (ServerSlotWideString *slot)
Connection signal_connect_forward_keyevent (ServerSlotKeyEvent *slot)
Connection signal_connect_update_full_width_punctuation (ServerSlotBool *slot)
Connection signal_connect_update_full_width_letter (ServerSlotBool *slot)
Action functions.
These functions will be called by FrontEnds to send events to this ServerInstance.

virtual bool process_key_event (const KeyEvent &key)=0
 Process a key event.

virtual void move_preedit_caret (unsigned int pos)=0
 Move the preedit caret in the preedit string.

virtual void select_lookup_table (unsigned int item)=0
 Select the item in current lookup table.

virtual void update_lookup_table_page_size (unsigned int page_size)=0
 Update the page size of current lookup table.

virtual void reset ()=0
 Reset this server instance.

virtual void focus_in ()=0
 Focus in this server instance.

virtual void focus_out ()=0
 Focus out this server instance.

virtual void toggle_full_width_punctuation ()=0
 Toggle full/half width punctuation state.

virtual void toggle_full_width_letter ()=0
 Toggle full/half width letter state.

virtual void toggle_input_status ()=0
 Toggle the current input status of this server instance.


Protected Member Functions

Signal activation functions
These functions should be called by derived classes to fire the corresponding signals. The FrontEnd connected to those signals will receive and process them.

void show_preedit_string ()
 Show the preedit string area.

void show_status_string ()
 Show the status string area.

void show_aux_string ()
 Show the aux string area.

void show_lookup_table ()
 Show the lookup table area.

void hide_preedit_string ()
 Hide the preedit string area.

void hide_status_string ()
 Hide the status string area.

void hide_aux_string ()
 Hide the aux string area.

void hide_lookup_table ()
 Hide the lookup table area.

void update_preedit_caret (int caret)
 Update the preedit caret position in the preedit string.

void update_preedit_string (const WideString &str, const AttributeList &attrs=AttributeList())
 Update the content of the preedit string,.

void update_status_string (const WideString &str, const AttributeList &attrs=AttributeList())
 Update the content of the status string,.

void update_aux_string (const WideString &str, const AttributeList &attrs=AttributeList())
 Update the content of the aux string,.

void update_lookup_table (const LookupTable &table)
 Update the content of the lookup table,.

void commit_string (const WideString &str)
 Commit a string to the client application.

void forward_keyevent (const KeyEvent &key)
 Forward a key event to the client application.

void update_full_width_punctuation (bool full)
 Update the punctuation input mode indicator.

void update_full_width_letter (bool full)
 Update the letter input mode indicator.


Detailed Description

The base class of the real input methods' ServerInstance classes.

Each input method should implement a class derived from scim::ServerInstanceBase, which takes charge of recording Input Context status and processing user input events.

Definition at line 293 of file scim_server.h.


Constructor & Destructor Documentation

scim::ServerInstanceBase::ServerInstanceBase ServerFactoryBase factory,
const String encoding,
int  id = -1
 

Constructor.

Parameters:
factory - the factory which creates this instance.
encoding - the working encoding.
id - the unique id of this instance.

virtual scim::ServerInstanceBase::~ServerInstanceBase  )  [virtual]
 

Virtual destructor.


Member Function Documentation

bool scim::ServerInstanceBase::set_encoding const String encoding  ) 
 

Set the working encoding for this instance.

One server instance can only support one encoding at the same time. This encoding must be supported by the ServerFactory as well.

Returns:
true if the encoding is supported, otherwise false.

String scim::ServerInstanceBase::get_encoding  )  const
 

Get the working encoding of this instance.

Returns:
The current working encoding.

int scim::ServerInstanceBase::get_id  )  const
 

Get the unique id of this instance.

Returns:
The id of this instance.

String scim::ServerInstanceBase::get_factory_uuid  )  const
 

Get the UUID of the server factory.

Returns:
The UUID string of the server factory.

Connection scim::ServerInstanceBase::signal_connect_show_preedit_string ServerSlotVoid slot  ) 
 

Connection scim::ServerInstanceBase::signal_connect_show_status_string ServerSlotVoid slot  ) 
 

Connection scim::ServerInstanceBase::signal_connect_show_aux_string ServerSlotVoid slot  ) 
 

Connection scim::ServerInstanceBase::signal_connect_show_lookup_table ServerSlotVoid slot  ) 
 

Connection scim::ServerInstanceBase::signal_connect_hide_preedit_string ServerSlotVoid slot  ) 
 

Connection scim::ServerInstanceBase::signal_connect_hide_status_string ServerSlotVoid slot  ) 
 

Connection scim::ServerInstanceBase::signal_connect_hide_aux_string ServerSlotVoid slot  ) 
 

Connection scim::ServerInstanceBase::signal_connect_hide_lookup_table ServerSlotVoid slot  ) 
 

Connection scim::ServerInstanceBase::signal_connect_update_preedit_caret ServerSlotInt slot  ) 
 

Connection scim::ServerInstanceBase::signal_connect_update_preedit_string ServerSlotWideStringAttributeList slot  ) 
 

Connection scim::ServerInstanceBase::signal_connect_update_status_string ServerSlotWideStringAttributeList slot  ) 
 

Connection scim::ServerInstanceBase::signal_connect_update_aux_string ServerSlotWideStringAttributeList slot  ) 
 

Connection scim::ServerInstanceBase::signal_connect_update_lookup_table ServerSlotLookupTable slot  ) 
 

Connection scim::ServerInstanceBase::signal_connect_commit_string ServerSlotWideString slot  ) 
 

Connection scim::ServerInstanceBase::signal_connect_forward_keyevent ServerSlotKeyEvent slot  ) 
 

Connection scim::ServerInstanceBase::signal_connect_update_full_width_punctuation ServerSlotBool slot  ) 
 

Connection scim::ServerInstanceBase::signal_connect_update_full_width_letter ServerSlotBool slot  ) 
 

virtual bool scim::ServerInstanceBase::process_key_event const KeyEvent key  )  [pure virtual]
 

Process a key event.

Parameters:
key - the key event to be processed.
Returns:
true if the event is processed, otherwise the event is not processed and should be forward to client application.

Implemented in scim::DummyServerInstance.

virtual void scim::ServerInstanceBase::move_preedit_caret unsigned int  pos  )  [pure virtual]
 

Move the preedit caret in the preedit string.

Parameters:
pos - the new position that user requested.

Implemented in scim::DummyServerInstance.

virtual void scim::ServerInstanceBase::select_lookup_table unsigned int  item  )  [pure virtual]
 

Select the item in current lookup table.

Parameters:
item - the item to be selected in current page.

Implemented in scim::DummyServerInstance.

virtual void scim::ServerInstanceBase::update_lookup_table_page_size unsigned int  page_size  )  [pure virtual]
 

Update the page size of current lookup table.

In the next time, the lookup table should page down by this size.

Parameters:
page_size - the new size of current page.

Implemented in scim::DummyServerInstance.

virtual void scim::ServerInstanceBase::reset  )  [pure virtual]
 

Reset this server instance.

All status of this server instance should be reset, including the working encoding.

Implemented in scim::DummyServerInstance.

virtual void scim::ServerInstanceBase::focus_in  )  [pure virtual]
 

Focus in this server instance.

This function should update/show/hide the status area, preedit area and lookup table, and update the full width punctuation/letter state.

Implemented in scim::DummyServerInstance.

virtual void scim::ServerInstanceBase::focus_out  )  [pure virtual]
 

Focus out this server instance.

Implemented in scim::DummyServerInstance.

virtual void scim::ServerInstanceBase::toggle_full_width_punctuation  )  [pure virtual]
 

Toggle full/half width punctuation state.

Implemented in scim::DummyServerInstance.

virtual void scim::ServerInstanceBase::toggle_full_width_letter  )  [pure virtual]
 

Toggle full/half width letter state.

Implemented in scim::DummyServerInstance.

virtual void scim::ServerInstanceBase::toggle_input_status  )  [pure virtual]
 

Toggle the current input status of this server instance.

This action will be called when the status button is pressed by user. It indicates that user want to switch among the input modes, eg. Chinese/English etc.

Implemented in scim::DummyServerInstance.

void scim::ServerInstanceBase::show_preedit_string  )  [inline, protected]
 

Show the preedit string area.

The preedit string should be updated by calling update_preedit_string before or right after this call.

Definition at line 500 of file scim_server.h.

void scim::ServerInstanceBase::show_status_string  )  [inline, protected]
 

Show the status string area.

The status string should be updated by calling update_status_string before or right after this call.

Definition at line 510 of file scim_server.h.

void scim::ServerInstanceBase::show_aux_string  )  [inline, protected]
 

Show the aux string area.

The aux string should be updated by calling update_aux_string before or right after this call.

The aux string can contain any additional information whatever the input method server want.

Definition at line 523 of file scim_server.h.

void scim::ServerInstanceBase::show_lookup_table  )  [inline, protected]
 

Show the lookup table area.

The lookup table should be updated by calling update_lookup_table before or right after this call.

Definition at line 533 of file scim_server.h.

void scim::ServerInstanceBase::hide_preedit_string  )  [inline, protected]
 

Hide the preedit string area.

Definition at line 540 of file scim_server.h.

void scim::ServerInstanceBase::hide_status_string  )  [inline, protected]
 

Hide the status string area.

Definition at line 547 of file scim_server.h.

void scim::ServerInstanceBase::hide_aux_string  )  [inline, protected]
 

Hide the aux string area.

Definition at line 554 of file scim_server.h.

void scim::ServerInstanceBase::hide_lookup_table  )  [inline, protected]
 

Hide the lookup table area.

Definition at line 561 of file scim_server.h.

void scim::ServerInstanceBase::update_preedit_caret int  caret  )  [inline, protected]
 

Update the preedit caret position in the preedit string.

Parameters:
caret - the new position of the preedit caret.

Definition at line 570 of file scim_server.h.

void scim::ServerInstanceBase::update_preedit_string const WideString str,
const AttributeList attrs = AttributeList ()
[inline, protected]
 

Update the content of the preedit string,.

Parameters:
str - the string content
attrs - the string attributes

Definition at line 580 of file scim_server.h.

References scim::AttributeList, and scim::WideString.

void scim::ServerInstanceBase::update_status_string const WideString str,
const AttributeList attrs = AttributeList ()
[inline, protected]
 

Update the content of the status string,.

Parameters:
str - the string content
attrs - the string attributes

Definition at line 591 of file scim_server.h.

References scim::AttributeList, and scim::WideString.

void scim::ServerInstanceBase::update_aux_string const WideString str,
const AttributeList attrs = AttributeList ()
[inline, protected]
 

Update the content of the aux string,.

Parameters:
str - the string content
attrs - the string attribute

Definition at line 602 of file scim_server.h.

References scim::AttributeList, and scim::WideString.

void scim::ServerInstanceBase::update_lookup_table const LookupTable table  )  [inline, protected]
 

Update the content of the lookup table,.

FrontEnd may reduce the page size of the table according to screen resolution. If the page size is changed, FrontEnd will inform this server instance by calling update_lookup_table_page_size method.

Parameters:
table - the new LookupTable

Definition at line 617 of file scim_server.h.

void scim::ServerInstanceBase::commit_string const WideString str  )  [inline, protected]
 

Commit a string to the client application.

The preedit string should be hid before calling this method. Otherwise the clients which use OnTheSpot input mode will flicker annoyingly.

Parameters:
str - the string to be committed.

Definition at line 630 of file scim_server.h.

References scim::WideString.

void scim::ServerInstanceBase::forward_keyevent const KeyEvent key  )  [inline, protected]
 

Forward a key event to the client application.

Parameters:
key - the key event to be forwarded.

Definition at line 639 of file scim_server.h.

void scim::ServerInstanceBase::update_full_width_punctuation bool  full  )  [inline, protected]
 

Update the punctuation input mode indicator.

Parameters:
full - true for full width mode, false for half width mode.

Definition at line 648 of file scim_server.h.

void scim::ServerInstanceBase::update_full_width_letter bool  full  )  [inline, protected]
 

Update the letter input mode indicator.

Parameters:
full - true for full width mode, false for half width mode.

Definition at line 657 of file scim_server.h.


The documentation for this class was generated from the following file:
Generated on Fri May 7 17:27:29 2004 for scim by doxygen 1.3.6