GNU Octave
3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
|
Manages the keyboard translations available for use by terminal sessions, see KeyboardTranslator. More...
#include "KeyboardTranslator.h"
Public Member Functions | |
KeyboardTranslatorManager () | |
Constructs a new KeyboardTranslatorManager and loads the list of available keyboard translations. | |
~KeyboardTranslatorManager () | |
void | addTranslator (KeyboardTranslator *translator) |
Adds a new translator. | |
QList< QString > | allTranslators () |
Returns a list of the names of available keyboard translators. | |
const KeyboardTranslator * | defaultTranslator () |
Returns the default translator for Konsole. | |
bool | deleteTranslator (const QString &name) |
Deletes a translator. | |
const KeyboardTranslator * | findTranslator (const QString &name) |
Returns the keyboard translator with the given name or 0 if no translator with that name exists. |
Static Public Member Functions | |
static KeyboardTranslatorManager * | instance () |
Returns the global KeyboardTranslatorManager instance. |
Private Member Functions | |
QString | findTranslatorPath (const QString &name) |
void | findTranslators () |
KeyboardTranslator * | loadTranslator (const QString &name) |
KeyboardTranslator * | loadTranslator (QIODevice *device, const QString &name) |
bool | saveTranslator (const KeyboardTranslator *translator) |
Private Attributes | |
bool | _haveLoadedAll |
QHash< QString, KeyboardTranslator * > | _translators |
Static Private Attributes | |
static const char * | defaultTranslatorText = "/home/carandraug/builds/octave-3.8.0/libgui/qterminal/libqterminal/unix/KeyboardTranslator.cpp" 2 |
Manages the keyboard translations available for use by terminal sessions, see KeyboardTranslator.
Definition at line 515 of file KeyboardTranslator.h.
KeyboardTranslatorManager::KeyboardTranslatorManager | ( | ) |
Constructs a new KeyboardTranslatorManager and loads the list of available keyboard translations.
The keyboard translations themselves are not loaded until they are first requested via a call to findTranslator()
Definition at line 43 of file KeyboardTranslator.cpp.
KeyboardTranslatorManager::~KeyboardTranslatorManager | ( | ) |
Definition at line 47 of file KeyboardTranslator.cpp.
References _translators.
void KeyboardTranslatorManager::addTranslator | ( | KeyboardTranslator * | translator | ) |
Adds a new translator.
If a translator with the same name already exists, it will be replaced by the new translator.
TODO: More documentation.
Definition at line 859 of file KeyboardTranslator.cpp.
References _translators, KeyboardTranslator::name(), and saveTranslator().
QList< QString > KeyboardTranslatorManager::allTranslators | ( | ) |
Returns a list of the names of available keyboard translators.
The first time this is called, a search for available translators is started.
Definition at line 558 of file KeyboardTranslator.cpp.
References _haveLoadedAll, _translators, and findTranslators().
const KeyboardTranslator * KeyboardTranslatorManager::defaultTranslator | ( | ) |
Returns the default translator for Konsole.
Definition at line 147 of file KeyboardTranslator.cpp.
References defaultTranslatorText, and loadTranslator().
Referenced by findTranslator().
bool KeyboardTranslatorManager::deleteTranslator | ( | const QString & | name | ) |
Deletes a translator.
Returns true on successful deletion or false otherwise.
TODO: More documentation
Definition at line 867 of file KeyboardTranslator.cpp.
References _translators, and findTranslatorPath().
const KeyboardTranslator * KeyboardTranslatorManager::findTranslator | ( | const QString & | name | ) |
Returns the keyboard translator with the given name or 0 if no translator with that name exists.
The first time that a translator with a particular name is requested, the on-disk .keyboard file is loaded and parsed.
Definition at line 82 of file KeyboardTranslator.cpp.
References _translators, defaultTranslator(), findTranslators(), and loadTranslator().
Referenced by Emulation::setKeyBindings().
|
private |
Definition at line 51 of file KeyboardTranslator.cpp.
Referenced by deleteTranslator(), and loadTranslator().
|
private |
Definition at line 55 of file KeyboardTranslator.cpp.
References _haveLoadedAll, and _translators.
Referenced by allTranslators(), and findTranslator().
|
static |
Returns the global KeyboardTranslatorManager instance.
Definition at line 885 of file KeyboardTranslator.cpp.
Referenced by Emulation::setKeyBindings().
|
private |
Definition at line 135 of file KeyboardTranslator.cpp.
References findTranslatorPath().
Referenced by defaultTranslator(), and findTranslator().
|
private |
Definition at line 158 of file KeyboardTranslator.cpp.
References KeyboardTranslator::addEntry(), KeyboardTranslatorReader::description(), KeyboardTranslatorReader::hasNextEntry(), KeyboardTranslatorReader::nextEntry(), KeyboardTranslatorReader::parseError(), and KeyboardTranslator::setDescription().
|
private |
Definition at line 104 of file KeyboardTranslator.cpp.
References KeyboardTranslator::description(), KeyboardTranslator::entries(), KeyboardTranslatorWriter::writeEntry(), and KeyboardTranslatorWriter::writeHeader().
Referenced by addTranslator().
|
private |
Definition at line 578 of file KeyboardTranslator.h.
Referenced by allTranslators(), and findTranslators().
|
private |
Definition at line 576 of file KeyboardTranslator.h.
Referenced by addTranslator(), allTranslators(), deleteTranslator(), findTranslator(), findTranslators(), and ~KeyboardTranslatorManager().
|
staticprivate |
Definition at line 566 of file KeyboardTranslator.h.
Referenced by defaultTranslator().