.TH "KCompletion" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdecore Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KCompletion \- A generic class for completing QStrings.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kcompletion.h>\fP
.PP
Inherits \fBQObject\fP.
.PP
Inherited by \fBKURLCompletion\fP.
.PP
.SS "Public Types"

.in +1c
.ti -1c
.RI "enum \fBCompOrder\fP { \fBSorted\fP, \fBInsertion\fP, \fBWeighted\fP }"
.br
.in -1c
.SS "Public Slots"

.in +1c
.ti -1c
.RI "void \fBslotMakeCompletion\fP (const \fBQString\fP &string)"
.br
.ti -1c
.RI "void \fBslotPreviousMatch\fP ()"
.br
.ti -1c
.RI "void \fBslotNextMatch\fP ()"
.br
.ti -1c
.RI "void \fBinsertItems\fP (const \fBQStringList\fP &items)"
.br
.ti -1c
.RI "virtual void \fBsetItems\fP (const \fBQStringList\fP &list)"
.br
.ti -1c
.RI "void \fBaddItem\fP (const \fBQString\fP &item)"
.br
.ti -1c
.RI "void \fBaddItem\fP (const \fBQString\fP &item, uint weight)"
.br
.ti -1c
.RI "void \fBremoveItem\fP (const \fBQString\fP &item)"
.br
.ti -1c
.RI "virtual void \fBclear\fP ()"
.br
.in -1c
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBmatch\fP (const \fBQString\fP &item)"
.br
.ti -1c
.RI "void \fBmatches\fP (const \fBQStringList\fP &matchlist)"
.br
.ti -1c
.RI "void \fBmultipleMatches\fP ()"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKCompletion\fP ()"
.br
.ti -1c
.RI "virtual \fB~KCompletion\fP ()"
.br
.ti -1c
.RI "virtual \fBQString\fP \fBmakeCompletion\fP (const \fBQString\fP &string)"
.br
.ti -1c
.RI "\fBQStringList\fP \fBsubstringCompletion\fP (const \fBQString\fP &string) const "
.br
.ti -1c
.RI "\fBQString\fP \fBpreviousMatch\fP ()"
.br
.ti -1c
.RI "\fBQString\fP \fBnextMatch\fP ()"
.br
.ti -1c
.RI "virtual const \fBQString\fP & \fBlastMatch\fP () const "
.br
.ti -1c
.RI "\fBQStringList\fP \fBitems\fP () const "
.br
.ti -1c
.RI "bool \fBisEmpty\fP () const "
.br
.ti -1c
.RI "virtual void \fBsetCompletionMode\fP (\fBKGlobalSettings::Completion\fP mode)"
.br
.ti -1c
.RI "\fBKGlobalSettings::Completion\fP \fBcompletionMode\fP () const "
.br
.ti -1c
.RI "virtual void \fBsetOrder\fP (\fBCompOrder\fP order)"
.br
.ti -1c
.RI "\fBCompOrder\fP \fBorder\fP () const "
.br
.ti -1c
.RI "virtual void \fBsetIgnoreCase\fP (bool ignoreCase)"
.br
.ti -1c
.RI "bool \fBignoreCase\fP () const "
.br
.ti -1c
.RI "\fBQStringList\fP \fBallMatches\fP ()"
.br
.ti -1c
.RI "\fBQStringList\fP \fBallMatches\fP (const \fBQString\fP &string)"
.br
.ti -1c
.RI "\fBKCompletionMatches\fP \fBallWeightedMatches\fP ()"
.br
.ti -1c
.RI "\fBKCompletionMatches\fP \fBallWeightedMatches\fP (const \fBQString\fP &string)"
.br
.ti -1c
.RI "virtual void \fBsetEnableSounds\fP (bool enable)"
.br
.ti -1c
.RI "bool \fBisSoundsEnabled\fP () const "
.br
.ti -1c
.RI "bool \fBhasMultipleMatches\fP () const "
.br
.ti -1c
.RI "void \fBenableSounds\fP ()"
.br
.ti -1c
.RI "void \fBdisableSounds\fP ()"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual void \fBpostProcessMatch\fP (\fBQString\fP *match) const "
.br
.ti -1c
.RI "virtual void \fBpostProcessMatches\fP (\fBQStringList\fP *matches) const "
.br
.ti -1c
.RI "virtual void \fBpostProcessMatches\fP (\fBKCompletionMatches\fP *matches) const "
.br
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SS "Properties"

