GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
KeyboardTranslatorManager Class Reference

Manages the keyboard translations available for use by terminal sessions, see KeyboardTranslator. More...

#include "KeyboardTranslator.h"

Collaboration diagram for KeyboardTranslatorManager:
Collaboration graph
[legend]

Public Member Functions

 KeyboardTranslatorManager ()
 Constructs a new KeyboardTranslatorManager and loads the list of available keyboard translations. More...
 
 ~KeyboardTranslatorManager ()
 
void addTranslator (KeyboardTranslator *translator)
 Adds a new translator. More...
 
QList< QString > allTranslators ()
 Returns a list of the names of available keyboard translators. More...
 
const KeyboardTranslatordefaultTranslator ()
 Returns the default translator for Konsole. More...
 
bool deleteTranslator (const QString &name)
 Deletes a translator. More...
 
const KeyboardTranslatorfindTranslator (const QString &name)
 Returns the keyboard translator with the given name or 0 if no translator with that name exists. More...
 

Static Public Member Functions

static KeyboardTranslatorManagerinstance ()
 Returns the global KeyboardTranslatorManager instance. More...
 

Private Member Functions

QString findTranslatorPath (const QString &name)
 
void findTranslators ()
 
KeyboardTranslatorloadTranslator (const QString &name)
 
KeyboardTranslatorloadTranslator (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
 

Detailed Description

Manages the keyboard translations available for use by terminal sessions, see KeyboardTranslator.

Definition at line 517 of file KeyboardTranslator.h.

Constructor & Destructor Documentation

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 51 of file KeyboardTranslator.cpp.

KeyboardTranslatorManager::~KeyboardTranslatorManager ( )

Definition at line 55 of file KeyboardTranslator.cpp.

References _translators.

Member Function Documentation

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 867 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 566 of file KeyboardTranslator.cpp.

References _haveLoadedAll, _translators, and findTranslators().

const KeyboardTranslator * KeyboardTranslatorManager::defaultTranslator ( )

Returns the default translator for Konsole.

Definition at line 155 of file KeyboardTranslator.cpp.

References defaultTranslatorText, loadTranslator(), and strlen().

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 875 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 90 of file KeyboardTranslator.cpp.

References _translators, defaultTranslator(), findTranslators(), loadTranslator(), and name.

Referenced by Emulation::setKeyBindings().

QString KeyboardTranslatorManager::findTranslatorPath ( const QString &  name)
private

Definition at line 59 of file KeyboardTranslator.cpp.

Referenced by deleteTranslator(), and loadTranslator().

void KeyboardTranslatorManager::findTranslators ( )
private

Definition at line 63 of file KeyboardTranslator.cpp.

References _haveLoadedAll, _translators, list, and name.

Referenced by allTranslators(), and findTranslator().

KeyboardTranslatorManager * KeyboardTranslatorManager::instance ( void  )
static

Returns the global KeyboardTranslatorManager instance.

Definition at line 893 of file KeyboardTranslator.cpp.

Referenced by Emulation::setKeyBindings().

KeyboardTranslator * KeyboardTranslatorManager::loadTranslator ( const QString &  name)
private

Definition at line 143 of file KeyboardTranslator.cpp.

References findTranslatorPath().

Referenced by defaultTranslator(), and findTranslator().

KeyboardTranslator * KeyboardTranslatorManager::loadTranslator ( QIODevice *  device,
const QString &  name 
)
private
bool KeyboardTranslatorManager::saveTranslator ( const KeyboardTranslator translator)
private

Member Data Documentation

bool KeyboardTranslatorManager::_haveLoadedAll
private

Definition at line 580 of file KeyboardTranslator.h.

Referenced by allTranslators(), and findTranslators().

QHash<QString,KeyboardTranslator*> KeyboardTranslatorManager::_translators
private
const char * KeyboardTranslatorManager::defaultTranslatorText
staticprivate
Initial value:
=
# 47 "/home/carandraug/builds/octave-4.2.1/libgui/qterminal/libqterminal/unix/KeyboardTranslator.cpp" 2

Definition at line 568 of file KeyboardTranslator.h.

Referenced by defaultTranslator().


The documentation for this class was generated from the following files: