Home ยท API Reference |
Abstract driver class for adding new error correction/prediction engines plugins. More...
#include <mimenginewordsinterface.h>
Public Member Functions | |
MImEngineWordsInterface () | |
virtual | ~MImEngineWordsInterface () |
virtual bool | init ()=0 |
virtual bool | addDictionaryWord (const QString &word, MImEngine::DictionaryType)=0 |
virtual bool | removeDictionaryWord (const QString &word, MImEngine::DictionaryType)=0 |
virtual bool | disableDictionary (MImEngine::DictionaryType)=0 |
virtual bool | enableDictionary (MImEngine::DictionaryType)=0 |
virtual bool | removeDictionary (MImEngine::DictionaryType)=0 |
virtual void | appendString (const QString &s)=0 |
virtual void | appendCharacter (const QChar &c)=0 |
virtual void | tapKeyboard (const QPoint &position, bool shift, QChar symbol)=0 |
virtual void | reselectString (const QString &s)=0 |
virtual void | setContext (const QString &s, int cursor)=0 |
virtual void | disablePrediction ()=0 |
virtual void | enablePrediction ()=0 |
virtual bool | predictionEnabled ()=0 |
virtual void | disableCompletion ()=0 |
virtual void | enableCompletion ()=0 |
virtual bool | completionEnabled ()=0 |
virtual void | disableCorrection ()=0 |
virtual void | enableCorrection ()=0 |
virtual bool | correctionEnabled ()=0 |
virtual void | clearEngineBuffer ()=0 |
virtual void | saveAndClearEngineBuffer () |
virtual QStringList | candidates (unsigned int uStartIndex=0, unsigned int uNum=0)=0 |
virtual int | totalCandidates ()=0 |
virtual int | matchedLength ()=0 |
virtual QStringList | matchedSyllables ()=0 |
virtual int | suggestedCandidateIndex ()=0 |
virtual bool | setSuggestedCandidateIndex (int index) |
virtual void | setExactWordPositionInList (MImEngine::ExactInListType setting)=0 |
virtual MImEngine::DictionaryType | candidateSource (int index)=0 |
virtual QString | language ()=0 |
virtual bool | setLanguage (const QString &lang, MImEngine::LanguagePriority)=0 |
bool | setKeyboardLayout (const QString &) |
QString | keyboardLayout () |
virtual bool | setKeyboardLayoutKeys (const QList< MImEngine::KeyboardLayoutKey > &keys)=0 |
virtual QList < MImEngine::KeyboardLayoutKey > | keyboardLayoutKeys ()=0 |
virtual bool | exportAsNokiaDictionary (const QString &fileName)=0 |
virtual bool | importNokiaUserDictionary (const QString &fileName)=0 |
virtual QString | driver ()=0 |
virtual void | setMaximumErrors (int maxErrors)=0 |
virtual int | maximumErrors ()=0 |
virtual void | setMaximumCandidates (int maxCandidates)=0 |
virtual int | maximumCandidates ()=0 |
virtual bool | setScript (const QString &s)=0 |
virtual QString | script ()=0 |
virtual QString | transliterate (const QString &targetScript, unsigned int index)=0 |
virtual QString | error ()=0 |
virtual void | insertCharacters (const QString &text, int index=-1)=0 |
virtual void | removeCharacters (int count=1, int index=-1)=0 |
virtual void | commitWord (int index=-1, bool ignoreNewWord=true)=0 |
Abstract driver class for adding new error correction/prediction engines plugins.
Implementing a new engine driver means to subclass and implement the virtual methods.
MImEngineWordsInterface::MImEngineWordsInterface | ( | ) |
Constructor
MImEngineWordsInterface::~MImEngineWordsInterface | ( | ) | [virtual] |
Destructor
virtual bool MImEngineWordsInterface::addDictionaryWord | ( | const QString & | word, | |
MImEngine::DictionaryType | ||||
) | [pure virtual] |
Adds a new word to dictionary
word,reference | of const QString | |
MImEngine::DictionaryType | to which type of dictionary the word should be added |
Implemented in DummyDriver.
virtual void MImEngineWordsInterface::appendCharacter | ( | const QChar & | c | ) | [pure virtual] |
Appends one character to engine buffer
c,reference | of const QChar |
Implemented in DummyDriver.
virtual void MImEngineWordsInterface::appendString | ( | const QString & | s | ) | [pure virtual] |
Appends string to engine buffer
s,reference | of const QString |
Implemented in DummyDriver.
virtual QStringList MImEngineWordsInterface::candidates | ( | unsigned int | uStartIndex = 0 , |
|
unsigned int | uNum = 0 | |||
) | [pure virtual] |
Gets the candidates given by the engine.
Notes:
uStartIndex,the | start index of the whole candidate set. And the index starts from "0". | |
uNum,the | number of required candidates. If its value is "0", the default "Maximum" of candidates will be returned. |
Implemented in DummyDriver.
virtual MImEngine::DictionaryType MImEngineWordsInterface::candidateSource | ( | int | index | ) | [pure virtual] |
Returns the source dictionary where the candidate comes from.
index | indicates the index of candidate in the candidates() list. |
Implemented in DummyDriver.
virtual void MImEngineWordsInterface::clearEngineBuffer | ( | ) | [pure virtual] |
Clears engine input buffer. Note: clearEngineBuffer will not save the input word and its frequency.
Implemented in DummyDriver.
virtual void MImEngineWordsInterface::commitWord | ( | int | index = -1 , |
|
bool | ignoreNewWord = true | |||
) | [pure virtual] |
Notifies the engine that a word from the candidates list or from the engine buffer was commited. The engine bumps the commited word's frequency and adds it to the list of words where user can return later with reselectString(). A new word that is not in any dictionary is automatically first added to the personal dictionary. Setting parameter ignoreNewWord to true prevents new words from being processed and added to the personal dictionary.
index,the | commited word's index at the candidates list. Default value -1 commits the word in the engine buffer as it is. | |
ignoreNewWord,if | true a word that is not in any dictionary is ignored |
Implemented in DummyDriver.
virtual bool MImEngineWordsInterface::completionEnabled | ( | ) | [pure virtual] |
Gets the current status of word completion
Implemented in DummyDriver.
virtual bool MImEngineWordsInterface::correctionEnabled | ( | ) | [pure virtual] |
Gets the current status of auto correction Notes: For Chinese input methods, this feature may stand for "Fuzzy matching".
Implemented in DummyDriver.
virtual void MImEngineWordsInterface::disableCompletion | ( | ) | [pure virtual] |
Disables word completion feature
Implemented in DummyDriver.
virtual void MImEngineWordsInterface::disableCorrection | ( | ) | [pure virtual] |
Disables auto correction feature Notes: For Chinese input methods, this feature may stand for "Fuzzy matching".
Implemented in DummyDriver.
virtual bool MImEngineWordsInterface::disableDictionary | ( | MImEngine::DictionaryType | ) | [pure virtual] |
Disables dictionary
MImEngine::DictionaryType | dictionary type which shall be disabled |
Implemented in DummyDriver.
virtual void MImEngineWordsInterface::disablePrediction | ( | ) | [pure virtual] |
Disables word prediction feature
Implemented in DummyDriver.
virtual QString MImEngineWordsInterface::driver | ( | ) | [pure virtual] |
Gets name for current driver
N/A |
Implemented in DummyDriver.
virtual void MImEngineWordsInterface::enableCompletion | ( | ) | [pure virtual] |
Enables word completion feature.
Implemented in DummyDriver.
virtual void MImEngineWordsInterface::enableCorrection | ( | ) | [pure virtual] |
Enables auto correction feature Notes: For Chinese input methods, this feature may stand for "Fuzzy matching".
Implemented in DummyDriver.
virtual bool MImEngineWordsInterface::enableDictionary | ( | MImEngine::DictionaryType | ) | [pure virtual] |
Enables dictionary
MImEngine::DictionaryType | dictionary type which shall be enabled |
Implemented in DummyDriver.
virtual void MImEngineWordsInterface::enablePrediction | ( | ) | [pure virtual] |
virtual QString MImEngineWordsInterface::error | ( | ) | [pure virtual] |
virtual bool MImEngineWordsInterface::exportAsNokiaDictionary | ( | const QString & | fileName | ) | [pure virtual] |
virtual bool MImEngineWordsInterface::importNokiaUserDictionary | ( | const QString & | fileName | ) | [pure virtual] |
virtual bool MImEngineWordsInterface::init | ( | ) | [pure virtual] |
virtual void MImEngineWordsInterface::insertCharacters | ( | const QString & | text, | |
int | index = -1 | |||
) | [pure virtual] |
Inserts characters to the engine buffer.
text,the | inserted characters | |
index,the | position in the engine buffer where characters should be inserted. Default value -1 appends characters to end of the buffer. |
Implemented in DummyDriver.
QString MImEngineWordsInterface::keyboardLayout | ( | ) | [inline] |
DEPRECATED !!! Use keyboardLayoutKeys instead!
virtual QList<MImEngine::KeyboardLayoutKey> MImEngineWordsInterface::keyboardLayoutKeys | ( | ) | [pure virtual] |
Gets current keyboard layout keys
N/A |
Implemented in DummyDriver.
virtual QString MImEngineWordsInterface::language | ( | ) | [pure virtual] |
virtual int MImEngineWordsInterface::matchedLength | ( | ) | [pure virtual] |
Gets matched length of the chosen candidate for current input sequence.
Notes: According to the input character sequence, "candidates()" can return a list and the user can choose one candidate from it and notify the result to the engine by invoking "setSuggestedCandidateIndex()" or "setContext()" method. The chosen candidate might not match the whole input sequence and might match only part of the input sequence. So this method will tell the matched length of the chosen candidate for current input sequence.
Implemented in DummyDriver.
virtual QStringList MImEngineWordsInterface::matchedSyllables | ( | ) | [pure virtual] |
Gets recognized syllables from current input string. Notes: In some input methods, the input string can be divided into several syllables according to the most possible candidates. So in this case the input method engine shall list the recognized syllables in order to give the user some prompts.
Implemented in DummyDriver.
virtual int MImEngineWordsInterface::maximumCandidates | ( | ) | [pure virtual] |
Sets the maximum number for candidates, including prediction and error correction
N/A |
Implemented in DummyDriver.
virtual int MImEngineWordsInterface::maximumErrors | ( | ) | [pure virtual] |
Gets the maximum number of errors that could happen in a word.
N/A |
Implemented in DummyDriver.
virtual bool MImEngineWordsInterface::predictionEnabled | ( | ) | [pure virtual] |
Gets the current status of word prediction
N/A |
Implemented in DummyDriver.
virtual void MImEngineWordsInterface::removeCharacters | ( | int | count = 1 , |
|
int | index = -1 | |||
) | [pure virtual] |
Removes characters from the engine buffer. With default values for count and index the last character in the engine buffer will be removed.
count,the | number of characters to be removed | |
index,the | position in the engine buffer from where the removing should start. Default value -1 means that characters are removed from the end of the buffer. |
Implemented in DummyDriver.
virtual bool MImEngineWordsInterface::removeDictionary | ( | MImEngine::DictionaryType | ) | [pure virtual] |
Removes dictionary from disk
MImEngine::DictionaryType | dictionary type which shall be removed |
Implemented in DummyDriver.
virtual bool MImEngineWordsInterface::removeDictionaryWord | ( | const QString & | word, | |
MImEngine::DictionaryType | ||||
) | [pure virtual] |
Removes a word from dictionary
word,reference | of const QString | |
MImEngine::DictionaryType | from which type of dictionary the word should be removed |
Implemented in DummyDriver.
virtual void MImEngineWordsInterface::reselectString | ( | const QString & | s | ) | [pure virtual] |
Reselects a previously selected candidate word. This should be called when user highlights a previously selected word to recreate the candidate list with the original input sequence and key values. If the original data is not found then then the engine buffer is cleared and the reselected word appended to the buffer.
s,word | to reselect |
Implemented in DummyDriver.
virtual void MImEngineWordsInterface::saveAndClearEngineBuffer | ( | ) | [inline, virtual] |
DEPRECATED !!! Use commitWord() and addWordToDictionary() instead for commiting the engine state and adding words!
virtual QString MImEngineWordsInterface::script | ( | ) | [pure virtual] |
Gets four-letter script code of current input method engine.
Implemented in DummyDriver.
virtual void MImEngineWordsInterface::setContext | ( | const QString & | s, | |
int | cursor | |||
) | [pure virtual] |
Sets context information to the engine.
Context information is needed for better completion or for next word completion. The context information is usually a part of committed texts which should be passed to the engine before getting the completed/predicted word/character sequence from the engine.
s,the | text block used as context information. | |
cursor,the | cursor position in the text block. |
Implemented in DummyDriver.
virtual void MImEngineWordsInterface::setExactWordPositionInList | ( | MImEngine::ExactInListType | setting | ) | [pure virtual] |
Sets exact word position in candidate list. Call this to tell engine to position the exact word candidate in the list. The exact word can appear in first or last position of the candidate list and can also can be deleted from the candidate list.
setting,indicates | whether the exact word in the cadidate list. |
Implemented in DummyDriver.
bool MImEngineWordsInterface::setKeyboardLayout | ( | const QString & | ) | [inline] |
DEPRECATED !!! Use setKeyboardLayoutKeys instead!
virtual bool MImEngineWordsInterface::setKeyboardLayoutKeys | ( | const QList< MImEngine::KeyboardLayoutKey > & | keys | ) | [pure virtual] |
Loads new keyboard layout keys for the engine.
keys,list | of keys in the keyboard layout |
Implemented in DummyDriver.
virtual bool MImEngineWordsInterface::setLanguage | ( | const QString & | lang, | |
MImEngine::LanguagePriority | ||||
) | [pure virtual] |
Sets language with the indicated priority
lang,reference | of const QString. the language to be set | |
MImEngine::LanguagePriority. | the priority for the language |
Implemented in DummyDriver.
virtual void MImEngineWordsInterface::setMaximumCandidates | ( | int | maxCandidates | ) | [pure virtual] |
Sets the maximum number of candidates, including prediction and error correction The maximum number can not be bigger than 10.
int,the | maximum number to be set |
Implemented in DummyDriver.
virtual void MImEngineWordsInterface::setMaximumErrors | ( | int | maxErrors | ) | [pure virtual] |
Sets the maximum number of errors could happen in a word.
int,the | maximum number to be set |
Implemented in DummyDriver.
virtual bool MImEngineWordsInterface::setScript | ( | const QString & | s | ) | [pure virtual] |
Sets current input method engine's script by four-letter script code.
Notes: The ISO definition of four-letter script code is at "http://www.unicode.org/iso15924/iso15924-codes.html". The above definition should be followed here.
s,the | text string of four-letter script code. |
Implemented in DummyDriver.
virtual bool MImEngineWordsInterface::setSuggestedCandidateIndex | ( | int | index | ) | [inline, virtual] |
DEPRECATED !!! Use commitWord() instead!
virtual int MImEngineWordsInterface::suggestedCandidateIndex | ( | ) | [pure virtual] |
Returns the index in the candidate list suggested by the engine as the most appropriate candidate. Call this after calling candidates(). Useful when doing error correction.
Implemented in DummyDriver.
virtual void MImEngineWordsInterface::tapKeyboard | ( | const QPoint & | position, | |
bool | shift, | |||
QChar | symbol | |||
) | [pure virtual] |
Tap to keyboard
position,position | of the tap in the keyboard layout | |
shift,indicates | whether the shift is on or not | |
symbol,the | preferred symbol |
Implemented in DummyDriver.
virtual int MImEngineWordsInterface::totalCandidates | ( | ) | [pure virtual] |
Gets the number of all available candidates currently.
Implemented in DummyDriver.
virtual QString MImEngineWordsInterface::transliterate | ( | const QString & | targetScript, | |
unsigned int | index | |||
) | [pure virtual] |
Transliterates the candidate specified by the index into the target script's text. Notes:
targetScript,the | target ISO-15924 script code. | |
index,the | candidate's index obtained from "candidates()" function. |
Implemented in DummyDriver.
Copyright © 2010 Nokia Corporation | MeeGo Touch |