.in +1c
.ti -1c
.RI "\fBCompOrder\fP \fBorder\fP"
.br
.ti -1c
.RI "bool \fBignoreCase\fP"
.br
.ti -1c
.RI "\fBQStringList\fP \fBitems\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
A generic class for completing QStrings. 

This class offers easy use of 'auto-completion', 'manual-completion' or 'shell completion' on \fBQString\fP objects. A common use is completing filenames or URLs (see KURLCompletion()). But it is not limited to URL-completion -- everything should be completable! The user should be able to complete email-addresses, telephone-numbers, commands, SQL queries, ... Every time your program knows what the user can type into an edit-field, you should offer completion. With KCompletion, this is very easy, and if you are using a line edit widget ( \fBKLineEdit\fP), it is even more easy. Basically, you tell a KCompletion object what strings should be completable and whenever completion should be invoked, you call \fBmakeCompletion()\fP. \fBKLineEdit\fP and (an editable) \fBKComboBox\fP even do this automatically for you.
.PP
KCompletion offers the completed string via the signal \fBmatch()\fP and all matching strings (when the result is ambiguous) via the method \fBallMatches()\fP.
.PP
Notice: auto-completion, shell completion and manual completion work slightly differently:
.PP
.PD 0
.IP "\(bu" 2
auto-completion always returns a complete item as match. When more than one matching items are available, it will deliver just the first (depending on sorting order) item. Iterating over all matches is possible via \fBnextMatch()\fP and \fBpreviousMatch()\fP.
.PP
.PD 0
.IP "\(bu" 2
popup-completion works in the same way, the only difference being that the completed items are not put into the edit-widget, but into a separate popup-box.
.PP
.PD 0
.IP "\(bu" 2
manual completion works the same way as auto-completion, the subtle difference is, that it isn't invoked automatically while the user is typing, but only when the user presses a special key. The difference of manual and auto-completion is therefore only visible in UI classes, KCompletion needs to know whether to deliver partial matches (shell completion) or whole matches (auto/manual completion), therefore \fBKGlobalSettings::CompletionMan\fP and \fBKGlobalSettings::CompletionAuto\fP have the exact same effect in KCompletion.
.PP
.PD 0
.IP "\(bu" 2
shell completion works like how shells complete filenames: when multiple matches are available, the longest possible string of all matches is returned (i.e. only a partial item). Iterating over all matching items (complete, not partial) is possible via \fBnextMatch()\fP and \fBpreviousMatch()\fP.
.PP
You don't have to worry much about that though, KCompletion handles that for you, according to the setting \fBsetCompletionMode()\fP. The default setting is globally configured by the user and read from \fBKGlobalSettings::completionMode()\fP.
.PP
A short example: 
.PP
.nf
 KCompletion completion;
 completion.setOrder( KCompletion::Sorted );
 completion.addItem( 'pfeiffer@kde.org' );
 completion.addItem( 'coolo@kde.org' );
 completion.addItem( 'carpdjih@sp.zrz.tu-berlin.de' );
 completion.addItem( 'carp@cs.tu-berlin.de' );

 cout << completion.makeCompletion( 'ca' ).latin1() << endl;

.fi
.PP
.PP
In shell-completion-mode, this will be 'carp'; in auto-completion- mode it will be 'carp\\@cs.tu-berlin.de', as that is alphabetically smaller. If setOrder was set to Insertion, 'carpdjih\\@sp.zrz.tu-berlin.de' would be completed in auto-completion-mode, as that was inserted before 'carp\\@cs.tu-berlin.de'.
.PP
You can dynamically update the completable items by removing and adding them whenever you want. For advanced usage, you could even use multiple KCompletion objects. E.g. imagine an editor like kwrite with multiple open files. You could store items of each file in a different KCompletion object, so that you know (and tell the user) where a completion comes from.
.PP
Note: KCompletion does not work with strings that contain 0x0 characters (unicode nul), as this is used internally as a delimiter.
.PP
You may inherit from KCompletion and override \fBmakeCompletion()\fP in special cases (like reading directories/urls and then supplying the contents to KCompletion, as \fBKURLCompletion\fP does), but generally, this is not necessary.
.PP
\fBAuthor:\fP
.RS 4
Carsten Pfeiffer <pfeiffer@kde.org> 
.RE
.PP

.PP
Definition at line 132 of file kcompletion.h.
.SH "Member Enumeration Documentation"
.PP 
.SS "enum \fBKCompletion::CompOrder\fP"
.PP
Constants that represent the order in which KCompletion performs completion-lookups. 
.PP
\fBEnumeration values: \fP
.in +1c
.TP
\fB\fISorted \fP\fP
Use order of insertion. 
.TP
\fB\fIInsertion \fP\fP
Use alphabetically sorted order. 
.TP
\fB\fIWeighted \fP\fP
Use weighted order. 
.PP
Definition at line 145 of file kcompletion.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KCompletion::KCompletion ()"
.PP
Constructor, nothing special here :). 
.PP
Definition at line 41 of file kcompletion.cpp.
.PP
References KGlobalSettings::completionMode(), Insertion, and setOrder().
.SS "KCompletion::~\fBKCompletion\fP ()\fC [virtual]\fP"
.PP
Destructor, nothing special here, either. 
.PP
Definition at line 54 of file kcompletion.cpp.
.SH "Member Function Documentation"
.PP 
.SS "\fBQString\fP KCompletion::makeCompletion (const \fBQString\fP & string)\fC [virtual]\fP"
.PP
Attempts to find an item in the list of available completions, that begins with \fCstring\fP. 
.PP
Will either return the first matching item (if there is more than one match) or QString::null, if no match was found.
.PP
In the latter case, a sound will be issued, depending on \fBisSoundsEnabled()\fP. If a match was found, it will also be emitted via the signal \fBmatch()\fP.
.PP
If this is called twice or more often with the same string while no items were added or removed in the meantime, all available completions will be emitted via the signal \fBmatches()\fP. This happens only in shell-completion-mode.
.PP
\fBParameters:\fP
.RS 4
\fIstring\fP the string to complete 
.RE
.PP
\fBReturns:\fP
.RS 4
the matching item, or QString::null if there is no matching item. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBslotMakeCompletion\fP 
.PP
\fBsubstringCompletion\fP 
.RE
.PP

.PP
Reimplemented in \fBKShellCompletion\fP, and \fBKURLCompletion\fP.
.PP
Definition at line 189 of file kcompletion.cpp.
.PP
References KShortcut::isNull(), match(), matches(), multipleMatches(), postProcessMatch(), and postProcessMatches().
.SS "\fBQStringList\fP KCompletion::substringCompletion (const \fBQString\fP & string) const"
.PP
Returns a list of all completion items that contain the given \fCstring\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIstring\fP the string to complete 
.RE
.PP
\fBReturns:\fP
.RS 4
a list of items which all contain \fCtext\fP as a substring, i.e. not necessarily at the beginning.
.RE
.PP
\fBSee also:\fP
.RS 4
\fBmakeCompletion\fP 
.RE
.PP

.PP
Definition at line 251 of file kcompletion.cpp.
.PP
References QString::find(), matches(), postProcessMatch(), postProcessMatches(), and Weighted.
.SS "\fBQString\fP KCompletion::previousMatch ()"
.PP
Returns the next item from the matching-items-list. 
.PP
When reaching the beginning, the list is rotated so it will return the last match and a sound is issued (depending on \fBisSoundsEnabled()\fP). 
.PP
\fBReturns:\fP
.RS 4
the next item from the matching-items-list. When there is no match, QString::null is returned and a sound is be issued. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBslotPreviousMatch\fP 
.RE
.PP

.PP
Definition at line 378 of file kcompletion.cpp.
.PP
References match(), matches(), and postProcessMatch().
.SS "\fBQString\fP KCompletion::nextMatch ()"
.PP
Returns the next item from the matching-items-list. 
.PP
When reaching the last item, the list is rotated, so it will return the first match and a sound is issued (depending on \fBisSoundsEnabled()\fP). 
.PP
\fBReturns:\fP
.RS 4
the next item from the matching-items-list. When there is no match, QString::null is returned and a sound is issued 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBslotNextMatch\fP 
.RE
.PP

