scim::IMEngineFactoryBase Class Referenceabstract
IMEngine

The base class of the real input methods' IMEngineFactory classes. More...

`#include <scim_imengine.h>`

## Public Member Functions

| IMEngineFactoryBase ()
virtual | ~IMEngineFactoryBase ()
| Virtual destructor.
virtual bool | validate_encoding (const String &encoding) const
| Check if an encoding is supported by this IMEngineFactory.
virtual bool | validate_locale (const String &locale) const
| Check if a locale is supported by this IMEngineFactory.
virtual String | get_language () const
| Get the supported language of this input method engine.
virtual WideString | inverse_query (const WideString &str)
| Get the original key string of a composed string.
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.
Pure virtual members.
These member functions must be implemented in derived classes.
virtual WideString | get_name () const =0
| Get the name of this input method engine.
virtual String | get_uuid () const =0
| Get the UUID of this input method engine.
virtual String | get_icon_file () const =0
| Get the icon file path of this input method engine.
virtual WideString | get_authors () const =0
| Get the authors information of this input method engine.
virtual WideString | get_credits () const =0
| Get the credits information of this input method engine.
virtual WideString | get_help () const =0
| Get the help information of this input method engine.
virtual IMEngineInstancePointer | create_instance (const String &encoding, int id=-1)=0
| Create a new IMEngineInstance object.
Public Member Functions inherited from scim::ReferencedObject
bool | is_referenced () const
void | ref ()
| Increase an object's reference count by one.
void | unref ()

## Protected Member Functions

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 of the real input methods' IMEngineFactory classes.

Each input method should implement a class derived from scim::IMEngineFactoryBase, which takes charge of holding shared data, creating IMEngineInstances etc.

## Constructor & Destructor Documentation

## IMEngineFactoryBase()

scim::IMEngineFactoryBase::IMEngineFactoryBase | ( |  | ) |

## ~IMEngineFactoryBase()

virtual scim::IMEngineFactoryBase::~IMEngineFactoryBase | ( |  | ) |

virtual

Virtual destructor.

## Member Function Documentation

## get_name()

virtual WideString scim::IMEngineFactoryBase::get_name | ( |  | ) | const

pure virtual

Get the name of this input method engine.

This name should be a localized string.

Returns
  A WideString containing the name.

Implemented in scim::ComposeKeyFactory, scim::DummyIMEngineFactory, and scim::FilterFactoryBase.

## get_uuid()

virtual String scim::IMEngineFactoryBase::get_uuid | ( |  | ) | const

pure virtual

Get the UUID of this input method engine.

Each input method engine has an unique UUID to distinguish itself from other engines.

You may use uuidgen command shipped with e2fsprogs package to generate this UUID.

Returns
  A String containing an unique UUID.

Implemented in scim::ComposeKeyFactory, scim::DummyIMEngineFactory, and scim::FilterFactoryBase.

## get_icon_file()

virtual String scim::IMEngineFactoryBase::get_icon_file | ( |  | ) | const

pure virtual

Get the icon file path of this input method engine.

Returns
  A String containing the icon file path on the local filesystem.

Implemented in scim::ComposeKeyFactory, scim::DummyIMEngineFactory, and scim::FilterFactoryBase.

## get_authors()

virtual WideString scim::IMEngineFactoryBase::get_authors | ( |  | ) | const

pure virtual

Get the authors information of this input method engine.

This string should be a localized string.

Returns
  A WideString containing a list of the authors' name.

Implemented in scim::ComposeKeyFactory, scim::DummyIMEngineFactory, and scim::FilterFactoryBase.

## get_credits()

virtual WideString scim::IMEngineFactoryBase::get_credits | ( |  | ) | const

pure virtual

Get the credits information of this input method engine.

This string should be a localized string.

Returns
  A WideString containing the credits information.

Implemented in scim::ComposeKeyFactory, scim::DummyIMEngineFactory, and scim::FilterFactoryBase.

## get_help()

virtual WideString scim::IMEngineFactoryBase::get_help | ( |  | ) | const

pure virtual

Get the help information of this input method engine.

This string should be a localized string.

Returns
  A WideString containing the help information.

Implemented in scim::ComposeKeyFactory, scim::DummyIMEngineFactory, and scim::FilterFactoryBase.

## create_instance()

