.TH "KKeySequence" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdecore Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KKeySequence \- A KKeySequence object holds a sequence of up to 4 keys.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kshortcut.h>\fP
.PP
.SS "Public Types"

.in +1c
.ti -1c
.RI "enum { \fBMAX_KEYS\fP =  4 }"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKKeySequence\fP ()"
.br
.ti -1c
.RI "\fBKKeySequence\fP (const \fBQKeySequence\fP &keySeq)"
.br
.ti -1c
.RI "\fBKKeySequence\fP (const \fBKKey\fP &key)"
.br
.ti -1c
.RI "\fBKKeySequence\fP (const \fBKKeyNative\fP &key)"
.br
.ti -1c
.RI "\fBKKeySequence\fP (const \fBKKeySequence\fP &keySeq)"
.br
.ti -1c
.RI "\fBKKeySequence\fP (const \fBQString\fP &keySeq)"
.br
.ti -1c
.RI "void \fBclear\fP ()"
.br
.ti -1c
.RI "bool \fBinit\fP (const \fBQKeySequence\fP &keySeq)"
.br
.ti -1c
.RI "bool \fBinit\fP (const \fBKKey\fP &key)"
.br
.ti -1c
.RI "bool \fBinit\fP (const \fBKKeyNative\fP &key)"
.br
.ti -1c
.RI "bool \fBinit\fP (const \fBKKeySequence\fP &keySeq)"
.br
.ti -1c
.RI "bool \fBinit\fP (const \fBQString\fP &key)"
.br
.ti -1c
.RI "\fBKKeySequence\fP & \fBoperator=\fP (const \fBKKeySequence\fP &seq)"
.br
.ti -1c
.RI "uint \fBcount\fP () const "
.br
.ti -1c
.RI "const \fBKKey\fP & \fBkey\fP (uint i) const "
.br
.ti -1c
.RI "bool \fBisTriggerOnRelease\fP () const "
.br
.ti -1c
.RI "bool \fBsetKey\fP (uint i, const \fBKKey\fP &key)"
.br
.ti -1c
.RI "bool \fBisNull\fP () const "
.br
.ti -1c
.RI "bool \fBstartsWith\fP (const \fBKKeySequence\fP &keySeq) const "
.br
.ti -1c
.RI "int \fBcompare\fP (const \fBKKeySequence\fP &keySeq) const "
.br
.ti -1c
.RI "bool \fBoperator==\fP (const \fBKKeySequence\fP &seq) const "
.br
.ti -1c
.RI "bool \fBoperator!=\fP (const \fBKKeySequence\fP &seq) const "
.br
.ti -1c
.RI "bool \fBoperator<\fP (const \fBKKeySequence\fP &seq) const "
.br
.ti -1c
.RI "\fBQKeySequence\fP \fBqt\fP () const "
.br
.ti -1c
.RI "int \fBkeyCodeQt\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBtoString\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBtoStringInternal\fP () const "
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static \fBKKeySequence\fP & \fBnull\fP ()"
.br
.in -1c
.SS "Protected Attributes"

.in +1c
.ti -1c
.RI "uchar \fBm_nKeys\fP"
.br
.ti -1c
.RI "uchar \fBm_bTriggerOnRelease\fP"
.br
.ti -1c
.RI "\fBKKey\fP \fBm_rgvar\fP [MAX_KEYS]"
.br
.in -1c
.SS "Friends"

.in +1c
.ti -1c
.RI "class \fBKKeyNative\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
A KKeySequence object holds a sequence of up to 4 keys. 

Ex: Ctrl+X,I 
.PP
\fBSee also:\fP
.RS 4
\fBKKey\fP 
.PP
\fBKShortcut\fP 
.RE
.PP

.PP
Definition at line 288 of file kshortcut.h.
.SH "Member Enumeration Documentation"
.PP 
.SS "anonymous enum"
.PP
Defines the maximum length of the key sequence. 
.PP
Definition at line 292 of file kshortcut.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KKeySequence::KKeySequence ()"
.PP
Create a new null key sequence. 
.PP
\fBSee also:\fP
.RS 4
\fBisNull()\fP 
.PP
\fBnull()\fP 
.PP
\fBclear()\fP
.RE
.PP

.PP
Definition at line 206 of file kshortcut.cpp.
.PP
References clear().
.SS "KKeySequence::KKeySequence (const \fBQKeySequence\fP & keySeq)"
.PP
Copies the given qt key sequence. 
.PP
\fBParameters:\fP
.RS 4
\fIkeySeq\fP the qt key sequence to copy
.RE
.PP

.PP
Definition at line 207 of file kshortcut.cpp.
.PP
References init().
.SS "KKeySequence::KKeySequence (const \fBKKey\fP & key)"
.PP
Create a new key sequence that only contains the given key. 
.PP
\fBParameters:\fP
.RS 4
\fIkey\fP the key to add
.RE
.PP

.PP
Definition at line 208 of file kshortcut.cpp.
.PP
References init(), and key().
.SS "KKeySequence::KKeySequence (const \fBKKeyNative\fP & key)"
.PP
Create a new key sequence that only contains the given key. 
.PP
\fBParameters:\fP
.RS 4
\fIkey\fP the key to add
.RE
.PP

.SS "KKeySequence::KKeySequence (const \fBKKeySequence\fP & keySeq)"
.PP
Copies the given key sequence. 
.PP
\fBParameters:\fP
.RS 4
\fIkeySeq\fP the key sequence to copy
.RE
.PP

.PP
Definition at line 209 of file kshortcut.cpp.
.PP
References init().
.SS "KKeySequence::KKeySequence (const \fBQString\fP & keySeq)"
.PP
Creates a new key sequence that contains the given key sequence. 
.PP
The description consists of comma-separated keys as required by \fBKKey::KKey(const QString&)\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIkeySeq\fP the description of the key 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBKKeyServer::Sym::init()\fP 
.PP
\fBKKey::KKey(const QString&)\fP
.RE
.PP

.PP
Definition at line 210 of file kshortcut.cpp.
.PP
References init().
.SH "Member Function Documentation"
.PP 
.SS "void KKeySequence::clear ()"
.PP
Clears the key sequence. 
.PP
The key sequence is null after calling this function. 
.PP
\fBSee also:\fP
.RS 4
\fBisNull()\fP
.RE
.PP

.PP
Definition at line 216 of file kshortcut.cpp.
.PP
Referenced by init(), KKeySequence(), and null().
.SS "bool KKeySequence::init (const \fBQKeySequence\fP & keySeq)"
.PP
Copies the given qt key sequence over this key sequence. 
.PP
\fBParameters:\fP
.RS 4
\fIkeySeq\fP the qt key sequence to copy 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise
.RE
.PP

.PP
Definition at line 222 of file kshortcut.cpp.
.PP
References clear(), KKey::init(), and KKey::isNull().
.PP
Referenced by KShortcut::append(), KShortcut::init(), KKeySequence(), and KStdAccel::shortcutDefault4().
.SS "bool KKeySequence::init (const \fBKKey\fP & key)"
.PP
Initializes the key sequence to only contain the given key. 
.PP
\fBParameters:\fP
.RS 4
\fIkey\fP the key to set 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise
.RE
.PP

.PP
Definition at line 247 of file kshortcut.cpp.
.PP
References clear(), KKey::init(), KKey::isNull(), and key().
.SS "bool KKeySequence::init (const \fBKKeyNative\fP & key)"
.PP
Initializes the key sequence to only contain the given key. 
.PP
\fBParameters:\fP
.RS 4
\fIkey\fP the key to set 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise
.RE
.PP

.SS "bool KKeySequence::init (const \fBKKeySequence\fP & keySeq)"
.PP
Copies the given key sequence over this key sequence. 
.PP
\fBParameters:\fP
.RS 4
\fIkeySeq\fP the key sequence to copy 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise
.RE
.PP

.PP
Definition at line 258 of file kshortcut.cpp.
.PP
References endl().
.SS "bool KKeySequence::init (const \fBQString\fP & key)"
.PP
Initializes this key sequence to contain the given key sequence. 
.PP
The description consists of comma-separated keys as required by \fBKKey::KKey(const QString&)\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIkey\fP the description of the key 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBKKeyServer::Sym::init()\fP 
.PP
\fBKKey::KKey(const QString&)\fP
.RE
.PP

.PP
Definition at line 273 of file kshortcut.cpp.
.PP
References clear(), KKey::init(), and QStringList::split().
.SS "\fBKKeySequence\fP& KKeySequence::operator= (const \fBKKeySequence\fP & seq)\fC [inline]\fP"
.PP
Copy the given key sequence into this sequence. 
.PP

.PP
Definition at line 387 of file kshortcut.h.
.SS "uint KKeySequence::count () const"
.PP
Returns the number of key strokes of this sequence. 
.PP
\fBReturns:\fP
.RS 4
the number of key strokes 
.RE
.PP
\fBSee also:\fP
.RS 4
MAX_KEYS
.RE
.PP

.PP
Definition at line 294 of file kshortcut.cpp.
.PP
Referenced by KShortcut::contains(), keyCodeQt(), qt(), and KStdAccel::shortcutDefault4().
.SS "const \fBKKey\fP & KKeySequence::key (uint i) const"
.PP
Return the \fCi'th\fP key of this sequence, or a null key if there are less then i keys. 
.PP
\fBParameters:\fP
.RS 4
\fIi\fP the key to retrieve 
.RE
.PP
\fBReturns:\fP
.RS 4
the \fCi'th\fP key, or \fBKKey::null()\fP if there are less than i keys 
.RE
.PP
\fBSee also:\fP
.RS 4
MAX_KEYS
.RE
.PP