.PP
Definition at line 345 of file kcompletion.cpp.
.PP
References match(), matches(), and postProcessMatch().
.SS "virtual const \fBQString\fP& KCompletion::lastMatch () const\fC [inline, virtual]\fP"
.PP
Returns the last match. 
.PP
Might be useful if you need to check whether a completion is different from the last one. 
.PP
\fBReturns:\fP
.RS 4
the last match. QString::null is returned when there is no last match. 
.RE
.PP

.PP
Definition at line 224 of file kcompletion.h.
.SS "\fBQStringList\fP KCompletion::items () const"
.PP
Returns a list of all items inserted into KCompletion. 
.PP
This is useful if you need to save the state of a KCompletion object and restore it later.
.PP
Important note: when \fBorder()\fP == Weighted, then every item in the stringlist has its weight appended, delimited by a colon. E.g. an item 'www.kde.org' might look like 'www.kde.org:4', where 4 is the weight.
.PP
This is necessary so that you can save the items along with its weighting on disk and load them back with \fBsetItems()\fP, restoring its weight as well. If you really don't want the appended weightings, call setOrder( KCompletion::Insertion ) before calling \fBitems()\fP.
.PP
\fBReturns:\fP
.RS 4
a list of all items 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetItems\fP 
.RE
.PP

.SS "bool KCompletion::isEmpty () const"
.PP
Returns true when the completion object contains no entries. 
.PP
Definition at line 101 of file kcompletion.cpp.
.PP
References KCompTreeNode::childrenCount().
.SS "void KCompletion::setCompletionMode (\fBKGlobalSettings::Completion\fP mode)\fC [virtual]\fP"
.PP
Sets the completion mode to Auto/Manual, Shell or None. 
.PP
If you don't set the mode explicitly, the global default value \fBKGlobalSettings::completionMode()\fP is used. \fBKGlobalSettings::CompletionNone\fP disables completion. 
.PP
\fBParameters:\fP
.RS 4
\fImode\fP the completion mode 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBcompletionMode\fP 
.PP
\fBKGlobalSettings::completionMode\fP 
.RE
.PP

.PP
Definition at line 290 of file kcompletion.cpp.
.SS "\fBKGlobalSettings::Completion\fP KCompletion::completionMode () const\fC [inline]\fP"
.PP
Return the current completion mode. 
.PP
May be different from \fBKGlobalSettings::completionMode()\fP, if you explicitly called \fBsetCompletionMode()\fP. 
.PP
\fBReturns:\fP
.RS 4
the current completion mode 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetCompletionMode\fP 
.RE
.PP

.PP
Definition at line 269 of file kcompletion.h.
.SS "void KCompletion::setOrder (\fBCompOrder\fP order)\fC [virtual]\fP"
.PP
KCompletion offers three different ways in which it offers its items: 
.PD 0

.IP "\(bu" 2
in the order of insertion 
.IP "\(bu" 2
sorted alphabetically 
.IP "\(bu" 2
weighted. 
.PP

.PP
Choosing weighted makes KCompletion perform an implicit weighting based on how often an item is inserted. Imagine a web browser with a location bar, where the user enters URLs. The more often a URL is entered, the higher priority it gets.
.PP
Note: Setting the order to sorted only affects new inserted items, already existing items will stay in the current order. So you probably want to call setOrder( Sorted ) before inserting items, when you want everything sorted.
.PP
Default is insertion order. 
.PP
\fBParameters:\fP
.RS 4
\fIorder\fP the new order 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBorder\fP 
.RE
.PP

.PP
Definition at line 60 of file kcompletion.cpp.
.PP
References Weighted.
.PP
Referenced by KCompletion().
.SS "\fBCompOrder\fP KCompletion::order () const\fC [inline]\fP"
.PP
Returns the completion order. 
.PP
\fBReturns:\fP
.RS 4
the current completion order. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetOrder\fP 
.RE
.PP

.PP
Definition at line 300 of file kcompletion.h.
.SS "void KCompletion::setIgnoreCase (bool ignoreCase)\fC [virtual]\fP"
.PP
Setting this to true makes KCompletion behave case insensitively. 
.PP
E.g. makeCompletion( 'CA' ); might return 'carp\\@cs.tu-berlin.de'. Default is false (case sensitive). 
.PP
\fBParameters:\fP
.RS 4
\fIignoreCase\fP true to ignore the case 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBignoreCase\fP 
.RE
.PP

.PP
Definition at line 66 of file kcompletion.cpp.
.SS "bool KCompletion::ignoreCase () const\fC [inline]\fP"
.PP
Return whether KCompletion acts case insensitively or not. 
.PP
Default is false (case sensitive). 
.PP
\fBReturns:\fP
.RS 4
true if the case will be ignored 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetIgnoreCase\fP 
.RE
.PP

.PP
Definition at line 317 of file kcompletion.h.
.SS "\fBQStringList\fP KCompletion::allMatches ()"
.PP
Returns a list of all items matching the last completed string. 
.PP
Might take some time, when you have LOTS of items. 
.PP
\fBReturns:\fP
.RS 4
a list of all matches for the last completed string. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsubstringCompletion\fP 
.RE
.PP

.PP
Definition at line 295 of file kcompletion.cpp.
.PP
References matches(), postProcessMatches(), and Weighted.
.SS "\fBQStringList\fP KCompletion::allMatches (const \fBQString\fP & string)"
.PP
Returns a list of all items matching \fCstring\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIstring\fP the string to match 
.RE
.PP
\fBReturns:\fP
.RS 4
the list of all matches 
.RE
.PP

.PP
Definition at line 321 of file kcompletion.cpp.
.PP
References matches(), postProcessMatches(), and Weighted.
.SS "\fBKCompletionMatches\fP KCompletion::allWeightedMatches ()"
.PP
Returns a list of all items matching the last completed string. 
.PP
Might take some time, when you have LOTS of items. The matches are returned as \fBKCompletionMatches\fP, which also keeps the weight of the matches, allowing you to modify some matches or merge them with matches from another call to \fBallWeightedMatches()\fP, and sort the matches after that in order to have the matches ordered correctly.
.PP
\fBReturns:\fP
.RS 4
a list of all completion matches 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsubstringCompletion\fP 
.RE
.PP

.PP
Definition at line 308 of file kcompletion.cpp.
.PP
References matches(), postProcessMatches(), and Weighted.
.SS "\fBKCompletionMatches\fP KCompletion::allWeightedMatches (const \fBQString\fP & string)"
.PP
Returns a list of all items matching \fCstring\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIstring\fP the string to match 
.RE
.PP
\fBReturns:\fP
.RS 4
a list of all matches 
.RE
.PP

.PP
Definition at line 331 of file kcompletion.cpp.
.PP
References matches(), postProcessMatches(), and Weighted.
.SS "virtual void KCompletion::setEnableSounds (bool enable)\fC [inline, virtual]\fP"
.PP
Enables/disables playing a sound when 
.PD 0

.IP "\(bu" 2
\fBmakeCompletion()\fP can't find a match 
.IP "\(bu" 2
there is a partial completion (= multiple matches in Shell-completion mode) 
.IP "\(bu" 2
\fBnextMatch()\fP or \fBpreviousMatch()\fP hit the last possible match -> rotation. 
.PP

.PP
For playing the sounds, KNotifyClient() is used.
.PP
\fBParameters:\fP
.RS 4
\fIenable\fP true to enable sounds 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBisSoundsEnabled\fP 
.RE
.PP

.PP
Definition at line 368 of file kcompletion.h.
.SS "bool KCompletion::isSoundsEnabled () const\fC [inline]\fP"
.PP
Tells you whether KCompletion will play sounds on certain occasions. 
.PP
Default is enabled. 
.PP
\fBReturns:\fP
.RS 4
true if sounds are enabled 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBenableSounds\fP 
.PP
\fBdisableSounds\fP 
.RE
.PP

.PP
Definition at line 377 of file kcompletion.h.
.SS "bool KCompletion::hasMultipleMatches () const\fC [inline]\fP"
.PP
Returns true when more than one match is found. 
.PP
\fBReturns:\fP
.RS 4
true if there are more than one match 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBmultipleMatches\fP 
.RE
.PP

.PP
Definition at line 384 of file kcompletion.h.
.SS "void KCompletion::enableSounds ()\fC [inline]\fP"
.PP
\fBDeprecated\fP
.RS 4
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetEnableSounds\fP 
.RE
.PP

