scim
1.4.18
|
The base class of the real input methods' IMEngineInstance classes. More...
#include <scim_imengine.h>
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. More... | |
void | show_aux_string () |
Show the aux string area. More... | |
void | show_lookup_table () |
Show the lookup table area. More... | |
void | hide_preedit_string () |
Hide the preedit string area. More... | |
void | hide_aux_string () |
Hide the aux string area. More... | |
void | hide_lookup_table () |
Hide the lookup table area. More... | |
void | update_preedit_caret (int caret) |
Update the preedit caret position in the preedit string. More... | |
void | update_preedit_string (const WideString &str, const AttributeList &attrs=AttributeList()) |
Update the content of the preedit string,. More... | |
void | update_aux_string (const WideString &str, const AttributeList &attrs=AttributeList()) |
Update the content of the aux string,. More... | |
void | update_lookup_table (const LookupTable &table) |
Update the content of the lookup table,. More... | |
void | commit_string (const WideString &str) |
Commit a string to the client application. More... | |
void | forward_key_event (const KeyEvent &key) |
Forward a key event to the client application. More... | |
void | register_properties (const PropertyList &properties) |
Register all properties of this IMEngineInstance into the FrontEnd. More... | |
void | update_property (const Property &property) |
Update a registered property. More... | |
void | beep () |
Generate a short beep. More... | |
void | start_helper (const String &helper_uuid) |
Start a Client Helper process. More... | |
void | stop_helper (const String &helper_uuid) |
Stop a Client Helper process which was started by start_helper. More... | |
void | send_helper_event (const String &helper_uuid, const Transaction &trans) |
Send an events transaction to a client helper process. More... | |
bool | get_surrounding_text (WideString &text, int &cursor, int maxlen_before=-1, int maxlen_after=-1) |
Retrieves context around the insertion point. More... | |
bool | delete_surrounding_text (int offset, int len) |
Ask the client to delete characters around the cursor position. More... | |
![]() | |
ReferencedObject () | |
Constructor. More... | |
virtual | ~ReferencedObject ()=0 |
Destructor. More... | |
void | set_referenced (bool reference) |
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.
scim::IMEngineInstanceBase::IMEngineInstanceBase | ( | IMEngineFactoryBase * | factory, |
const String & | encoding, | ||
int | id = -1 |
||
) |
Constructor.
factory | - the factory which creates this instance. |
encoding | - the working encoding. |
id | - the unique id of this instance. |
|
virtual |
Virtual destructor.
|
virtual |
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.
This method could be overrided in derived class to do some extra job. But the method of this base class must be invoked within the new method.
After invoking this method, reset() should be invoked to let the new encoding take effect.
Reimplemented in scim::FilterInstanceBase.
String scim::IMEngineInstanceBase::get_encoding | ( | ) | const |
Get the working encoding of this instance.
This method returns the encoding passed to the constructor when constructing this object.
int scim::IMEngineInstanceBase::get_id | ( | ) | const |
Get the unique id of this instance.
String scim::IMEngineInstanceBase::get_factory_uuid | ( | ) | const |
Get the UUID of the engine factory.
void scim::IMEngineInstanceBase::set_frontend_data | ( | void * | data | ) |
Attach a pointer to this IMEngineInstance, which is pointed to corresponding FrontEnd data.
data | The pointer to corresponding FrontEnd data, eg. input context object. |
void* scim::IMEngineInstanceBase::get_frontend_data | ( | void | ) |
Retrieve the pointer previously attached by set_frontend_data();.
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 | ) |
Connection scim::IMEngineInstanceBase::signal_connect_beep | ( | IMEngineSlotVoid * | slot | ) |
Connection scim::IMEngineInstanceBase::signal_connect_start_helper | ( | IMEngineSlotString * | slot | ) |
Connection scim::IMEngineInstanceBase::signal_connect_stop_helper | ( | IMEngineSlotString * | slot | ) |
Connection scim::IMEngineInstanceBase::signal_connect_send_helper_event | ( | IMEngineSlotStringTransaction * | slot | ) |
Connection scim::IMEngineInstanceBase::signal_connect_get_surrounding_text | ( | IMEngineSlotGetSurroundingText * | slot | ) |
Connection scim::IMEngineInstanceBase::signal_connect_delete_surrounding_text | ( | IMEngineSlotDeleteSurroundingText * | slot | ) |
|
pure virtual |
Process a key event.
key | - the key event to be processed. |
Implemented in scim::DummyIMEngineInstance, scim::FilterInstanceBase, and scim::ComposeKeyInstance.
|
virtual |
Move the preedit caret in the preedit string.
pos | - the new position that user requested. |
Reimplemented in scim::FilterInstanceBase, and scim::ComposeKeyInstance.
|
virtual |
Select a candidate in current lookup table.
When user click a candidate directly, this method will be invoked by FrontEnd.
index | - the index in current page of the selected candidate. |
Reimplemented in scim::FilterInstanceBase, and scim::ComposeKeyInstance.
|
virtual |
Update the page size of current lookup table.
In the next time, the lookup table should page down by this size.
page_size | - the new size of current page. |
Reimplemented in scim::FilterInstanceBase, and scim::ComposeKeyInstance.
|
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.
Reimplemented in scim::FilterInstanceBase, and scim::ComposeKeyInstance.
|
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.
Reimplemented in scim::FilterInstanceBase, and scim::ComposeKeyInstance.
|
virtual |
Reset this engine instance.
All status of this engine instance should be reset, including the working encoding.
The client encoding may have been changed before calling this method, so if the IMEngine makes use of the client's encoding information, it should check whether the encoding has been changed. IMEngineInstance could call the get_encoding () method of base class to get the client encoding.
Reimplemented in scim::FilterInstanceBase, and scim::ComposeKeyInstance.
|
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.
Reimplemented in scim::DummyIMEngineInstance, scim::FilterInstanceBase, and scim::ComposeKeyInstance.
|
virtual |
Focus out this engine instance.
Reimplemented in scim::FilterInstanceBase, and scim::ComposeKeyInstance.
|
virtual |
Trigger a property.
This function should do some action according to the triggered property. For example toggle the input mode, etc.
property | the key of the triggered property. |
Reimplemented in scim::FilterInstanceBase, and scim::ComposeKeyInstance.
|
virtual |
Process the events sent from a Client Helper process.
helper_uuid | The UUID of the Helper process which sent the events. |
trans | The transaction which contains the events. |
Reimplemented in scim::FilterInstanceBase.
|
virtual |
Update the capabilities of current client application which is attached to this IMEngineInstance.
Some client may not support all capabilities provided by the IMEngine API. For example:
This method will be called to inform this IMEngineInstance object which capabilities are supported by the client application. It may be called multiple times, if the capabilities was changed.
cap | A bitmask to indicate which client capabilities are supported by the client application. |
Reimplemented in scim::FilterInstanceBase.
|
protected |
Show the preedit string area.
The preedit string should be updated by calling update_preedit_string before or right after this call.
|
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.
|
protected |
Show the lookup table area.
The lookup table should be updated by calling update_lookup_table before or right after this call.
|
protected |
Hide the preedit string area.
|
protected |
Hide the aux string area.
|
protected |
Hide the lookup table area.
|
protected |
Update the preedit caret position in the preedit string.
caret | - the new position of the preedit caret. |
|
protected |
Update the content of the preedit string,.
str | - the string content |
attrs | - the string attributes |
|
protected |
Update the content of the aux string,.
str | - the string content |
attrs | - the string attribute |
|
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.
table | - the new LookupTable |
|
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.
str | - the string to be committed. |
|
protected |
Forward a key event to the client application.
key | - the key event to be forwarded. |
|
protected |
Register all properties of this IMEngineInstance into the FrontEnd.
The old properties previously registered by other IMEngineInstance will be discarded, so for each time focus_in() is called, all properties should be registered no matter whether they had been registered before.
properties | the PropertyList contains all of the properties. |
|
protected |
Update a registered property.
Update a property which already registered by register_properties () method.
property | the property to be updated. |
|
protected |
Generate a short beep.
|
protected |
Start a Client Helper process.
helper_uuid | The UUID of the Helper object. |
|
protected |
Stop a Client Helper process which was started by start_helper.
helper_uuid | The UUID of the Helper object. |
|
protected |
Send an events transaction to a client helper process.
helper_uuid | The UUID of the Helper object. |
trans | The transaction which contains events. |
|
protected |
Retrieves context around the insertion point.
Input methods typically want context in order to constrain input text based on existing text; this is important for languages such as Thai where only some sequences of characters are allowed.
Unlike other signal activation actions, this action will return the result immediately.
text | location to store the context string around the insertion point. |
cursor | location to store index of the insertion cursor within . |
maxlen_before | the maxmium length of context string to be retrieved before the cursor; -1 means unlimited. |
maxlen_after | the maxmium length of context string to be retrieved after the cursor; -1 means unlimited. |
|
protected |
Ask the client to delete characters around the cursor position.
In order to use this function, you should first call get_surrounding_text () to get the current context, and call this function immediately afterwards to make sure that you know what you are deleting. You should also account for the fact that even if the signal was handled, the input context might not have deleted all the characters that were requested to be deleted.
offset | offset from cursor position in chars; a negative value means start before the cursor. |
len | number of characters to delete. |