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

scim::IMEngineInstanceBase Class Reference
[IMEngine]

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

#include <scim_imengine.h>

Inheritance diagram for scim::IMEngineInstanceBase:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 IMEngineInstanceBase (IMEngineFactoryBase *factory, const String &encoding, int id=-1)
 Constructor.
virtual ~IMEngineInstanceBase ()
 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 engine factory.
Signal connection functions.
These functions are used by FrontEnds to connect their corresponding slots to this IMEngineInstance's signals.

Connection signal_connect_show_preedit_string (IMEngineSlotVoid *slot)
Connection signal_connect_show_aux_string (IMEngineSlotVoid *slot)
Connection signal_connect_show_lookup_table (IMEngineSlotVoid *slot)
Connection signal_connect_hide_preedit_string (IMEngineSlotVoid *slot)
Connection signal_connect_hide_aux_string (IMEngineSlotVoid *slot)
Connection signal_connect_hide_lookup_table (IMEngineSlotVoid *slot)
Connection signal_connect_update_preedit_caret (IMEngineSlotInt *slot)
Connection signal_connect_update_preedit_string (IMEngineSlotWideStringAttributeList *slot)
Connection signal_connect_update_aux_string (IMEngineSlotWideStringAttributeList *slot)
Connection signal_connect_update_lookup_table (IMEngineSlotLookupTable *slot)
Connection signal_connect_commit_string (IMEngineSlotWideString *slot)
Connection signal_connect_forward_key_event (IMEngineSlotKeyEvent *slot)
Connection signal_connect_register_properties (IMEngineSlotPropertyList *slot)
Connection signal_connect_update_property (IMEngineSlotProperty *slot)
Action functions.
These functions will be called by FrontEnds to send events to this IMEngineInstance.

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_candidate (unsigned int index)=0
 Select a candidate 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 lookup_table_page_up ()=0
 Flip the lookup table to the previous page.
virtual void lookup_table_page_down ()=0
 Flip the lookup table to the next page.
virtual void reset ()=0
 Reset this engine instance.
virtual void focus_in ()=0
 Focus in this engine instance.
virtual void focus_out ()=0
 Focus out this engine instance.
virtual void trigger_property (const String &property)=0
 Trigger a property.

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_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_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_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_key_event (const KeyEvent &key)
 Forward a key event to the client application.
void register_properties (const PropertyList &properties)
 Register all properties of this IMEngineInstance into the FrontEnd.
void update_property (const Property &property)
 Update a registered property.

Detailed Description

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

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

Definition at line 331 of file scim_imengine.h.


Constructor & Destructor Documentation

scim::IMEngineInstanceBase::IMEngineInstanceBase IMEngineFactoryBase 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::IMEngineInstanceBase::~IMEngineInstanceBase  )  [virtual]
 

Virtual destructor.


Member Function Documentation

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

Set the working encoding for this instance.

One engine instance can only support one client encoding at the same time. This encoding must be supported by the IMEngineFactory as well.

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

String scim::IMEngineInstanceBase::get_encoding  )  const
 

Get the working encoding of this instance.

Returns:
The current working encoding.

int scim::IMEngineInstanceBase::get_id  )  const
 

Get the unique id of this instance.

Returns:
The id of this instance.

String scim::IMEngineInstanceBase::get_factory_uuid  )  const
 

Get the UUID of the engine factory.

Returns:
The UUID string of the engine factory.

Connection scim::IMEngineInstanceBase::signal_connect_show_preedit_string IMEngineSlotVoid slot  ) 
 

Connection scim::IMEngineInstanceBase::signal_connect_show_aux_string IMEngineSlotVoid slot  ) 
 

Connection scim::IMEngineInstanceBase::signal_connect_show_lookup_table IMEngineSlotVoid slot  ) 
 

Connection scim::IMEngineInstanceBase::signal_connect_hide_preedit_string IMEngineSlotVoid slot  ) 
 

Connection scim::IMEngineInstanceBase::signal_connect_hide_aux_string IMEngineSlotVoid slot  ) 
 

Connection scim::IMEngineInstanceBase::signal_connect_hide_lookup_table IMEngineSlotVoid slot  ) 
 

Connection scim::IMEngineInstanceBase::signal_connect_update_preedit_caret IMEngineSlotInt slot  ) 
 

Connection scim::IMEngineInstanceBase::signal_connect_update_preedit_string IMEngineSlotWideStringAttributeList slot  ) 
 

Connection scim::IMEngineInstanceBase::signal_connect_update_aux_string IMEngineSlotWideStringAttributeList slot  ) 
 

