scim  1.4.18
scim::FilterInstanceBase Class Reference

The base class to implement FilterInstance classes. More...

#include <scim_filter.h>

Public Member Functions

 FilterInstanceBase (FilterFactoryBase *factory, const IMEngineInstancePointer &orig_inst)
 Constructor. More...
 
virtual ~FilterInstanceBase ()
 
virtual bool set_encoding (const String &encoding)
 Set the working encoding for this filter instance as well as the original instance which is currently filtered. More...
 
Action functions.

These functions will be called by FrontEnds to send events to this FilterInstance.

These methods can be overrided, if the derived class wants to filter these events.

The default implementation of these methods are just to call the corresponding methods of the original IMEngineInstance object which is filtered by this filter.

virtual bool process_key_event (const KeyEvent &key)
 Process a key event. More...
 
virtual void move_preedit_caret (unsigned int pos)
 Move the preedit caret in the preedit string. More...
 
virtual void select_candidate (unsigned int index)
 Select a candidate in current lookup table. More...
 
virtual void update_lookup_table_page_size (unsigned int page_size)
 Update the page size of current lookup table. More...
 
virtual void lookup_table_page_up ()
 Flip the lookup table to the previous page. More...
 
virtual void lookup_table_page_down ()
 Flip the lookup table to the next page. More...
 
virtual void reset ()
 Reset this engine instance. More...
 
virtual void focus_in ()
 Focus in this engine instance. More...
 
virtual void focus_out ()
 Focus out this engine instance. More...
 
virtual void trigger_property (const String &property)
 Trigger a property. More...
 
virtual void process_helper_event (const String &helper_uuid, const Transaction &trans)
 Process the events sent from a Client Helper process. More...
 
virtual void update_client_capabilities (unsigned int cap)
 Update the capabilities of current client application which is attached to this IMEngineInstance. More...
 
- Public Member Functions inherited from scim::IMEngineInstanceBase
 IMEngineInstanceBase (IMEngineFactoryBase *factory, const String &encoding, int id=-1)
 Constructor. More...
 
virtual ~IMEngineInstanceBase ()
 Virtual destructor. More...
 
String get_encoding () const
 Get the working encoding of this instance. More...
 
int get_id () const
 Get the unique id of this instance. More...
 
String get_factory_uuid () const
 Get the UUID of the engine factory. More...
 
void set_frontend_data (void *data)
 Attach a pointer to this IMEngineInstance, which is pointed to corresponding FrontEnd data. More...
 
void * get_frontend_data (void)
 Retrieve the pointer previously attached by set_frontend_data();. More...
 
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)
 
Connection signal_connect_beep (IMEngineSlotVoid *slot)
 
Connection signal_connect_start_helper (IMEngineSlotString *slot)
 
Connection signal_connect_stop_helper (IMEngineSlotString *slot)
 
Connection signal_connect_send_helper_event (IMEngineSlotStringTransaction *slot)
 
Connection signal_connect_get_surrounding_text (IMEngineSlotGetSurroundingText *slot)
 
Connection signal_connect_delete_surrounding_text (IMEngineSlotDeleteSurroundingText *slot)
 
- Public Member Functions inherited from scim::ReferencedObject
bool is_referenced () const
 
void ref ()
 Increase an object's reference count by one. More...
 
void unref ()
 

Protected Member Functions

Signal activation functions.

@

These methods will be called by FilterInstanceBase class when the corresponding signals are emitted by the original IMEngineInstance object which is filtered by this filter.

These methods can be overrided, if the derived class wants to filter these signals. The default implementation of these methods are just to deliver the signals to FrontEnd directly.

virtual void filter_show_preedit_string ()
 
virtual void filter_show_aux_string ()
 
virtual void filter_show_lookup_table ()
 
virtual void filter_hide_preedit_string ()
 
virtual void filter_hide_aux_string ()
 
virtual void filter_hide_lookup_table ()
 
virtual void filter_update_preedit_caret (int caret)
 
virtual void filter_update_preedit_string (const WideString &str, const AttributeList &attrs=AttributeList())
 
virtual void filter_update_aux_string (const WideString &str, const AttributeList &attrs=AttributeList())
 
virtual void filter_update_lookup_table (const LookupTable &table)
 
