Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

KKeySequence Class Reference

#include <kshortcut.h>

List of all members.

Public Types

enum  
 Defines the maximum length of the key sequence.


Public Methods

 KKeySequence ()
 KKeySequence (const QKeySequence &keySeq)
 KKeySequence (const KKey &key)
 KKeySequence (const KKeyNative &key)
 KKeySequence (const KKeySequence &keySeq)
 KKeySequence (const QString &keySeq)
void clear ()
bool init (const QKeySequence &keySeq)
bool init (const KKey &key)
bool init (const KKeyNative &key)
bool init (const KKeySequence &keySeq)
bool init (const QString &key)
KKeySequence & operator= (const KKeySequence &seq)
uint count () const
const KKey & key (uint i) const
bool setKey (uint i, const KKey &key)
bool isNull () const
bool startsWith (const KKeySequence &keySeq) const
int compare (const KKeySequence &keySeq) const
bool operator== (const KKeySequence &seq) const
bool operator!= (const KKeySequence &seq) const
bool operator< (const KKeySequence &seq) const
QKeySequence qt () const
int keyCodeQt () const
QString toString () const

Static Public Methods

KKeySequence & null ()


Detailed Description

A KKeySequence object holds a sequence of up to 4 keys. Ex: Ctrl+X,I
See also:
KKey , KShortcut

Definition at line 294 of file kshortcut.h.


Constructor & Destructor Documentation

KKeySequence::KKeySequence  
 

Create a new null key sequence.

See also:
isNull() , null() , clear()

KKeySequence::KKeySequence const QKeySequence &    keySeq
 

Copies the given qt key sequence.

Parameters:
keySeq  the qt key sequence to copy

KKeySequence::KKeySequence const KKey &    key
 

Create a new key sequence that only contains the given key.

Parameters:
key  the key to add

KKeySequence::KKeySequence const KKeyNative   key
 

Create a new key sequence that only contains the given key.

Parameters:
key  the key to add

KKeySequence::KKeySequence const KKeySequence &    keySeq
 

Copies the given key sequence.

Parameters:
keySeq  the key sequence to copy

KKeySequence::KKeySequence const QString &    keySeq
 

Creates a new key sequence that contains the given key sequence. The description consists of comma-separated keys as required by KKey::KKey(const QString&).

Parameters:
keySeq  the description of the key
See also:
KKeyServer::Sym::init() , KKey::KKey(const QString&)


Member Function Documentation

void KKeySequence::clear  
 

Clears the key sequence. The key sequence is null after calling this function.

See also:
isNull()

int KKeySequence::compare const KKeySequence &    keySeq const
 

Compares this object with the given key sequence. Returns a negative number if the given KKeySequence is larger, 0 if they are equal and a positive number this KKeySequence is larger. Key sequences are compared by comparing the individual keys, starting from the beginning until an unequal key has been found. If a sequence contains more keys, it is considered larger.

Parameters:
keySeq  the key sequence to compare to
Returns:
a negative number if the given KKeySequence is larger, 0 if they are equal and a positive number this KKeySequence is larger
See also:
KKey::sequence

Referenced by operator!=(), operator<(), and operator==().

uint KKeySequence::count  
 

Returns the number of key strokes of this sequence.

Returns:
the number of key strokes
See also:
MAX_KEYS

bool KKeySequence::init const QString &    key
 

Initializes this key sequence to contain the given key sequence. The description consists of comma-separated keys as required by KKey::KKey(const QString&).

Parameters:
key  the description of the key
Returns:
true if successful, false otherwise
See also:
KKeyServer::Sym::init() , KKey::KKey(const QString&)

bool KKeySequence::init const KKeySequence &    keySeq
 

Copies the given key sequence over this key sequence.

Parameters:
keySeq  the key sequence to copy
Returns:
true if successful, false otherwise

bool KKeySequence::init const KKeyNative   key
 

Initializes the key sequence to only contain the given key.

Parameters:
key  the key to set
Returns:
true if successful, false otherwise

bool KKeySequence::init const KKey &    key
 

Initializes the key sequence to only contain the given key.

Parameters:
key  the key to set
Returns:
true if successful, false otherwise

bool KKeySequence::init const QKeySequence &    keySeq
 

Copies the given qt key sequence over this key sequence.

Parameters:
keySeq  the qt key sequence to copy
Returns:
true if successful, false otherwise

Referenced by operator=().

bool KKeySequence::isNull  
 

Returns true if the key sequence is null (after clear() or empty constructor).

Returns:
true if the key sequence is null
See also:
clear() , null()

const KKey& KKeySequence::key uint    i const
 

Return the i'th key of this sequence, or a null key if there are less then i keys.

Parameters:
i  the key to retrieve
Returns:
the i'th key, or KKey::null() if there are less than i keys
See also:
MAX_KEYS

int KKeySequence::keyCodeQt  
 

Returns the qt key code of the first key.

Returns:
the qt key code of the first key
See also:
Qt::Key , KKey::keyCodeQt()

KKeySequence& KKeySequence::null   [static]
 

Returns a null key sequence.

Returns:
the null key sequence
See also:
isNull() , clear()

bool KKeySequence::operator!= const KKeySequence &    seq const [inline]
 

Compares the keys of both sequences.

See also:
compare()

Definition at line 474 of file kshortcut.h.

References compare().

bool KKeySequence::operator< const KKeySequence &    seq const [inline]
 

Compares the keys of both sequences.

See also:
compare()

Definition at line 481 of file kshortcut.h.

References compare().

KKeySequence& KKeySequence::operator= const KKeySequence &    seq [inline]
 

Copy the given key sequence into this sequence.

Definition at line 393 of file kshortcut.h.

References init().

bool KKeySequence::operator== const KKeySequence &    seq const [inline]
 

Compares the keys of both sequences.

See also:
compare()

Definition at line 467 of file kshortcut.h.

References compare().

QKeySequence KKeySequence::qt  
 

Converts this key sequence to a QKeySequence.

Returns:
the QKeySequence

bool KKeySequence::setKey uint    i,
const KKey &    key
 

Sets the i'th key of the sequence. You can not introduce gaps in a sequence, so you must use an i <= count(). Also note that the maximum length of a key sequence is MAX_KEYS.

Parameters:
i  the position of the new key (<= count(), <= MAX_KEYS)
key  the key to set
Returns:
true if successful, false otherwise

bool KKeySequence::startsWith const KKeySequence &    keySeq const
 

Returns true if this key sequence begins with the given sequence.

Parameters:
keySeq  the key sequence to search
Returns:
true if this key sequence begins with the given sequence

QString KKeySequence::toString  
 

Returns the key sequence as a number of key presses as returned by KKey::toString(), seperated by commas.

Returns:
the string represenation of this key sequence
See also:
KKey::toString()


The documentation for this class was generated from the following file:
Generated on Wed Aug 13 23:30:17 2003 for kdelibs by doxygen1.2.18