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 bool | setSuggestedCandidateIndex (int index) |
virtual void | setExactWordPositionInList (MImEngine::ExactInListType) |
virtual MImEngine::DictionaryType | candidateSource (int) |
virtual void | clearEngineBuffer () |
virtual void | saveAndClearEngineBuffer () |
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) |
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 string to engine buffer
c,reference | of const QChar |
Implements MImEngineWordsInterface.
void DummyDriver::appendString | ( | const QString & | s | ) | [virtual] |
Appends one character 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.
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.
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.
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 accepted word. Called when user highlights a previously accepted word to recreate the candidate list with the original input sequence and key values.
s,word | to reselect |
Implements MImEngineWordsInterface.
void DummyDriver::saveAndClearEngineBuffer | ( | ) | [virtual] |
Saves the input word in engine buffer, and then clears the engine input buffer. Engine will store the input word to user dictionary (if new word), and store its used frequency.
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.
bool DummyDriver::setSuggestedCandidateIndex | ( | int | index | ) | [virtual] |
Sets the index of the suggested candidate in the candidates' list, when user select one word from the candidates' list, this API should be called, to info engine which one is the user preferred, then the engine can store the relative information( new word, used frequency, etc.).
index,the | index which is use selected |
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.