virtual void filter_commit_string (const WideString &str)
 
virtual void filter_forward_key_event (const KeyEvent &key)
 
virtual void filter_register_properties (const PropertyList &properties)
 
virtual void filter_update_property (const Property &property)
 
virtual void filter_beep ()
 
virtual void filter_start_helper (const String &helper_uuid)
 
virtual void filter_stop_helper (const String &helper_uuid)
 
virtual void filter_send_helper_event (const String &helper_uuid, const Transaction &trans)
 
virtual bool filter_get_surrounding_text (WideString &text, int &cursor, int maxlen_before=-1, int maxlen_after=-1)
 
virtual bool filter_delete_surrounding_text (int offset, int len)
 
- Protected Member Functions inherited from scim::IMEngineInstanceBase
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...
 
- Protected Member Functions inherited from scim::ReferencedObject
 ReferencedObject ()
 Constructor. More...
 
virtual ~ReferencedObject ()=0
 Destructor. More...
 
void set_referenced (bool reference)
 

Friends

class FilterInstanceBaseImpl
 

Detailed Description

The base class to implement FilterInstance classes.

All FilterInstance classes should derive from this base class, and some base methods should be override in the derived classes.

Constructor & Destructor Documentation

◆ FilterInstanceBase()

scim::FilterInstanceBase::FilterInstanceBase ( FilterFactoryBase factory,
const IMEngineInstancePointer orig_inst 
)

Constructor.

The Constructor of derived class should call this Contructor with the following two parameters.

The orig_inst should be created by invoking FilterFactoryBase::create_instance() within the same method of derived FilterFactory classes.

Parameters
factorythe FilterFactory which creates this instance.
orig_instthe original IMEngineInstance to be filtered.

◆ ~FilterInstanceBase()

virtual scim::FilterInstanceBase::~FilterInstanceBase ( )
virtual

Member Function Documentation

◆ set_encoding()

virtual bool scim::FilterInstanceBase::set_encoding ( const String encoding)
virtual

Set the working encoding for this filter instance as well as the original instance which is currently filtered.

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.

If you want to use different encodings in this filter instance and the original instance which is currently filtered, this method should be overrided in the derived class and two different encodings should be set respectively by calling FilterInstanceBase::set_encoding() and IMEngineInstanceBase::set_encoding (); The code may look like:

