scim 1.4.18
scim::FilterFactoryBase Class Reference

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.
 
- Public Member Functions inherited from scim::IMEngineFactoryBase
 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.
 
- Public Member Functions inherited from scim::ReferencedObject
bool is_referenced () const
 
void ref ()
 Increase an object's reference count by one.
 
void unref ()
 

Additional Inherited Members

- Protected Member Functions inherited from scim::IMEngineFactoryBase
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.
 
- Protected Member Functions inherited from scim::ReferencedObject
 ReferencedObject ()
 Constructor.
 
virtual ~ReferencedObject ()=0
 Destructor.
 
void set_referenced (bool reference)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ FilterFactoryBase()

scim::FilterFactoryBase::FilterFactoryBase ( )

Default Constructor.

◆ ~FilterFactoryBase()

virtual scim::FilterFactoryBase::~FilterFactoryBase ( )
virtual

Member Function Documentation

◆ attach_imengine_factory()

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.

Parameters
origThe original IMEngineFactory object to be filtered.

◆ get_name()

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.

◆ get_uuid()

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.

◆ get_icon_file()

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.

◆ get_authors()

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.

◆ get_credits()

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.

◆ get_help()

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.

◆ get_language()

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.

◆ validate_encoding()

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.

◆ validate_locale()

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.

◆ inverse_query()

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.

◆ create_instance()

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.


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