Konsole::KeyboardTranslatorReader

Search for usage in LXR

Konsole::KeyboardTranslatorReader Class Reference

#include <KeyboardTranslator.h>

Public Member Functions

 KeyboardTranslatorReader (QIODevice *source)
 
QString description () const
 
bool hasNextEntry () const
 
KeyboardTranslator::Entry nextEntry ()
 
bool parseError ()
 

Static Public Member Functions

static KeyboardTranslator::Entry createEntry (const QString &condition, const QString &result)
 

Detailed Description

Parses the contents of a Keyboard Translator (.keytab) file and returns the entries found in it.

Usage example:

QFile source( "/path/to/keytab" );
source.open( QIODevice::ReadOnly );
KeyboardTranslator* translator = new KeyboardTranslator( "name-of-translator" );
KeyboardTranslatorReader reader(source);
while ( reader.hasNextEntry() )
translator->addEntry(reader.nextEntry());
source.close();
if ( !reader.parseError() )
{
// parsing succeeded, do something with the translator
}
else
{
// parsing failed
}
Parses the contents of a Keyboard Translator (.keytab) file and returns the entries found in it.
A convertor which maps between key sequences pressed by the user and the character strings which shou...
void addEntry(const Entry &entry)
Adds an entry to this keyboard translator's table.

Definition at line 346 of file KeyboardTranslator.h.

Constructor & Destructor Documentation

◆ KeyboardTranslatorReader()

KeyboardTranslatorReader::KeyboardTranslatorReader ( QIODevice * source)

Constructs a new reader which parses the given source.

Definition at line 238 of file KeyboardTranslator.cpp.

Member Function Documentation

◆ createEntry()

KeyboardTranslator::Entry KeyboardTranslatorReader::createEntry ( const QString & condition,
const QString & result )
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 458 of file KeyboardTranslator.cpp.

◆ description()

QString KeyboardTranslatorReader::description ( ) const

Returns the description text.

TODO: More documentation

Definition at line 450 of file KeyboardTranslator.cpp.

◆ hasNextEntry()

bool KeyboardTranslatorReader::hasNextEntry ( ) const

Returns true if there is another entry in the source stream.

Definition at line 454 of file KeyboardTranslator.cpp.

◆ nextEntry()

KeyboardTranslator::Entry KeyboardTranslatorReader::nextEntry ( )

Returns the next entry found in the source stream.

Definition at line 485 of file KeyboardTranslator.cpp.

◆ parseError()

bool KeyboardTranslatorReader::parseError ( )

Returns true if an error occurred whilst parsing the input or false if no error occurred.

Definition at line 492 of file KeyboardTranslator.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:10:32 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.