bool XXXFilterInstance::set_encoding (const String &encoding) { FilterInstanceBase::set_encoding ("Other Encoding"); // Set the encoding of the original instance to another one. return IMEngineInstanceBase::set_encoding (encoding); // Set the encoding of this filter instance to the desired one. }

Returns
true if the encoding is supported, otherwise false.

Reimplemented from scim::IMEngineInstanceBase.

◆ process_key_event()

virtual bool scim::FilterInstanceBase::process_key_event ( const KeyEvent key)
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.

Implements scim::IMEngineInstanceBase.

◆ move_preedit_caret()

virtual void scim::FilterInstanceBase::move_preedit_caret ( unsigned int  pos)
virtual

Move the preedit caret in the preedit string.

Parameters
pos- the new position that user requested.

Reimplemented from scim::IMEngineInstanceBase.

◆ select_candidate()

virtual void scim::FilterInstanceBase::select_candidate ( unsigned int  index)
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.

Reimplemented from scim::IMEngineInstanceBase.

◆ update_lookup_table_page_size()

virtual void scim::FilterInstanceBase::update_lookup_table_page_size ( unsigned int  page_size)
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.

Reimplemented from scim::IMEngineInstanceBase.

◆ lookup_table_page_up()

virtual void scim::FilterInstanceBase::lookup_table_page_up ( )
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 from scim::IMEngineInstanceBase.

◆ lookup_table_page_down()

virtual void scim::FilterInstanceBase::lookup_table_page_down ( )
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 from scim::IMEngineInstanceBase.

◆ reset()

virtual void scim::FilterInstanceBase::reset ( )
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 from scim::IMEngineInstanceBase.

◆ focus_in()

virtual void scim::FilterInstanceBase::focus_in ( )
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 from scim::IMEngineInstanceBase.

◆ focus_out()

virtual void scim::FilterInstanceBase::focus_out ( )
virtual

Focus out this engine instance.

Reimplemented from scim::IMEngineInstanceBase.

◆ trigger_property()

virtual void scim::FilterInstanceBase::trigger_property ( const String property)
virtual

Trigger a property.

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

Parameters
propertythe key of the triggered property.

Reimplemented from scim::IMEngineInstanceBase.

◆ process_helper_event()

virtual void scim::FilterInstanceBase::process_helper_event ( const String helper_uuid,
const Transaction trans 
)
virtual

Process the events sent from a Client Helper process.

Parameters
helper_uuidThe UUID of the Helper process which sent the events.
transThe transaction which contains the events.

Reimplemented from scim::IMEngineInstanceBase.

◆ update_client_capabilities()

virtual void scim::FilterInstanceBase::update_client_capabilities ( unsigned int  cap)
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:

  • OnTheSpot preedit string display (Embedded into client window).
  • Property display
  • Helper module
  • etc.

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.

Parameters
capA bitmask to indicate which client capabilities are supported by the client application.
See also
scim::ClientCapability

Reimplemented from scim::IMEngineInstanceBase.

◆ filter_show_preedit_string()

virtual void scim::FilterInstanceBase::filter_show_preedit_string ( )
protectedvirtual

◆ filter_show_aux_string()

virtual void scim::FilterInstanceBase::filter_show_aux_string ( )
protectedvirtual

◆ filter_show_lookup_table()

virtual void scim::FilterInstanceBase::filter_show_lookup_table ( )
protectedvirtual

◆ filter_hide_preedit_string()

virtual void scim::FilterInstanceBase::filter_hide_preedit_string ( )
protectedvirtual

◆ filter_hide_aux_string()

virtual void scim::FilterInstanceBase::filter_hide_aux_string ( )
protectedvirtual

◆ filter_hide_lookup_table()

virtual void scim::FilterInstanceBase::filter_hide_lookup_table ( )
protectedvirtual

◆ filter_update_preedit_caret()

virtual void scim::FilterInstanceBase::filter_update_preedit_caret ( int  caret)
protectedvirtual

◆ filter_update_preedit_string()

virtual void scim::FilterInstanceBase::filter_update_preedit_string ( const WideString str,
const AttributeList attrs = AttributeList() 
)
protectedvirtual

◆ filter_update_aux_string()

virtual void scim::FilterInstanceBase::filter_update_aux_string ( const WideString str,
const AttributeList attrs = AttributeList() 
)
protectedvirtual

◆ filter_update_lookup_table()

virtual void scim::FilterInstanceBase::filter_update_lookup_table ( const LookupTable table)
protectedvirtual

◆ filter_commit_string()

virtual void scim::FilterInstanceBase::filter_commit_string ( const WideString str)
protectedvirtual

◆ filter_forward_key_event()

virtual void scim::FilterInstanceBase::filter_forward_key_event ( const KeyEvent key)
protectedvirtual

◆ filter_register_properties()

virtual void scim::FilterInstanceBase::filter_register_properties ( const PropertyList properties)
protectedvirtual

◆ filter_update_property()

virtual void scim::FilterInstanceBase::filter_update_property ( const Property property)
protectedvirtual

◆ filter_beep()

virtual void scim::FilterInstanceBase::filter_beep ( )
protectedvirtual

◆ filter_start_helper()

virtual void scim::FilterInstanceBase::filter_start_helper ( const String helper_uuid)
protectedvirtual

◆ filter_stop_helper()

virtual void scim::FilterInstanceBase::filter_stop_helper ( const String helper_uuid)
protectedvirtual

◆ filter_send_helper_event()

virtual void scim::FilterInstanceBase::filter_send_helper_event ( const String helper_uuid,
const Transaction trans 
)
protectedvirtual

◆ filter_get_surrounding_text()

virtual bool scim::FilterInstanceBase::filter_get_surrounding_text ( WideString text,
int &  cursor,
int  maxlen_before = -1,
int  maxlen_after = -1 
)
protectedvirtual

◆ filter_delete_surrounding_text()

virtual bool scim::FilterInstanceBase::filter_delete_surrounding_text ( int  offset,
int  len 
)
protectedvirtual

Friends And Related Function Documentation

◆ FilterInstanceBaseImpl

friend class FilterInstanceBaseImpl
friend

The documentation for this class was generated from the following file: