Home ยท API Reference |
DummyDriver inherits from MImEngineWordsInterface(Abstract driver class) and QObject, it implements a dummy input method engine. More...
#include <dummydriver.h>
Public Member Functions | |
DummyDriver () | |
~DummyDriver () | |
virtual bool | init () |
virtual bool | addDictionaryWord (const QString &word, MImEngine::DictionaryType) |
virtual bool | removeDictionaryWord (const QString &word, MImEngine::DictionaryType) |
virtual bool | disableDictionary (MImEngine::DictionaryType) |
virtual bool | enableDictionary (MImEngine::DictionaryType) |
virtual bool | removeDictionary (MImEngine::DictionaryType) |
virtual void | appendString (const QString &s) |
virtual void | appendCharacter (const QChar &c) |
virtual void | tapKeyboard (const QPoint &position, bool shift, QChar symbol) |
virtual void | reselectString (const QString &s) |
virtual void | setContext (const QString &s, int cursor) |
virtual void | disablePrediction () |
virtual void | enablePrediction () |
virtual bool | predictionEnabled () |
virtual void | disableCorrection () |
virtual void | enableCorrection () |
virtual bool | correctionEnabled () |
virtual void | disableCompletion () |
virtual void | enableCompletion () |
virtual bool | completionEnabled () |
virtual QStringList | candidates (unsigned int uStartIndex=0, unsigned int uNum=0) |
virtual int | totalCandidates () |
virtual int | matchedLength () |
virtual QStringList | matchedSyllables () |
virtual int | suggestedCandidateIndex () |
virtual void | setExactWordPositionInList (MImEngine::ExactInListType) |
virtual MImEngine::DictionaryType | candidateSource (int) |
virtual void | clearEngineBuffer () |
virtual QString | language () |
virtual bool | setLanguage (const QString &language, MImEngine::LanguagePriority) |
virtual bool | setKeyboardLayoutKeys (const QList< MImEngine::KeyboardLayoutKey > &keys) |
virtual QList < MImEngine::KeyboardLayoutKey > | keyboardLayoutKeys () |
virtual bool | exportAsNokiaDictionary (const QString &) |
virtual bool | importNokiaUserDictionary (const QString &) |
virtual void | setMaximumErrors (int) |
virtual int | maximumErrors () |
virtual void | setMaximumCandidates (int maxCandidates) |
virtual int | maximumCandidates () |
virtual QString | driver () |
virtual QString | error () |
virtual bool | setScript (const QString &s) |
virtual QString | script () |
virtual QString | transliterate (const QString &targetScript, unsigned int index) |
virtual void | insertCharacters (const QString &text, int index=-1) |
virtual void | removeCharacters (int count=1, int index=-1) |
virtual void | commitWord (int index=-1, bool ignoreNewWord=true) |
DummyDriver inherits from MImEngineWordsInterface(Abstract driver class) and QObject, it implements a dummy input method engine.
DummyDriver::DummyDriver | ( | ) |
DummyDriver construtor
DummyDriver::~DummyDriver | ( | ) |
DummyDriver destructor
bool DummyDriver::addDictionaryWord | ( | const QString & | word, | |
MImEngine::DictionaryType | ||||
) | [virtual] |
Adds a new word to dictionary
word,reference | of const QString | |
MImEngine::DictionaryType | to which type of dictionary the word should be added |
Implements MImEngineWordsInterface.
void DummyDriver::appendCharacter | ( | const QChar & | c | ) | [virtual] |
Appends one character to engine buffer
c,reference | of const QChar |
Implements MImEngineWordsInterface.
void DummyDriver::appendString | ( | const QString & | s | ) | [virtual] |
Appends string to engine buffer
s,reference | of const QString |
Implements MImEngineWordsInterface.
QStringList DummyDriver::candidates | ( | unsigned int | uStartIndex = 0 , |
|
unsigned int | uNum = 0 | |||
) | [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. |
Implements MImEngineWordsInterface.
MImEngine::DictionaryType DummyDriver::candidateSource | ( | int | index | ) | [virtual] |
Returns the source dictionary where the candidate comes from.
index | indicates the index of candidate in the candidates() list. |
Implements MImEngineWordsInterface.
void DummyDriver::clearEngineBuffer | ( | ) | [virtual] |
Clears engine input buffer. Note: clearEngineBuffer will not save the input word and its frequency.
Implements MImEngineWordsInterface.
void DummyDriver::commitWord | ( | int | index = -1 , |
|
bool | ignoreNewWord = true | |||
) | [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 |
Implements MImEngineWordsInterface.
bool DummyDriver::completionEnabled | ( | ) | [virtual] |
Gets the current status of word completion
Implements MImEngineWordsInterface.
bool DummyDriver::correctionEnabled | ( | ) | [virtual] |
Gets the current status of auto correction Notes: For Chinese input methods, this feature may stand for "Fuzzy matching".
Implements MImEngineWordsInterface.
void DummyDriver::disableCompletion | ( | ) | [virtual] |
Disables word completion feature
Implements MImEngineWordsInterface.
void DummyDriver::disableCorrection | ( | ) | [virtual] |
Disables auto correction feature Notes: For Chinese input methods, this feature may stand for "Fuzzy matching".
Implements MImEngineWordsInterface.
bool DummyDriver::disableDictionary | ( | MImEngine::DictionaryType | ) | [virtual] |
Disables dictionary
MImEngine::DictionaryType | dictionary type which shall be disabled |
Implements MImEngineWordsInterface.
void DummyDriver::disablePrediction | ( | ) | [virtual] |
Disables word prediction feature
Implements MImEngineWordsInterface.
QString DummyDriver::driver | ( | ) | [virtual] |
Gets name for current driver
N/A |
Implements MImEngineWordsInterface.
void DummyDriver::enableCompletion | ( | ) | [virtual] |
Enables word completion feature.
Implements MImEngineWordsInterface.
void DummyDriver::enableCorrection | ( | ) | [virtual] |
Enables auto correction feature Notes: For Chinese input methods, this feature may stand for "Fuzzy matching".
Implements MImEngineWordsInterface.
bool DummyDriver::enableDictionary | ( | MImEngine::DictionaryType | ) | [virtual] |
Enables dictionary
MImEngine::DictionaryType | dictionary type which shall be enabled |
Implements MImEngineWordsInterface.
void DummyDriver::enablePrediction | ( | ) | [virtual] |
QString DummyDriver::error | ( | ) | [virtual] |
bool DummyDriver::exportAsNokiaDictionary | ( | const QString & | fileName | ) | [virtual] |
Exports the user dictionary into an xml file
Implements MImEngineWordsInterface.
bool DummyDriver::importNokiaUserDictionary | ( | const QString & | fileName | ) | [virtual] |
bool DummyDriver::init | ( | void | ) | [virtual] |
REIMPLEMENTATION
Implements MImEngineWordsInterface.
void DummyDriver::insertCharacters | ( | const QString & | text, | |
int | index = -1 | |||
) | [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. |
Implements MImEngineWordsInterface.
QList< MImEngine::KeyboardLayoutKey > DummyDriver::keyboardLayoutKeys | ( | ) | [virtual] |
Gets current keyboard layout keys
N/A |
Implements MImEngineWordsInterface.
QString DummyDriver::language | ( | ) | [virtual] |
Gets current language
N/A |
Implements MImEngineWordsInterface.
int DummyDriver::matchedLength | ( | ) | [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.
Implements MImEngineWordsInterface.
QStringList DummyDriver::matchedSyllables | ( | ) | [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.
Implements MImEngineWordsInterface.
int DummyDriver::maximumCandidates | ( | ) | [virtual] |
Sets the maximum number for candidates, including prediction and error correction
N/A |
Implements MImEngineWordsInterface.
int DummyDriver::maximumErrors | ( | ) | [virtual] |
Gets the maximum number of errors that could happen in a word.
N/A |
Implements MImEngineWordsInterface.
bool DummyDriver::predictionEnabled | ( | ) | [virtual] |
Gets the current status of word prediction
N/A |
Implements MImEngineWordsInterface.
void DummyDriver::removeCharacters | ( | int | count = 1 , |
|
int | index = -1 | |||
) | [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. |
Implements MImEngineWordsInterface.
bool DummyDriver::removeDictionary | ( | MImEngine::DictionaryType | ) | [virtual] |
Removes dictionary from disk
MImEngine::DictionaryType | dictionary type which shall be removed |
Implements MImEngineWordsInterface.
bool DummyDriver::removeDictionaryWord | ( | const QString & | word, | |
MImEngine::DictionaryType | ||||
) | [virtual] |
Removes a word from dictionary
word,reference | of const QString | |
MImEngine::DictionaryType | from which type of dictionary the word should be removed |
Implements MImEngineWordsInterface.
void DummyDriver::reselectString | ( | const QString & | s | ) | [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 |
Implements MImEngineWordsInterface.
QString DummyDriver::script | ( | ) | [virtual] |
Gets four-letter script code of current input method engine.
Implements MImEngineWordsInterface.
void DummyDriver::setContext | ( | const QString & | s, | |
int | cursor | |||
) | [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. |
Implements MImEngineWordsInterface.
void DummyDriver::setExactWordPositionInList | ( | MImEngine::ExactInListType | setting | ) | [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. |
Implements MImEngineWordsInterface.
bool DummyDriver::setKeyboardLayoutKeys | ( | const QList< MImEngine::KeyboardLayoutKey > & | keys | ) | [virtual] |
Loads new keyboard layout keys for the engine.
keys,list | of keys in the keyboard layout |
Implements MImEngineWordsInterface.
bool DummyDriver::setLanguage | ( | const QString & | lang, | |
MImEngine::LanguagePriority | ||||
) | [virtual] |
Sets language with the indicated priority
lang,reference | of const QString. the language to be set | |
MImEngine::LanguagePriority. | the priority for the language |
Implements MImEngineWordsInterface.
void DummyDriver::setMaximumCandidates | ( | int | maxCandidates | ) | [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 |
Implements MImEngineWordsInterface.
void DummyDriver::setMaximumErrors | ( | int | maxErrors | ) | [virtual] |
Sets the maximum number of errors could happen in a word.
int,the | maximum number to be set |
Implements MImEngineWordsInterface.
bool DummyDriver::setScript | ( | const QString & | s | ) | [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. |
Implements MImEngineWordsInterface.
int DummyDriver::suggestedCandidateIndex | ( | ) | [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.
Implements MImEngineWordsInterface.
void DummyDriver::tapKeyboard | ( | const QPoint & | position, | |
bool | shift, | |||
QChar | symbol | |||
) | [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 |
Implements MImEngineWordsInterface.
int DummyDriver::totalCandidates | ( | ) | [virtual] |
Gets the number of all available candidates currently.
Implements MImEngineWordsInterface.
QString DummyDriver::transliterate | ( | const QString & | targetScript, | |
unsigned int | index | |||
) | [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. |
Implements MImEngineWordsInterface.
Copyright © 2010 Nokia Corporation | MeeGo Touch |