.PP
Definition at line 391 of file kcompletion.h.
.SS "void KCompletion::disableSounds ()\fC [inline]\fP"
.PP
\fBDeprecated\fP
.RS 4
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetEnableSounds\fP 
.RE
.PP

.PP
Definition at line 397 of file kcompletion.h.
.SS "void KCompletion::slotMakeCompletion (const \fBQString\fP & string)\fC [inline, slot]\fP"
.PP
Attempts to complete 'string' and emits the completion via \fBmatch()\fP. 
.PP
Same as \fBmakeCompletion()\fP (just as a slot). 
.PP
\fBParameters:\fP
.RS 4
\fIstring\fP the string to complete 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBmakeCompletion\fP 
.RE
.PP

.PP
Definition at line 407 of file kcompletion.h.
.SS "void KCompletion::slotPreviousMatch ()\fC [inline, slot]\fP"
.PP
Searches the previous matching item and emits it via \fBmatch()\fP. 
.PP
Same as \fBpreviousMatch()\fP (just as a slot). 
.PP
\fBSee also:\fP
.RS 4
\fBpreviousMatch\fP 
.RE
.PP

.PP
Definition at line 416 of file kcompletion.h.
.SS "void KCompletion::slotNextMatch ()\fC [inline, slot]\fP"
.PP
Searches the next matching item and emits it via \fBmatch()\fP. 
.PP
Same as \fBnextMatch()\fP (just as a slot). 
.PP
\fBSee also:\fP
.RS 4
\fBnextMatch\fP 
.RE
.PP

.PP
Definition at line 425 of file kcompletion.h.
.SS "void KCompletion::insertItems (const \fBQStringList\fP & items)\fC [slot]\fP"
.PP
Inserts \fCitems\fP into the list of possible completions. 
.PP
Does the same as \fBsetItems()\fP, but does not call \fBclear()\fP before. 
.PP
\fBParameters:\fP
.RS 4
\fIitems\fP the items to insert 
.RE
.PP

.PP
Definition at line 78 of file kcompletion.cpp.
.PP
References addItem(), and Weighted.
.PP
Referenced by setItems().
.SS "void KCompletion::setItems (const \fBQStringList\fP & list)\fC [virtual, slot]\fP"
.PP
Sets the list of items available for completion. 
.PP
Removes all previous items.
.PP
Notice: when \fBorder()\fP == Weighted, then the weighting is looked up for every item in the stringlist. Every item should have ':number' appended, where number is an unsigned integer, specifying the weighting.
.PP
If you don't like this, call setOrder( KCompletion::Insertion ) before calling \fBsetItems()\fP.
.PP
\fBParameters:\fP
.RS 4
\fIlist\fP the list of items that are available for completion 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBitems\fP 
.RE
.PP

