#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. |
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 scim::FilterFactoryBase::~FilterFactoryBase | ( | ) | [virtual] |
virtual void scim::FilterFactoryBase::attach_imengine_factory | ( | const IMEngineFactoryPointer & | orig | ) | [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 WideString scim::FilterFactoryBase::get_name | ( | ) | const [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.
virtual String scim::FilterFactoryBase::get_uuid | ( | ) | const [virtual] |
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.
virtual String scim::FilterFactoryBase::get_icon_file | ( | ) | const [virtual] |
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 WideString scim::FilterFactoryBase::get_authors | ( | ) | const [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 WideString scim::FilterFactoryBase::get_credits | ( | ) | const [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 WideString scim::FilterFactoryBase::get_help | ( | ) | const [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.
virtual String scim::FilterFactoryBase::get_language | ( | ) | const [virtual] |
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.
virtual bool scim::FilterFactoryBase::validate_encoding | ( | const String & | encoding | ) | const [virtual] |
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.
virtual bool scim::FilterFactoryBase::validate_locale | ( | const String & | locale | ) | const [virtual] |
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 WideString scim::FilterFactoryBase::inverse_query | ( | const WideString & | str | ) | [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 IMEngineInstancePointer scim::FilterFactoryBase::create_instance | ( | const String & | encoding, | |
int | id = -1 | |||
) | [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.