.PP
Definition at line 299 of file kshortcut.cpp.
.PP
References KKey::null().
.PP
Referenced by KShortcut::contains(), init(), keyCodeQt(), KKeySequence(), qt(), and setKey().
.SS "bool KKeySequence::setKey (uint i, const \fBKKey\fP & key)"
.PP
Sets the \fCi'th\fP key of the sequence. 
.PP
You can not introduce gaps in a sequence, so you must use an \fCi\fP <= \fBcount()\fP. Also note that the maximum length of a key sequence is MAX_KEYS. 
.PP
\fBParameters:\fP
.RS 4
\fIi\fP the position of the new key (<= \fBcount()\fP, <= MAX_KEYS) 
.br
\fIkey\fP the key to set 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise
.RE
.PP

.PP
Definition at line 310 of file kshortcut.cpp.
.PP
References KKey::init(), and key().
.SS "bool KKeySequence::isNull () const"
.PP
Returns true if the key sequence is null (after \fBclear()\fP or empty constructor). 
.PP
\fBReturns:\fP
.RS 4
true if the key sequence is null 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBclear()\fP 
.PP
\fBnull()\fP
.RE
.PP

.PP
Definition at line 321 of file kshortcut.cpp.
.PP
Referenced by KShortcut::append(), KShortcut::contains(), null(), and KShortcut::remove().
.SS "bool KKeySequence::startsWith (const \fBKKeySequence\fP & keySeq) const"
.PP
Returns true if this key sequence begins with the given sequence. 
.PP
\fBParameters:\fP
.RS 4
\fIkeySeq\fP the key sequence to search 
.RE
.PP
\fBReturns:\fP
.RS 4
true if this key sequence begins with the given sequence
.RE
.PP

.PP
Definition at line 326 of file kshortcut.cpp.
.SS "int KKeySequence::compare (const \fBKKeySequence\fP & keySeq) const"
.PP
Compares this object with the given key sequence. 
.PP
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. 
.PP
\fBParameters:\fP
.RS 4
\fIkeySeq\fP the key sequence to compare to 
.RE
.PP
\fBReturns:\fP
.RS 4
a negative number if the given KKeySequence is larger, 0 if they are equal and a positive number this KKeySequence is larger 
.RE
.PP
\fBSee also:\fP
.RS 4
KKey::sequence
.RE
.PP

.PP
Definition at line 339 of file kshortcut.cpp.
.PP
References KKey::compare().
.PP
Referenced by KShortcut::compare().
.SS "bool KKeySequence::operator== (const \fBKKeySequence\fP & seq) const\fC [inline]\fP"
.PP
Compares the keys of both sequences. 
.PP
\fBSee also:\fP
.RS 4
\fBcompare()\fP
.RE
.PP

.PP
Definition at line 456 of file kshortcut.h.
.SS "bool KKeySequence::operator!= (const \fBKKeySequence\fP & seq) const\fC [inline]\fP"
.PP
Compares the keys of both sequences. 
.PP
\fBSee also:\fP
.RS 4
\fBcompare()\fP
.RE
.PP

.PP
Definition at line 463 of file kshortcut.h.
.SS "bool KKeySequence::operator< (const \fBKKeySequence\fP & seq) const\fC [inline]\fP"
.PP
Compares the keys of both sequences. 
.PP
\fBSee also:\fP
.RS 4
\fBcompare()\fP
.RE
.PP

.PP
Definition at line 470 of file kshortcut.h.
.SS "\fBQKeySequence\fP KKeySequence::qt () const"
.PP
Converts this key sequence to a \fBQKeySequence\fP. 
.PP
\fBReturns:\fP
.RS 4
the \fBQKeySequence\fP
.RE
.PP

.PP
Definition at line 352 of file kshortcut.cpp.
.PP
References count(), and key().
.PP
Referenced by KShortcut::operator QKeySequence().
.SS "int KKeySequence::keyCodeQt () const"
.PP
Returns the qt key code of the first key. 
.PP
\fBReturns:\fP
.RS 4
the qt key code of the first key 
.RE
.PP
\fBSee also:\fP
.RS 4
Qt::Key 
.PP
\fBKKey::keyCodeQt()\fP
.RE
.PP

.PP
Definition at line 368 of file kshortcut.cpp.
.PP
References count(), and key().
.PP
Referenced by KShortcut::keyCodeQt().
.SS "\fBQString\fP KKeySequence::toString () const"
.PP
Returns the key sequence as a number of key presses as returned by \fBKKey::toString()\fP, separated by commas. 
.PP
\fBReturns:\fP
.RS 4
the string represenation of this key sequence 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBKKey::toString()\fP
.RE
.PP

.PP
Definition at line 373 of file kshortcut.cpp.
.PP
References KKey::toString().
.PP
Referenced by KShortcut::toString().
.SS "\fBKKeySequence\fP & KKeySequence::null ()\fC [static]\fP"
.PP
Returns a null key sequence. 
.PP
\fBReturns:\fP
.RS 4
the null key sequence 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBisNull()\fP 
.PP
\fBclear()\fP
.RE
.PP

.PP
Definition at line 401 of file kshortcut.cpp.
.PP
References clear(), and isNull().
.PP
Referenced by KShortcut::seq().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdecore Library from the source code.