Connection scim::IMEngineInstanceBase::signal_connect_update_lookup_table IMEngineSlotLookupTable slot  ) 
 

Connection scim::IMEngineInstanceBase::signal_connect_commit_string IMEngineSlotWideString slot  ) 
 

Connection scim::IMEngineInstanceBase::signal_connect_forward_key_event IMEngineSlotKeyEvent slot  ) 
 

Connection scim::IMEngineInstanceBase::signal_connect_register_properties IMEngineSlotPropertyList slot  ) 
 

Connection scim::IMEngineInstanceBase::signal_connect_update_property IMEngineSlotProperty slot  ) 
 

virtual bool scim::IMEngineInstanceBase::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::ComposeKeyInstance, and scim::DummyIMEngineInstance.

virtual void scim::IMEngineInstanceBase::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::ComposeKeyInstance, and scim::DummyIMEngineInstance.

virtual void scim::IMEngineInstanceBase::select_candidate unsigned int  index  )  [pure virtual]
 

Select a candidate in current lookup table.

When user click a candidate directly, this method will be invoked by FrontEnd.

Parameters:
index - the index in current page of the selected candidate.

Implemented in scim::ComposeKeyInstance, and scim::DummyIMEngineInstance.

virtual void scim::IMEngineInstanceBase::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::ComposeKeyInstance, and scim::DummyIMEngineInstance.

virtual void scim::IMEngineInstanceBase::lookup_table_page_up  )  [pure virtual]
 

Flip the lookup table to the previous page.

The method will be invoked by FrontEnd when user click the lookup table page up button.

Implemented in scim::ComposeKeyInstance, and scim::DummyIMEngineInstance.

virtual void scim::IMEngineInstanceBase::lookup_table_page_down  )  [pure virtual]
 

Flip the lookup table to the next page.

The method will be invoked by FrontEnd when user click the lookup table page down button.

Implemented in scim::ComposeKeyInstance, and scim::DummyIMEngineInstance.

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

Reset this engine instance.

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

Implemented in scim::ComposeKeyInstance, and scim::DummyIMEngineInstance.

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

Focus in this engine 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::ComposeKeyInstance, and scim::DummyIMEngineInstance.

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

Focus out this engine instance.

Implemented in scim::ComposeKeyInstance, and scim::DummyIMEngineInstance.

virtual void scim::IMEngineInstanceBase::trigger_property const String property  )  [pure virtual]
 

Trigger a property.

This function should do some action according to the triggered property. For example toggle the input mode, etc.

Parameters:
property the key of the triggered property.

Implemented in scim::ComposeKeyInstance, and scim::DummyIMEngineInstance.

void scim::IMEngineInstanceBase::show_preedit_string  )  [protected]
 

Show the preedit string area.

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

void scim::IMEngineInstanceBase::show_aux_string  )  [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 engine want.

void scim::IMEngineInstanceBase::show_lookup_table  )  [protected]
 

Show the lookup table area.

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

void scim::IMEngineInstanceBase::hide_preedit_string  )  [protected]
 

Hide the preedit string area.

void scim::IMEngineInstanceBase::hide_aux_string  )  [protected]
 

Hide the aux string area.

void scim::IMEngineInstanceBase::hide_lookup_table  )  [protected]
 

Hide the lookup table area.

void scim::IMEngineInstanceBase::update_preedit_caret int  caret  )  [protected]
 

Update the preedit caret position in the preedit string.

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

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

Update the content of the preedit string,.

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

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

Update the content of the aux string,.

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

void scim::IMEngineInstanceBase::update_lookup_table const LookupTable table  )  [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 engine instance by calling update_lookup_table_page_size method.

Parameters:
table - the new LookupTable

void scim::IMEngineInstanceBase::commit_string const WideString str  )  [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.

void scim::IMEngineInstanceBase::forward_key_event const KeyEvent key  )  [protected]
 

Forward a key event to the client application.

Parameters:
key - the key event to be forwarded.

void scim::IMEngineInstanceBase::register_properties const PropertyList properties  )  [protected]
 

Register all properties of this IMEngineInstance into the FrontEnd.

The old properties previously registered by other IMEngineInstance will be discarded.

Parameters:
properties the PropertyList contains all of the properties.

void scim::IMEngineInstanceBase::update_property const Property property  )  [protected]
 

Update a registered property.

Update a property which already registered by register_properties () method.

Parameters:
property the property to be updated.


The documentation for this class was generated from the following file:
Generated on Tue Apr 19 00:12:07 2005 for scim by  doxygen 1.4.1