scim 1.4.18
|
The base class to implement the FrontEnd objects. More...
#include <scim_frontend.h>
Public Member Functions | |
FrontEndBase (const BackEndPointer &backend) | |
Constructor. | |
virtual | ~FrontEndBase () |
Virtual destructor. | |
virtual void | init (int argc, char **argv)=0 |
init the frontend. | |
virtual void | run ()=0 |
run the frontend. | |
![]() | |
bool | is_referenced () const |
void | ref () |
Increase an object's reference count by one. | |
void | unref () |
Protected Member Functions | |
functions can be used by derived classes. | |
uint32 | get_factory_list_for_encoding (std::vector< String > &uuids, const String &encoding) const |
Get the IMEngine factories list for specific encoding. | |
uint32 | get_factory_list_for_language (std::vector< String > &uuids, const String &language) const |
Get the IMEngine factories list for specific language. | |
String | get_default_factory (const String &language, const String &encoding) const |
Get the default IMEngineFactory UUID for a specific language and encoding. | |
void | set_default_factory (const String &language, const String &uuid) |
Set the default IMEngineFactory for a specific language. | |
String | get_next_factory (const String &language, const String &encoding, const String &cur_uuid) const |
Get the next IMEngineFactory for a specific language and encoding. | |
String | get_previous_factory (const String &language, const String &encoding, const String &cur_uuid) const |
Get the previous IMEngineFactory for a specific language and encoding. | |
WideString | get_factory_name (const String &uuid) const |
get the name of an IMEngine factory. | |
WideString | get_factory_authors (const String &uuid) const |
get the authors info of an IMEngine factory. | |
WideString | get_factory_credits (const String &uuid) const |
get the credits info of an IMEngine factory. | |
WideString | get_factory_help (const String &uuid) const |
get the help info of an IMEngine factory. | |
String | get_factory_icon_file (const String &uuid) const |
get the icon file of an IMEngine factory. | |
String | get_factory_locales (const String &uuid) const |
get the supported locales of an IMEngine factory. | |
String | get_factory_language (const String &uuid) const |
get the language of an IMEngine factory. | |
bool | validate_factory (const String &uuid, const String &encoding=String("")) const |
Check if an IMEngine factory is valid and the given encoding is supported by it. | |
String | get_all_locales () const |
get all locales supported by BackEnd. | |
int | new_instance (const String &sf_uuid, const String &encoding) |
create a new IMEngine instance for specific encoding. | |
bool | replace_instance (int si_id, const String &sf_uuid) |
replace an IMEngine instance by a new instance created by another factory. | |
bool | delete_instance (int id) |
delete an IMEngine instance according to its id. | |
void | delete_all_instances () |
delete all IMEngine instances. | |
String | get_instance_uuid (int id) const |
get the factory uuid of this instance. | |
String | get_instance_encoding (int id) const |
get the working encoding of an IMEngine instance. | |
WideString | get_instance_name (int id) const |
get the name of an IMEngine instance. | |
WideString | get_instance_authors (int id) const |
get the authors info of an IMEngine instance. | |
WideString | get_instance_credits (int id) const |
get the credits info of an IMEngine instance. | |
WideString | get_instance_help (int id) const |
get the help of an IMEngine instance. | |
String | get_instance_icon_file (int id) const |
get the icon file of an IMEngine instance. | |
bool | process_key_event (int id, const KeyEvent &key) const |
process a key event using specific IMEngine instance. | |
void | move_preedit_caret (int id, unsigned int pos) const |
let a specific IMEngine instance move its preedit caret. | |
void | select_candidate (int id, unsigned int index) const |
let a specific IMEngine instance select a candidate in its current lookup table. | |
void | update_lookup_table_page_size (int id, unsigned int page_size) const |
update the page size of a specific IMEngine instance's lookup table. | |
void | lookup_table_page_up (int id) const |
Let a specific IMEngine instance flip its lookup table to the previous page. | |
void | lookup_table_page_down (int id) const |
Let a specific IMEngine instance flip its lookup table to the previous page. | |
void | reset (int id) const |
reset a specific IMEngine instance. | |
void | focus_in (int id) const |
focus in a specific IMEngine instance. | |
void | focus_out (int id) const |
focus out a specific IMEngine instance. | |
void | trigger_property (int id, const String &property) const |
trigger a property of a specific IMEngine instance. | |
void | process_helper_event (int id, const String &helper_uuid, const Transaction &trans) const |
let a specific IMEngine instance to process the events sent from a Helper process. | |
void | update_client_capabilities (int id, unsigned int cap) const |
let a specific IMEngine instance to update itself according to the capabilities of the client application. | |
Virtual protected methods. | |
The following methods should be implemented by derivation classes. these functions handle the real things. | |
virtual void | show_preedit_string (int id) |
show preedit string area for an IMEngine instance. | |
virtual void | show_aux_string (int id) |
show aux string area for an IMEngine instance. | |
virtual void | show_lookup_table (int id) |
show lookup table area for an IMEngine instance. | |
virtual void | hide_preedit_string (int id) |
hide preedit string area for an IMEngine instance. | |
virtual void | hide_aux_string (int id) |
hide aux string area for an IMEngine instance. | |
virtual void | hide_lookup_table (int id) |
hide lookup table area for an IMEngine instance. | |
virtual void | update_preedit_caret (int id, int caret) |
update the position of preedit caret for an IMEngine instance. | |
virtual void | update_preedit_string (int id, const WideString &str, const AttributeList &attrs) |
update the content of preedit string for an IMEngine instance. | |
virtual void | update_aux_string (int id, const WideString &str, const AttributeList &attrs) |
update the content of aux string for an IMEngine instance. | |
virtual void | update_lookup_table (int id, const LookupTable &table) |
update the content of lookup table for an IMEngine instance. | |
virtual void | commit_string (int id, const WideString &str) |
commit a string to client for an IMEngine instance. | |
virtual void | forward_key_event (int id, const KeyEvent &key) |
forward a keyevent to the client of an IMEngine instance. | |
virtual void | register_properties (int id, const PropertyList &properties) |
register all the properties of an IMEngine instance into this FrontEnd. | |
virtual void | update_property (int id, const Property &property) |
update a property of an IMEngine instance. | |
virtual void | beep (int id) |
generate a short beep. | |
virtual void | start_helper (int id, const String &helper_uuid) |
start a Client Helper process. | |
virtual void | stop_helper (int id, const String &helper_uuid) |
stop a Client Helper process. | |
virtual void | send_helper_event (int id, const String &helper_uuid, const Transaction &trans) |
send an events transaction to a Client Helper process. | |
virtual bool | get_surrounding_text (int id, WideString &text, int &cursor, int maxlen_before, int maxlen_after) |
Retrieves context around the insertion point. | |
virtual bool | delete_surrounding_text (int id, int offset, int len) |
Ask the client to delete characters around the cursor position. | |
![]() | |
ReferencedObject () | |
Constructor. | |
virtual | ~ReferencedObject ()=0 |
Destructor. | |
void | set_referenced (bool reference) |
Friends | |
class | FrontEndBaseImpl |
The base class to implement the FrontEnd objects.
FrontEnd is an interface between IMEngineFactory/IMEngineInstance objects and the user applications. It forward the user requests to IMEngineFactory/IMEngineInstance objects, and handle the requests sent back.
scim::FrontEndBase::FrontEndBase | ( | const BackEndPointer & | backend | ) |
Constructor.
backend | A BackEnd object which holds all IMEngineFactory objects. |
|
virtual |
Virtual destructor.
|
protected |
Get the IMEngine factories list for specific encoding.
uuids | the vector to store the factories' uuids which support the encoding. |
encoding | the encoding to be queried. If empty, all IMEngine factories will be returned. |
|
protected |
Get the IMEngine factories list for specific language.
uuids | the vector to store the factories' uuids which support the encoding. |
language | the language to be queried. If empty, all IMEngine factories will be returned. |
|
protected |
Get the default IMEngineFactory UUID for a specific language and encoding.
language | the language to be queried. |
encoding | the encoding to be queried, if empty then don't match encoding. |
|
protected |
Set the default IMEngineFactory for a specific language.
language | the language to be set. |
uuid | the uuid of the default IMEngineFactory for this language. |
|
protected |
Get the next IMEngineFactory for a specific language and encoding.
language | the language to be queried, if empty then don't match language. |
encoding | the encoding to be queried, if empty then don't match encoding. |
cur_uuid | the UUID of current IMEngineFactory. |
|
protected |
Get the previous IMEngineFactory for a specific language and encoding.
language | the language to be queried, if empty then don't match language. |
encoding | the encoding to be queried, if empty then don't match encoding. |
cur_uuid | the UUID of current IMEngineFactory. |
|
protected |
get the name of an IMEngine factory.
uuid | the uuid of the IMEngine factory |
|
protected |
get the authors info of an IMEngine factory.
uuid | the uuid of the IMEngine factory |
|
protected |
get the credits info of an IMEngine factory.
uuid | the uuid of the IMEngine factory |
|
protected |
get the help info of an IMEngine factory.
uuid | the uuid of the IMEngine factory |
get the icon file of an IMEngine factory.
uuid | the uuid of the IMEngine factory |
get the supported locales of an IMEngine factory.
uuid | the uuid of the IMEngine factory |
get the language of an IMEngine factory.
uuid | the uuid of the IMEngine factory |
|
protected |
Check if an IMEngine factory is valid and the given encoding is supported by it.
uuid | The uuid of the IMEngine factory to be checked. |
encoding | The encoding should be supported by the factory. |
|
protected |
get all locales supported by BackEnd.
create a new IMEngine instance for specific encoding.
sf_uuid | the IMEngineFactory UUID. |
encoding | the encoding to be used. |
replace an IMEngine instance by a new instance created by another factory.
This function is used to change the input method for an input context on the fly.
si_id | the IMEngine instance to be replaced. |
sf_uuid | the new IMEngine factory to be used. |
delete an IMEngine instance according to its id.
id | the id of the IMEngine instance to be deleted. |
|
protected |
delete all IMEngine instances.
This function should be called just before quitting the FrontEnd.
get the factory uuid of this instance.
id | the IMEngine instance id. |
get the working encoding of an IMEngine instance.
id | the IMEngine instance id. |
|
protected |
get the name of an IMEngine instance.
id | the IMEngine instance id. |
|
protected |
get the authors info of an IMEngine instance.
id | the IMEngine instance id. |
|
protected |
get the credits info of an IMEngine instance.
id | the IMEngine instance id. |
|
protected |
get the help of an IMEngine instance.
id | the IMEngine instance id. |
get the icon file of an IMEngine instance.
id | the IMEngine instance id. |
process a key event using specific IMEngine instance.
id | the IMEngine instance id. |
key | the key event to be processed. |
let a specific IMEngine instance move its preedit caret.
id | the IMEngine instance id. |
pos | the new preedit caret position. |
let a specific IMEngine instance select a candidate in its current lookup table.
id | the IMEngine instance id. |
index | the candidate index in current lookup table page to be selected. |
|
protected |
update the page size of a specific IMEngine instance's lookup table.
id | the IMEngine instance id. |
page_size | the new page size to be used. |
Let a specific IMEngine instance flip its lookup table to the previous page.
Let a specific IMEngine instance flip its lookup table to the previous page.
reset a specific IMEngine instance.
id | the id of the IMEngine instance to be reset. |
focus in a specific IMEngine instance.
id | the id of the IMEngine instance to be focused in. |
focus out a specific IMEngine instance.
id | the id of the IMEngine instance to be focused out. |
trigger a property of a specific IMEngine instance.
id | the id of the IMEngine instance. |
property | the key of the property to be triggered. |
|
protected |
let a specific IMEngine instance to process the events sent from a Helper process.
id | the id of the IMEngine instance. |
helper_uuid | the uuid of the Helper process. |
trans | the transaction which contains the events. |
let a specific IMEngine instance to update itself according to the capabilities of the client application.
id | the id of the IMEngine instance. |
cap | the bitset of the capabilities which are supported by client. |
show preedit string area for an IMEngine instance.
id | the id of the IMEngine instance. It must have been focused in. |
show aux string area for an IMEngine instance.
id | the id of the IMEngine instance. It must have been focused in. |
show lookup table area for an IMEngine instance.
id | the id of the IMEngine instance. It must have been focused in. |
hide preedit string area for an IMEngine instance.
id | the id of the IMEngine instance. It must have been focused in. |
hide aux string area for an IMEngine instance.
id | the id of the IMEngine instance. It must have been focused in. |
hide lookup table area for an IMEngine instance.
id | the id of the IMEngine instance. It must have been focused in. |
update the position of preedit caret for an IMEngine instance.
id | the id of the IMEngine instance. It must have been focused in. |
caret | the new caret position. |
|
protectedvirtual |
update the content of preedit string for an IMEngine instance.
id | the id of the IMEngine instance. It must have been focused in. |
str | the new content of preedit string. |
attrs | the string attributes. |
|
protectedvirtual |
update the content of aux string for an IMEngine instance.
id | the id of the IMEngine instance. It must have been focused in. |
str | the new content of aux string. |
attrs | the string attributes. |
|
protectedvirtual |
update the content of lookup table for an IMEngine instance.
id | the id of the IMEngine instance. It must have been focused in. |
table | the new lookup table. |
|
protectedvirtual |
commit a string to client for an IMEngine instance.
id | the id of the IMEngine instance to commit the string. |
str | the string to be committed. |
|
protectedvirtual |
forward a keyevent to the client of an IMEngine instance.
id | the id of the IMEngine instance. |
key | the key event to be forwarded. |
|
protectedvirtual |
register all the properties of an IMEngine instance into this FrontEnd.
id | the id of the IMEngine instance. It must have been focused in. |
properties | the PropertyList contains all the properties of this IMEngine instance. |
|
protectedvirtual |
update a property of an IMEngine instance.
id | the id of the IMEngine instance. It must have been focused in. |
property | the Property to be updated. |
generate a short beep.
id | the id of the IMEngine instance. It must have been focused in. |
|
protectedvirtual |
start a Client Helper process.
id | the id of the IMEngine instance. It must have been focused in. |
helper_uuid | The UUID of the Helper object. |
|
protectedvirtual |
stop a Client Helper process.
id | the id of the IMEngine instance. It must have been focused in. |
helper_uuid | The UUID of the Helper object. |
|
protectedvirtual |
send an events transaction to a Client Helper process.
id | the id of the IMEngine instance. It must have been focused in. |
helper_uuid | The UUID of the Helper object. |
trans | the transaction which contains events. |
|
protectedvirtual |
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.
id | the id of the IMEngine instance. It must have been focused in. |
text | location to store the context string around the insertion point. |
cursor | location to store index of the insertion cursor within @text. |
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. |
|
protectedvirtual |
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.
id | the id of the IMEngine instance. It must have been focused in. |
offset | offset from cursor position in chars; a negative value means start before the cursor. |
len | number of characters to delete. |
init the frontend.
This method must be implemented by derivation classes.
run the frontend.
This method must be implemented by derivation classes.