scim 1.4.18
|
The base class to implement FilterFactory classes. More...
#include <scim_filter.h>
Public Member Functions | |
FilterFactoryBase () | |
Default Constructor. | |
virtual | ~FilterFactoryBase () |
virtual void | attach_imengine_factory (const IMEngineFactoryPointer &orig) |
Attach an IMEngineFactory object to this filter. | |
virtual WideString | get_name () const |
Return the name of the original IMEngineFactory object specified in contructor or by attach_imengine_factory() method. | |
virtual String | get_uuid () const |
Return the uuid of the original IMEngineFactory object specified in contructor or by attach_imengine_factory() method. | |
virtual String | get_icon_file () const |
Return the icon file path of the original IMEngineFactory object specified in contructor or by attach_imengine_factory() method. | |
virtual WideString | get_authors () const |
Return the authors information of the original IMEngineFactory object specified in contructor or by attach_imengine_factory() method. | |
virtual WideString | get_credits () const |
Return the credits information of the original IMEngineFactory object specified in contructor or by attach_imengine_factory() method. | |
virtual WideString | get_help () const |
Return the help information of the original IMEngineFactory object specified in contructor or by attach_imengine_factory() method. | |
virtual String | get_language () const |
Return the supported language of the original IMEngineFactory object specified in contructor or by attach_imengine_factory() method. | |
virtual bool | validate_encoding (const String &encoding) const |
Check if an encoding is supported by the original IMEngineFactory object specified in constructor or by attach_imengine_factory() method. | |
virtual bool | validate_locale (const String &locale) const |
Check if an locale is supported by the original IMEngineFactory object specified in constructor or by attach_imengine_factory() method. | |
virtual WideString | inverse_query (const WideString &str) |
Get the original key string of a composed string by calling the same method of the original IMEngineFactory object specified in constructor or by attach_imengine_factory() method. | |
virtual IMEngineInstancePointer | create_instance (const String &encoding, int id=-1) |
Create an IMEngineInstance object of the original IMEngineFactory object specified in constructor or by attach_imengine_factory() method. | |
![]() | |
IMEngineFactoryBase () | |
virtual | ~IMEngineFactoryBase () |
Virtual destructor. | |
String | get_default_locale () const |
Get the default locale of this input method engine. | |
String | get_default_encoding () const |
Get the default encoding of this input method engine. | |
String | get_locales () const |
Get a list of all supported locales, separated by comma. | |
String | get_encodings () const |
Get a list of all supported encodings, separated by comma. | |
![]() | |
bool | is_referenced () const |
void | ref () |
Increase an object's reference count by one. | |
void | unref () |
Additional Inherited Members | |
![]() | |
void | set_locales (const String &locales) |
Set the locales supported by this input method engine. | |
void | set_languages (const String &languages) |
Set the languages supported by this input method engine. | |
![]() | |
ReferencedObject () | |
Constructor. | |
virtual | ~ReferencedObject ()=0 |
Destructor. | |
void | set_referenced (bool reference) |
The base class to implement FilterFactory classes.
All FilterFactory classes should derive from this class and some base methods should be overrided in the derived classes.
If a FilterFactory object need large amount of data (eg. mapping table etc.), it'd better to share these data among all other objects of the same class. Because multiple objects of one FilterFactory class maybe used at the same time to filter several real IMEngineFactory objects.
scim::FilterFactoryBase::FilterFactoryBase | ( | ) |
Default Constructor.
|
virtual |
|
virtual |
Attach an IMEngineFactory object to this filter.
The attached object could also be a filter.
This method will set the supported locales of this filter factory to the locales supported by the original IMEngineFactory object.
This method could be overrided in derived class, in which some special tasks could be done, for example, set additional supported locales. But this method of base class must be invoked to attach the factory correctly.
The IMEngineFactoryPointer orig may not be kept and used by derived class directly. All tasks related to the original IMEngineFactory object should be done by calling the corresponding methods of FilterFactoryBase class.
orig | The original IMEngineFactory object to be filtered. |
|
virtual |
Return the name of the original IMEngineFactory object specified in contructor or by attach_imengine_factory() method.
If there is no IMEngineFactory attached yet, then an empty string would be returned.
The derived class should override this method to return the name of the filter itself when it returns an empty string.
The derived method should look like:
WideString XXXFilterFactory::get_name () { WideString name = FilterFactoryBase::get_name (); return name.length () ? name : _("XXX"); }
Implements scim::IMEngineFactoryBase.
Return the uuid of the original IMEngineFactory object specified in contructor or by attach_imengine_factory() method.
If there is no IMEngineFactory attached yet, then an empty string would be returned.
The derived class should override this method to return the uuid of the filter itself when it returns an empty string.
Implements scim::IMEngineFactoryBase.
Return the icon file path of the original IMEngineFactory object specified in contructor or by attach_imengine_factory() method.
If there is no IMEngineFactory attached yet, then an empty string would be returned.
The derived class should override this method to return the icon file path of the filter itself when it returns an empty string.
Implements scim::IMEngineFactoryBase.
|
virtual |
Return the authors information of the original IMEngineFactory object specified in contructor or by attach_imengine_factory() method.
If there is no IMEngineFactory attached yet, then an empty string would be returned.
The derived class should override this method to return the authors information of the filter itself when it returns an empty string.
Implements scim::IMEngineFactoryBase.
|
virtual |
Return the credits information of the original IMEngineFactory object specified in contructor or by attach_imengine_factory() method.
If there is no IMEngineFactory attached yet, then an empty string would be returned.
The derived class should override this method to return the credits information of the filter itself when it returns an empty string.
Implements scim::IMEngineFactoryBase.
|
virtual |
Return the help information of the original IMEngineFactory object specified in contructor or by attach_imengine_factory() method.
If there is no IMEngineFactory attached yet, then an empty string would be returned.
The derived class should override this method to return the combined help information of the filter itself and the original IMEngineFactory to be filtered.
Implements scim::IMEngineFactoryBase.
Return the supported language of the original IMEngineFactory object specified in contructor or by attach_imengine_factory() method.
If there is no IMEngineFactory attached yet, then an empty string would be returned.
The derived class may override this method to return a different language which is supported by the filter itself.
Reimplemented from scim::IMEngineFactoryBase.
Check if an encoding is supported by the original IMEngineFactory object specified in constructor or by attach_imengine_factory() method.
If there is no IMEngineFactory attached yet, then false would be returned.
The derived class may override this method to provide its own validate routing.
Reimplemented from scim::IMEngineFactoryBase.
Check if an locale is supported by the original IMEngineFactory object specified in constructor or by attach_imengine_factory() method.
If there is no IMEngineFactory attached yet, then false would be returned.
The derived class may override this method to provide its own validate routing.
Reimplemented from scim::IMEngineFactoryBase.
|
virtual |
Get the original key string of a composed string by calling the same method of the original IMEngineFactory object specified in constructor or by attach_imengine_factory() method.
If there is no IMEngineFactory attached yet, then an empty string would be returned.
Reimplemented from scim::IMEngineFactoryBase.
|
virtual |
Create an IMEngineInstance object of the original IMEngineFactory object specified in constructor or by attach_imengine_factory() method.
The derived class should override this method and create its own instance object from the result of this base method.
The code may look like:
IMEngineInstancePointer XXXFilterFactory::create_instance (const String& encoding, int id) { return new XXXFilterInstance (this, FilterFactoryBase::create_instance (encoding, id)); }
Implements scim::IMEngineFactoryBase.