virtual IMEngineInstancePointer scim::IMEngineFactoryBase::create_instance | ( | const String & | encoding,
|  | int | id = -1 )

pure virtual

Create a new IMEngineInstance object.

This method creates a new scim::IMEngineInstanceBase object with the given encoding and id.

Parameters

  encoding | - the encoding supported by the client.
  id | - the instance id, should be unique.

Returns
  A smart pointer points to this new IMEngineInstance object.

Implemented in scim::ComposeKeyFactory, scim::DummyIMEngineFactory, and scim::FilterFactoryBase.

## validate_encoding()

virtual bool scim::IMEngineFactoryBase::validate_encoding | ( | const String & | encoding | ) | const

virtual

Check if an encoding is supported by this IMEngineFactory.

The default implementation of this virtual function validates the encoding against the locale list set by method set_locales.

It should be enough in most case.

Parameters

  encoding | - the encoding name to be checked.

Returns
  true if the encoding is supported, otherwise false.

Reimplemented in scim::ComposeKeyFactory, scim::DummyIMEngineFactory, and scim::FilterFactoryBase.

## validate_locale()

virtual bool scim::IMEngineFactoryBase::validate_locale | ( | const String & | locale | ) | const

virtual

Check if a locale is supported by this IMEngineFactory.

The default implementation of this virtual function validates the locale against the locale list set by method set_locales.

It should be enough in most case.

Parameters

  locale | - the locale name to be checked.

Returns
  true if the locale is supported, otherwise false.

Reimplemented in scim::ComposeKeyFactory, scim::DummyIMEngineFactory, and scim::FilterFactoryBase.

## get_language()

virtual String scim::IMEngineFactoryBase::get_language | ( |  | ) | const

virtual

Get the supported language of this input method engine.

The language name conforms to glibc locale naming standard, like: zh_CN Simplified Chinese zh_TW Traditional Chinese ja_JP Japanese ru_RU for Russian

The second part of the name (territory id) can be omitted.

The default implementation of this method will get the language name according to the return value of get_default_locale () method.

This method maybe overwrited to return another language name, for example returning "~other" means other uncategorized languages.

Reimplemented in scim::FilterFactoryBase.

## inverse_query()

virtual WideString scim::IMEngineFactoryBase::inverse_query | ( | const WideString & | str | ) |

virtual

Get the original key string of a composed string.

For example, in the pinyin input method of Simplified Chinese: the key string of composed string "中国" can be "zhongguo".

The default implementation just returns a empty string.

Parameters

  str | The composed string to be queried.

Returns
  the original key string of the given composed string.

Reimplemented in scim::FilterFactoryBase.

## get_default_locale()

String scim::IMEngineFactoryBase::get_default_locale | ( |  | ) | const

Get the default locale of this input method engine.

The default locale is the first locale in the locale list, which is set by method set_locales.

Returns
  The default locale name.

## get_default_encoding()

String scim::IMEngineFactoryBase::get_default_encoding | ( |  | ) | const

Get the default encoding of this input method engine.

The default encoding is the first locale's encoding in the locale list, which is set by method set_locales.

Returns
  The default encoding name.

## get_locales()

String scim::IMEngineFactoryBase::get_locales | ( |  | ) | const

Get a list of all supported locales, separated by comma.

Returns
  A comma separated locale list.

## get_encodings()

String scim::IMEngineFactoryBase::get_encodings | ( |  | ) | const

Get a list of all supported encodings, separated by comma.

Returns
  A comma separated encoding list.

## set_locales()

void scim::IMEngineFactoryBase::set_locales | ( | const String & | locales | ) |

protected

Set the locales supported by this input method engine.

This method should be called within the constructors of the derived classes.

set_locales () and set_languages () are exclusive with each other. Only one method should be used for one Factory object.

Parameters

  locales | - a comma separated list containing all valid locales should be supported by this input method engine. The first locale is the default one.

## set_languages()

void scim::IMEngineFactoryBase::set_languages | ( | const String & | languages | ) |

protected

Set the languages supported by this input method engine.

This method should be called within the constructors of the derived classes.

set_locales () and set_languages () are exclusive with each other. Only one method should be used for one Factory object.

Parameters

  languages | - a comma separated list containing all valid languages should be supported by this input method engine. The first language is the default one.

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

- scim_imengine.h