class KShortcut


Definition#include <kshortcut.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types

Public Methods

Public Static Methods

Protected Members


Detailed Description

enum { MAX_SEQUENCES = 2 }

The maximum number of key sequences that can be contained in a KShortcut.

 KShortcut ()

KShortcut

Creates a new null shortcut.

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

 KShortcut ( int keyQt )

KShortcut

Creates a new shortcut with the given Qt key code as the only key sequence.

Parameters:
keyQtthe qt keycode

See also: Qt::Key

 KShortcut ( const QKeySequence& keySeq )

KShortcut

Creates a new shortcut that contains only the given qt key sequence.

Parameters:
keySeqthe qt key sequence to add

 KShortcut ( const KKey& key )

KShortcut

Creates a new shortcut that contains only the given key in its only sequence.

Parameters:
keythe key to add

 KShortcut ( const KKeySequence& keySeq )

KShortcut

Creates a new shortcut that contains only the given key sequence.

Parameters:
keySeqthe key sequence to add

 KShortcut ( const KShortcut& shortcut )

KShortcut

Copies the given shortcut.

Parameters:
shortcutthe shortcut to add

 KShortcut ( const char* shortcut )

KShortcut

Creates a new key sequence that contains the given key sequence. The description consists of semicolon-separated keys as used in KKeySequence::KKeySequence(const QString&).

Parameters:
shortcutthe description of the key

See also: KKeySequence::KKeySequence(const, QString&)

 KShortcut ( const QString& shortcut )

KShortcut

Creates a new key sequence that contains the given key sequence. The description consists of semicolon-separated keys as used in KKeySequence::KKeySequence(const QString&).

Parameters:
shortcutthe description of the key

See also: KKeySequence::KKeySequence(const, QString&)

 ~KShortcut ()

~KShortcut

void  clear ()

clear

Clears the shortcut. The shortcut is null after calling this function.

See also: isNull()

bool  init ( int keyQt )

init

Initializes the shortcut with the given Qt key code as the only key sequence.

Parameters:
keyQtthe qt keycode

See also: Qt::Key

bool  init ( const QKeySequence& keySeq )

init

Initializes the shortcut with the given qt key sequence.

Parameters:
keySeqthe qt key sequence to add

bool  init ( const KKey& key )

init

Initializes the shortcut with the given key as its only sequence.

Parameters:
keythe key to add

bool  init ( const KKeySequence& keySeq )

init

Initializes the shortcut with the given qt key sequence.

Parameters:
keySeqthe qt key sequence to add

bool  init ( const KShortcut& shortcut )

init

Copies the given shortcut.

Parameters:
shortcutthe shortcut to add

bool  init ( const QString& shortcut )

init

Initializes the key sequence with the given key sequence. The description consists of semicolon-separated keys as used in KKeySequence::KKeySequence(const QString&).

Parameters:
shortcutthe description of the key

See also: KKeySequence::KKeySequence(const, QString&)

KShortcut&  operator = ( const KShortcut& cut )

operator =

Copies the given shortcut over this shortcut.

uint  count ()

count

[const]

Returns the number of sequences that are in this shortcut.

Returns: the number of sequences MAX_SEQUENCES

const KKeySequence&  seq ( uint i )

seq

[const]

Returns the i'th key sequence of this shortcut.

Parameters:
ithe number of the key sequence to retrieve

Returns: the i'th sequence or KKeySequence::null() if there are less than i key sequences MAX_SEQUENCES

int  keyCodeQt ()

keyCodeQt

[const]

Returns the key code of the first key sequence, or null if there is no first key sequence.

Returns: the key code of the first sequence's first key

See also: Qt::Key, KKeySequence::keyCodeQt()

bool  isNull ()

isNull

[const]

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

Returns: true if the shortcut is null

See also: clear(), null()

int  compare ( const KShortcut& shortcut )

compare

[const]

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

Parameters:
shortcutthe shortcut to compare to

Returns: a negative number if the given KShortcut is larger, 0 if they are equal and a positive number this KShortcut is larger

See also: KKey::compare(), KKeyShortcut::compare()

bool  operator == ( const KShortcut& cut )

operator ==

[const]

Compares the sequences of both shortcuts.

See also: compare()

bool  operator != ( const KShortcut& cut )

operator !=

[const]

Compares the sequences of both shortcuts.

See also: compare()

bool  operator < ( const KShortcut& cut )

operator <

[const]

Compares the sequences of both shortcuts.

See also: compare()

bool  contains ( const KKey& key )

contains

[const]

Checks whether this shortcut contains a sequence that starts with the given key.

Parameters:
keythe key to check

Returns: true if a key sequence starts with the key

bool  contains ( const KKeyNative& key )

contains

[const]

Checks whether this shortcut contains a sequence that starts with the given key.

Parameters:
keythe key to check

Returns: true if a key sequence starts with the key

bool  contains ( const KKeySequence& keySeq )

contains

[const]

Checks whether this shortcut contains the given sequence.

Parameters:
keySeqthe key sequence to check

Returns: true if the shortcut has the given key sequence

bool  setSeq ( uint i, const KKeySequence& keySeq )

setSeq

Sets the i'th key sequence of the shortcut. You can not introduce gaps in the list of sequences, so you must use an @i <= count(). Also note that the maximum number of key sequences is MAX_SEQUENCES.

Parameters:
ithe position of the new key sequence(<= count(), <= MAX_SEQUENCES)
keySeqthe key sequence to set

Returns: true if successful, false otherwise

bool  append ( const KKeySequence& keySeq )

append

Appends the given key sequence.

Parameters:
keySeqthe key sequence to add

Returns: true if successful, false otherwise

See also: setSeq(), MAX_SEQUENCES

operator  QKeySequence ()

QKeySequence

[const]

Converts this shortcut to a key sequence. The first key sequence will be taken.

QString  toString ()

toString

[const]

Returns a description of the shortcut as semicolon-separated ket sequences, as returned by KKeySequence::toString().

Returns: the string represenation of this shortcut

See also: KKey::toString(), KKeySequence::toString()

QString  toStringInternal ( const KShortcut* pcutDefault = 0 )

toStringInternal

[const]

KShortcut&  null ()

null

[static]

Returns a null shortcut.

Returns: the null shortcut

See also: isNull(), clear()

uint m_nSeqs

m_nSeqs

[protected]

KKeySequence m_rgseq[MAX_SEQUENCES]

m_rgseq[MAX_SEQUENCES]

[protected]

operator  int ()

int

[const]


Generated by: caleb on tcdevel on Tue Jan 28 12:54:04 2003, using kdoc $.