.PP
Definition at line 71 of file kcompletion.cpp.
.PP
References clear(), and insertItems().
.SS "void KCompletion::addItem (const \fBQString\fP & item)\fC [slot]\fP"
.PP
Adds an item to the list of available completions. 
.PP
Resets the current item-state ( \fBpreviousMatch()\fP and \fBnextMatch()\fP won't work anymore). 
.PP
\fBParameters:\fP
.RS 4
\fIitem\fP the item to add 
.RE
.PP

.PP
Definition at line 106 of file kcompletion.cpp.
.PP
Referenced by insertItems().
.SS "void KCompletion::addItem (const \fBQString\fP & item, uint weight)\fC [slot]\fP"
.PP
Adds an item to the list of available completions. 
.PP
Resets the current item-state ( \fBpreviousMatch()\fP and \fBnextMatch()\fP won't work anymore).
.PP
Sets the weighting of the item to \fCweight\fP or adds it to the current weighting if the item is already available. The weight has to be greater than 1 to take effect (default weight is 1). 
.PP
\fBParameters:\fP
.RS 4
\fIitem\fP the item to add 
.br
\fIweight\fP the weight of the item, default is 1 
.RE
.PP

.PP
Definition at line 115 of file kcompletion.cpp.
.PP
References KCompTreeNode::confirm(), KCompTreeNode::insert(), Sorted, and Weighted.
.SS "void KCompletion::removeItem (const \fBQString\fP & item)\fC [slot]\fP"
.PP
Removes an item from the list of available completions. 
.PP
Resets the current item-state ( \fBpreviousMatch()\fP and \fBnextMatch()\fP won't work anymore). 
.PP
\fBParameters:\fP
.RS 4
\fIitem\fP the item to remove 
.RE
.PP

.PP
Definition at line 168 of file kcompletion.cpp.
.PP
References KCompTreeNode::remove().
.SS "void KCompletion::clear ()\fC [virtual, slot]\fP"
.PP
Removes all inserted items. 
.PP
Definition at line 178 of file kcompletion.cpp.
.PP
Referenced by setItems().
.SS "void KCompletion::match (const \fBQString\fP & item)\fC [signal]\fP"
.PP
The matching item. 
.PP
Will be emitted by \fBmakeCompletion()\fP, \fBpreviousMatch()\fP or \fBnextMatch()\fP. May be QString::null if there is no matching item. 
.PP
\fBParameters:\fP
.RS 4
\fIitem\fP the match, or QString::null if there is none 
.RE
.PP

.PP
Referenced by makeCompletion(), nextMatch(), and previousMatch().
.SS "void KCompletion::matches (const \fBQStringList\fP & matchlist)\fC [signal]\fP"
.PP
All matching items. 
.PP
Will be emitted by \fBmakeCompletion()\fP in shell- completion-mode, when the same string is passed to makeCompletion twice or more often. 
.PP
\fBParameters:\fP
.RS 4
\fImatchlist\fP the list of matches 
.RE
.PP

.PP
Referenced by allMatches(), allWeightedMatches(), makeCompletion(), nextMatch(), previousMatch(), and substringCompletion().
.SS "void KCompletion::multipleMatches ()\fC [signal]\fP"
.PP
This signal is emitted, when calling \fBmakeCompletion()\fP and more than one matching item is found. 
.PP
\fBSee also:\fP
.RS 4
\fBhasMultipleMatches\fP 
.RE
.PP

.PP
Referenced by makeCompletion().
.SS "virtual void KCompletion::postProcessMatch (\fBQString\fP * match) const\fC [inline, protected, virtual]\fP"
.PP
This method is called after a completion is found and before the matching string is emitted. 
.PP
You can override this method to modify the string that will be emitted. This is necessary e.g. in KURLCompletion(), where files with spaces in their names are shown escaped ('filename\\ with\\ spaces'), but stored unescaped inside KCompletion. Never delete that pointer!
.PP
Default implementation does nothing. 
.PP
\fBParameters:\fP
.RS 4
\fImatch\fP the match to process 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBpostProcessMatches\fP 
.RE
.PP

.PP
Reimplemented in \fBKShellCompletion\fP, and \fBKURLCompletion\fP.
.PP
Definition at line 528 of file kcompletion.h.
.PP
Referenced by makeCompletion(), nextMatch(), previousMatch(), and substringCompletion().
.SS "virtual void KCompletion::postProcessMatches (\fBQStringList\fP * matches) const\fC [inline, protected, virtual]\fP"
.PP
This method is called before a list of all available completions is emitted via \fBmatches\fP. 
.PP
You can override this method to modify the found items before \fBmatch()\fP or \fBmatches\fP are emitted. Never delete that pointer!
.PP
Default implementation does nothing. 
.PP
\fBParameters:\fP
.RS 4
\fImatches\fP the matches to process 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBpostProcessMatch\fP 
.RE
.PP

.PP
Reimplemented in \fBKShellCompletion\fP, and \fBKURLCompletion\fP.
.PP
Definition at line 540 of file kcompletion.h.
.PP
Referenced by allMatches(), allWeightedMatches(), makeCompletion(), and substringCompletion().
.SS "virtual void KCompletion::postProcessMatches (\fBKCompletionMatches\fP * matches) const\fC [inline, protected, virtual]\fP"
.PP
This method is called before a list of all available completions is emitted via \fBmatches\fP. 
.PP
You can override this method to modify the found items before \fBmatch()\fP or \fBmatches()\fP are emitted. Never delete that pointer!
.PP
Default implementation does nothing. 
.PP
\fBParameters:\fP
.RS 4
\fImatches\fP the matches to process 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBpostProcessMatch\fP 
.RE
.PP

.PP
Reimplemented in \fBKShellCompletion\fP, and \fBKURLCompletion\fP.
.PP
Definition at line 552 of file kcompletion.h.

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