• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

Konsole

Konsole::KeyboardTranslator::Entry

Konsole::KeyboardTranslator::Entry Class Reference

#include <KeyboardTranslator.h>

List of all members.


Detailed Description

Represents an association between a key sequence pressed by the user and the character sequence and commands associated with it for a particular KeyboardTranslator.

Definition at line 118 of file KeyboardTranslator.h.


Public Member Functions

 Entry ()
bool isNull () const
Command command () const
void setCommand (Command command)
QByteArray text (bool expandWildCards=false, Qt::KeyboardModifiers modifiers=Qt::NoModifier) const
void setText (const QByteArray &text)
QByteArray escapedText (bool expandWildCards=false, Qt::KeyboardModifiers modifiers=Qt::NoModifier) const
int keyCode () const
void setKeyCode (int keyCode)
Qt::KeyboardModifiers modifiers () const
Qt::KeyboardModifiers modifierMask () const
void setModifiers (Qt::KeyboardModifiers modifiers)
void setModifierMask (Qt::KeyboardModifiers modifiers)
States state () const
States stateMask () const
void setState (States state)
void setStateMask (States mask)
QString conditionToString () const
QString resultToString (bool expandWildCards=false, Qt::KeyboardModifiers modifiers=Qt::NoModifier) const
bool matches (int keyCode, Qt::KeyboardModifiers modifiers, States flags) const
bool operator== (const Entry &rhs) const

Constructor & Destructor Documentation

KeyboardTranslator::Entry::Entry (  ) 

Constructs a new entry for a keyboard translator.

Definition at line 560 of file KeyboardTranslator.cpp.


Member Function Documentation

bool Konsole::KeyboardTranslator::Entry::isNull (  )  const [inline]

Returns true if this entry is null.

This is true for newly constructed entries which have no properties set.

Definition at line 521 of file KeyboardTranslator.h.

KeyboardTranslator::Command Konsole::KeyboardTranslator::Entry::command (  )  const [inline]

Returns the commands associated with this entry.

Definition at line 530 of file KeyboardTranslator.h.

void Konsole::KeyboardTranslator::Entry::setCommand ( Command  command  )  [inline]

Sets the command associated with this entry.

Definition at line 526 of file KeyboardTranslator.h.

QByteArray Konsole::KeyboardTranslator::Entry::text ( bool  expandWildCards = false,
Qt::KeyboardModifiers  modifiers = Qt::NoModifier 
) const [inline]

Returns the character sequence associated with this entry, optionally replacing wildcard '*' characters with numbers to indicate the keyboard modifiers being pressed.

TODO: The numbers used to replace '*' characters are taken from the Konsole/KDE 3 code. Document them.

Parameters:
expandWildCards Specifies whether wild cards (occurrences of the '*' character) in the entry should be replaced with a number to indicate the modifier keys being pressed.
modifiers The keyboard modifiers being pressed.

Definition at line 540 of file KeyboardTranslator.h.

void Konsole::KeyboardTranslator::Entry::setText ( const QByteArray &  text  )  [inline]

Sets the character sequence associated with this entry.

Definition at line 532 of file KeyboardTranslator.h.

QByteArray KeyboardTranslator::Entry::escapedText ( bool  expandWildCards = false,
Qt::KeyboardModifiers  modifiers = Qt::NoModifier 
) const

Returns the character sequence associated with this entry, with any non-printable characters replaced with escape sequences.

eg. \E for Escape, \t for tab, \n for new line.

Parameters:
expandWildCards See text()
modifiers See text()

Definition at line 614 of file KeyboardTranslator.cpp.

int Konsole::KeyboardTranslator::Entry::keyCode (  )  const [inline]

Returns the character code ( from the Qt::Key enum ) associated with this entry.

Definition at line 506 of file KeyboardTranslator.h.

void Konsole::KeyboardTranslator::Entry::setKeyCode ( int  keyCode  )  [inline]

Sets the character code associated with this entry.

Definition at line 507 of file KeyboardTranslator.h.

Qt::KeyboardModifiers Konsole::KeyboardTranslator::Entry::modifiers (  )  const [inline]

Returns a bitwise-OR of the enabled keyboard modifiers associated with this entry.

If a modifier is set in modifierMask() but not in modifiers(), this means that the entry only matches when that modifier is NOT pressed.

If a modifier is not set in modifierMask() then the entry matches whether the modifier is pressed or not.

Definition at line 513 of file KeyboardTranslator.h.

Qt::KeyboardModifiers Konsole::KeyboardTranslator::Entry::modifierMask (  )  const [inline]

Returns the keyboard modifiers which are valid in this entry.

See modifiers()

Definition at line 519 of file KeyboardTranslator.h.

void Konsole::KeyboardTranslator::Entry::setModifiers ( Qt::KeyboardModifiers  modifiers  )  [inline]

See modifiers().

Definition at line 509 of file KeyboardTranslator.h.

void Konsole::KeyboardTranslator::Entry::setModifierMask ( Qt::KeyboardModifiers  modifiers  )  [inline]

See modifierMask() and modifiers().

Definition at line 515 of file KeyboardTranslator.h.

KeyboardTranslator::States Konsole::KeyboardTranslator::Entry::state (  )  const [inline]

Returns a bitwise-OR of the enabled state flags associated with this entry.

If flag is set in stateMask() but not in state(), this means that the entry only matches when the terminal is NOT in that state.

If a state is not set in stateMask() then the entry matches whether the terminal is in that state or not.

Definition at line 565 of file KeyboardTranslator.h.

KeyboardTranslator::States Konsole::KeyboardTranslator::Entry::stateMask (  )  const [inline]

Returns the state flags which are valid in this entry.

See state()

Definition at line 571 of file KeyboardTranslator.h.

void Konsole::KeyboardTranslator::Entry::setState ( States  state  )  [inline]

See state().

Definition at line 561 of file KeyboardTranslator.h.

void Konsole::KeyboardTranslator::Entry::setStateMask ( States  mask  )  [inline]

See stateMask().

Definition at line 567 of file KeyboardTranslator.h.

QString KeyboardTranslator::Entry::conditionToString (  )  const

Returns the key code and modifiers associated with this entry as a QKeySequence.

Returns this entry's conditions ( ie. its key code, modifier and state criteria ) as a string.

Definition at line 766 of file KeyboardTranslator.cpp.

QString KeyboardTranslator::Entry::resultToString ( bool  expandWildCards = false,
Qt::KeyboardModifiers  modifiers = Qt::NoModifier 
) const

Returns this entry's result ( ie.

its command or character sequence ) as a string.

Parameters:
expandWildCards See text()
modifiers See text()

Definition at line 747 of file KeyboardTranslator.cpp.

bool KeyboardTranslator::Entry::matches ( int  keyCode,
Qt::KeyboardModifiers  modifiers,
States  flags 
) const

Returns true if this entry matches the given key sequence, specified as a combination of keyCode , modifiers and state.

Definition at line 581 of file KeyboardTranslator.cpp.

bool KeyboardTranslator::Entry::operator== ( const Entry &  rhs  )  const

Definition at line 570 of file KeyboardTranslator.cpp.


The documentation for this class was generated from the following files:
  • KeyboardTranslator.h
  • KeyboardTranslator.cpp

Konsole

Skip menu "Konsole"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • Konsole
  • Libraries
  •   libkonq
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal