GNU Octave
3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
|
Parses the contents of a Keyboard Translator (.keytab) file and returns the entries found in it. More...
#include "KeyboardTranslator.h"
Classes | |
struct | Token |
Public Member Functions | |
KeyboardTranslatorReader (QIODevice *source) | |
Constructs a new reader which parses the given source . | |
QString | description () const |
Returns the description text. | |
bool | hasNextEntry () |
Returns true if there is another entry in the source stream. | |
KeyboardTranslator::Entry | nextEntry () |
Returns the next entry found in the source stream. | |
bool | parseError () |
Returns true if an error occurred whilst parsing the input or false if no error occurred. |
Static Public Member Functions | |
static KeyboardTranslator::Entry | createEntry (const QString &condition, const QString &result) |
Parses a condition and result string for a translator entry and produces a keyboard translator entry. |
Private Member Functions | |
bool | decodeSequence (const QString &, int &keyCode, Qt::KeyboardModifiers &modifiers, Qt::KeyboardModifiers &modifierMask, KeyboardTranslator::States &state, KeyboardTranslator::States &stateFlags) |
void | readNext () |
QList< Token > | tokenize (const QString &) |
Static Private Member Functions | |
static bool | parseAsCommand (const QString &text, KeyboardTranslator::Command &command) |
static bool | parseAsKeyCode (const QString &item, int &keyCode) |
static bool | parseAsModifier (const QString &item, Qt::KeyboardModifier &modifier) |
static bool | parseAsStateFlag (const QString &item, KeyboardTranslator::State &state) |
Private Attributes | |
QString | _description |
bool | _hasNext |
KeyboardTranslator::Entry | _nextEntry |
QIODevice * | _source |
Parses the contents of a Keyboard Translator (.keytab) file and returns the entries found in it.
Usage example:
Definition at line 421 of file KeyboardTranslator.h.
KeyboardTranslatorReader::KeyboardTranslatorReader | ( | QIODevice * | source | ) |
Constructs a new reader which parses the given source
.
Definition at line 228 of file KeyboardTranslator.cpp.
References _description, readNext(), KeyboardTranslatorReader::Token::TitleKeyword, and tokenize().
|
static |
Parses a condition and result string for a translator entry and produces a keyboard translator entry.
The condition and result strings are in the same format as in
Definition at line 459 of file KeyboardTranslator.cpp.
References hasNextEntry(), nextEntry(), and parseAsCommand().
|
private |
Definition at line 322 of file KeyboardTranslator.cpp.
References KeyboardTranslator::NoState, parseAsKeyCode(), parseAsModifier(), and parseAsStateFlag().
Referenced by readNext().
QString KeyboardTranslatorReader::description | ( | ) | const |
Returns the description text.
TODO: More documentation
Definition at line 451 of file KeyboardTranslator.cpp.
References _description.
Referenced by KeyboardTranslatorManager::loadTranslator().
bool KeyboardTranslatorReader::hasNextEntry | ( | ) |
Returns true if there is another entry in the source stream.
Definition at line 455 of file KeyboardTranslator.cpp.
References _hasNext.
Referenced by createEntry(), and KeyboardTranslatorManager::loadTranslator().
KeyboardTranslator::Entry KeyboardTranslatorReader::nextEntry | ( | ) |
Returns the next entry found in the source stream.
Definition at line 489 of file KeyboardTranslator.cpp.
References _hasNext, _nextEntry, and readNext().
Referenced by createEntry(), and KeyboardTranslatorManager::loadTranslator().
|
staticprivate |
Definition at line 302 of file KeyboardTranslator.cpp.
References KeyboardTranslator::EraseCommand, KeyboardTranslator::ScrollLineDownCommand, KeyboardTranslator::ScrollLineUpCommand, KeyboardTranslator::ScrollLockCommand, KeyboardTranslator::ScrollPageDownCommand, and KeyboardTranslator::ScrollPageUpCommand.
Referenced by createEntry(), and readNext().
Definition at line 428 of file KeyboardTranslator.cpp.
Referenced by decodeSequence().
|
staticprivate |
Definition at line 394 of file KeyboardTranslator.cpp.
Referenced by decodeSequence().
|
staticprivate |
Definition at line 411 of file KeyboardTranslator.cpp.
References KeyboardTranslator::AlternateScreenState, KeyboardTranslator::AnsiState, KeyboardTranslator::AnyModifierState, KeyboardTranslator::CursorKeysState, and KeyboardTranslator::NewLineState.
Referenced by decodeSequence().
bool KeyboardTranslatorReader::parseError | ( | ) |
Returns true if an error occurred whilst parsing the input or false if no error occurred.
Definition at line 500 of file KeyboardTranslator.cpp.
Referenced by KeyboardTranslatorManager::loadTranslator().
|
private |
Definition at line 245 of file KeyboardTranslator.cpp.
References _hasNext, _nextEntry, _source, KeyboardTranslatorReader::Token::Command, decodeSequence(), KeyboardTranslatorReader::Token::KeyKeyword, KeyboardTranslator::NoCommand, KeyboardTranslator::NoState, KeyboardTranslatorReader::Token::OutputText, parseAsCommand(), KeyboardTranslator::Entry::setCommand(), KeyboardTranslator::Entry::setKeyCode(), KeyboardTranslator::Entry::setModifierMask(), KeyboardTranslator::Entry::setModifiers(), KeyboardTranslator::Entry::setState(), KeyboardTranslator::Entry::setStateMask(), KeyboardTranslator::Entry::setText(), and tokenize().
Referenced by KeyboardTranslatorReader(), and nextEntry().
|
private |
Definition at line 504 of file KeyboardTranslator.cpp.
References KeyboardTranslatorReader::Token::Command, KeyboardTranslatorReader::Token::KeyKeyword, KeyboardTranslatorReader::Token::KeySequence, KeyboardTranslatorReader::Token::OutputText, KeyboardTranslatorReader::Token::TitleKeyword, and KeyboardTranslatorReader::Token::TitleText.
Referenced by KeyboardTranslatorReader(), and readNext().
|
private |
Definition at line 482 of file KeyboardTranslator.h.
Referenced by description(), and KeyboardTranslatorReader().
|
private |
Definition at line 484 of file KeyboardTranslator.h.
Referenced by hasNextEntry(), nextEntry(), and readNext().
|
private |
Definition at line 483 of file KeyboardTranslator.h.
Referenced by nextEntry(), and readNext().
|
private |
Definition at line 481 of file KeyboardTranslator.h.
Referenced by readNext().