.TH "KCompletion" 3 "28 Jan 2004" "kdecore Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KCompletion \- This class offers easy use of 'auto-completion', 'manual-completion' or 'shell completion' on \fBQString\fP objects. A generic class for completing QStrings.  

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

.in +1c
.ti -1c
.RI "enum \fBCompOrder\fP { \fBSorted\fP, \fBInsertion\fP, \fBWeighted\fP }"
.br
.RI "\fIConstants that represent the order in which KCompletion performs completion-lookups. \fP"
.in -1c
.SS "Public Slots"

.in +1c
.ti -1c
.RI "void \fBslotMakeCompletion\fP (const  \fBQString\fP &string)"
.br
.RI "\fIAttempts to complete 'string' and emits the completion via \fBmatch\fP(). \fP"
.ti -1c
.RI "void \fBslotPreviousMatch\fP ()"
.br
.RI "\fISearches the previous matching item and emits it via \fBmatch\fP(). \fP"
.ti -1c
.RI "void \fBslotNextMatch\fP ()"
.br
.RI "\fISearches the next matching item and emits it via \fBmatch\fP(). \fP"
.ti -1c
.RI "void \fBinsertItems\fP (const  \fBQStringList\fP &items)"
.br
.RI "\fIInserts \fCitems\fP into the list of possible completions. \fP"
.ti -1c
.RI "virtual void \fBsetItems\fP (const  \fBQStringList\fP &list)"
.br
.RI "\fISets the list of items available for completion. \fP"
.ti -1c
.RI "void \fBaddItem\fP (const  \fBQString\fP &item)"
.br
.RI "\fIAdds an item to the list of available completions. \fP"
.ti -1c
.RI "void \fBaddItem\fP (const  \fBQString\fP &item, uint weight)"
.br
.RI "\fIAdds an item to the list of available completions. \fP"
.ti -1c
.RI "void \fBremoveItem\fP (const  \fBQString\fP &item)"
.br
.RI "\fIRemoves an item from the list of available completions. \fP"
.ti -1c
.RI "virtual void \fBclear\fP ()"
.br
.RI "\fIRemoves all inserted items. \fP"
.in -1c
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBmatch\fP (const  \fBQString\fP &item)"
.br
.RI "\fIThe matching item. \fP"
.ti -1c
.RI "void \fBmatches\fP (const  \fBQStringList\fP &matchlist)"
.br
.RI "\fIAll matching items. \fP"
.ti -1c
.RI "void \fBmultipleMatches\fP ()"
.br
.RI "\fIThis signal is emitted, when calling \fBmakeCompletion\fP() and more than one matching item is found. \fP"
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKCompletion\fP ()"
.br
.RI "\fIConstructor, nothing special here :). \fP"
.ti -1c
.RI "virtual \fB~KCompletion\fP ()"
.br
.RI "\fIDestructor, nothing special here, either. \fP"
.ti -1c
.RI "virtual \fBQString\fP \fBmakeCompletion\fP (const  \fBQString\fP &string)"
.br
.RI "\fIAttempts to find an item in the list of available completions, that begins with \fCstring\fP. \fP"
.ti -1c
.RI "\fBQStringList\fP \fBsubstringCompletion\fP (const  \fBQString\fP &string) const "
.br
.RI "\fIReturns a list of all completion items that contain the given \fCstring\fP. \fP"
.ti -1c
.RI "\fBQString\fP \fBpreviousMatch\fP ()"
.br
.RI "\fIReturns the next item from the matching-items-list. \fP"
.ti -1c
.RI "\fBQString\fP \fBnextMatch\fP ()"
.br
.RI "\fIReturns the next item from the matching-items-list. \fP"
.ti -1c
.RI "virtual const  \fBQString\fP & \fBlastMatch\fP () const "
.br
.RI "\fIReturns the last match. \fP"
.ti -1c
.RI "\fBQStringList\fP \fBitems\fP () const "
.br
.RI "\fIReturns a list of all items inserted into KCompletion. \fP"
.ti -1c
.RI "virtual void \fBsetCompletionMode\fP (\fBKGlobalSettings::Completion\fP mode)"
.br
.RI "\fISets the completion mode to Auto/Manual, Shell or None. \fP"
.ti -1c
.RI "\fBKGlobalSettings::Completion\fP \fBcompletionMode\fP () const "
.br
.RI "\fIReturn the current completion mode. \fP"
.ti -1c
.RI "virtual void \fBsetOrder\fP (\fBCompOrder\fP order)"
.br
.RI "\fIKCompletion offers three different ways in which it offers its items: 
.IP "\(bu" 2
in the order of insertion 
.IP "\(bu" 2
sorted alphabetically 
.IP "\(bu" 2
weighted. 
.PP
\fP"
.ti -1c
.RI "\fBCompOrder\fP \fBorder\fP () const "
.br
.RI "\fIReturns the completion order. \fP"
.ti -1c
.RI "virtual void \fBsetIgnoreCase\fP (bool ignoreCase)"
.br
.RI "\fISetting this to true makes KCompletion behave case insensitively. \fP"
.ti -1c
.RI "bool \fBignoreCase\fP () const "
.br
.RI "\fIReturn whether KCompletion acts case insensitively or not. \fP"
.ti -1c
.RI "\fBQStringList\fP \fBallMatches\fP ()"
.br
.RI "\fIReturns a list of all items matching the last completed string. \fP"
.ti -1c
.RI "\fBQStringList\fP \fBallMatches\fP (const  \fBQString\fP &string)"
.br
.RI "\fIReturns a list of all items matching \fCstring\fP. \fP"
.ti -1c
.RI "\fBKCompletionMatches\fP \fBallWeightedMatches\fP ()"
.br
.RI "\fIReturns a list of all items matching the last completed string. \fP"
.ti -1c
.RI "\fBKCompletionMatches\fP \fBallWeightedMatches\fP (const  \fBQString\fP &string)"
.br
.RI "\fIReturns a list of all items matching \fCstring\fP. \fP"
.ti -1c
.RI "virtual void \fBsetEnableSounds\fP (bool enable)"
.br
.RI "\fIEnables/disables playing a sound when 
.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
\fP"
.ti -1c
.RI "bool \fBisSoundsEnabled\fP () const "
.br
.RI "\fITells you whether KCompletion will play sounds on certain occasions. \fP"
.ti -1c
.RI "bool \fBhasMultipleMatches\fP () const "
.br
.RI "\fIReturns true when more than one match is found. \fP"
.ti -1c
.RI "void \fBenableSounds\fP ()"
.br
.RI "\fI\fBThis class or method is obsolete, it is provided for compatibility only.\fP \fP"
.ti -1c
.RI "void \fBdisableSounds\fP ()"
.br
.RI "\fI\fBThis class or method is obsolete, it is provided for compatibility only.\fP \fP"
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual void \fBpostProcessMatch\fP (\fBQString\fP *match) const "
.br
.RI "\fIThis method is called after a completion is found and before the matching string is emitted. \fP"
.ti -1c
.RI "virtual void \fBpostProcessMatches\fP (\fBQStringList\fP *matches) const "
.br
.RI "\fIThis method is called before a list of all available completions is emitted via \fBmatches\fP. \fP"
.ti -1c
.RI "virtual void \fBpostProcessMatches\fP (\fBKCompletionMatches\fP *matches) const "
.br
.RI "\fIThis method is called before a list of all available completions is emitted via \fBmatches\fP. \fP"
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SH "Detailed Description"
.PP 
This class offers easy use of 'auto-completion', 'manual-completion' or 'shell completion' on \fBQString\fP objects. A generic class for completing QStrings. 

A common use is completing filenames or URLs (see \fBKURLCompletion\fP()). 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
.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
.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
.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
.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' );
.PP
.PP
.PP
.nf
 cout << completion.makeCompletion( 'ca' ).latin1() << endl;
 
.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 KURLCompletion does), but generally, this is not necessary.
.PP
\fBAuthor:\fP
.RS 4
Carsten Pfeiffer <pfeiffer@kde.org> 
.RE
.PP
\fBVersion:\fP
.RS 4
\fBId\fP.RS 4
\fBkcompletion.h\fP,v 1.65.2.1 2003/02/09 13:55:28 rnolden Exp 
.RE
.PP
.RE
.PP

.PP
Definition at line 130 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 143 of file kcompletion.h.
.PP
Referenced by order().
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KCompletion::KCompletion ()"
.PP
Constructor, nothing special here :). Definition at line 39 of file kcompletion.cpp.
.PP
References KGlobalSettings::completionMode(), Insertion, and setOrder().
.SS "KCompletion::~\fBKCompletion\fP ()\fC [virtual]\fP"
.PP
Destructor, nothing special here, either. Definition at line 52 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. 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
Definition at line 184 of file kcompletion.cpp.
.PP
References KStdAccel::completion(), KGlobalSettings::CompletionNone, KGlobalSettings::CompletionPopup, KGlobalSettings::CompletionPopupAuto, KGlobalSettings::CompletionShell, match(), matches(), multipleMatches(), postProcessMatch(), and postProcessMatches().
.PP
Referenced by slotMakeCompletion().
.SS "\fBQStringList\fP KCompletion::substringCompletion (const \fBQString\fP & string) const"
.PP
Returns a list of all completion items that contain the given \fCstring\fP. \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
Definition at line 246 of file kcompletion.cpp.
.PP
References QString::find(), QString::isEmpty(), matches(), postProcessMatch(), postProcessMatches(), and Weighted.
.SS "\fBQString\fP KCompletion::previousMatch ()"
.PP
Returns the next item from the matching-items-list. 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
Definition at line 374 of file kcompletion.cpp.
.PP
References KStdAccel::completion(), match(), matches(), and postProcessMatch().
.PP
Referenced by slotPreviousMatch().
.SS "\fBQString\fP KCompletion::nextMatch ()"
.PP
Returns the next item from the matching-items-list. 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
Definition at line 341 of file kcompletion.cpp.
.PP
References KStdAccel::completion(), match(), matches(), and postProcessMatch().
.PP
Referenced by slotNextMatch().
.SS "virtual const \fBQString\fP& KCompletion::lastMatch () const\fC [inline, virtual]\fP"
.PP
Returns the last match. 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
Definition at line 222 of file kcompletion.h.
.SS "\fBQStringList\fP KCompletion::items () const"
.PP
Returns a list of all items inserted into KCompletion. 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 \fBsetOrder\fP( \fBKCompletion::Insertion\fP ) 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
Definition at line 91 of file kcompletion.cpp.
.PP
References Weighted.
.SS "void KCompletion::setCompletionMode (\fBKGlobalSettings::Completion\fP mode)\fC [virtual]\fP"
.PP
Sets the completion mode to Auto/Manual, Shell or None. 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
Definition at line 285 of file kcompletion.cpp.
.SS "\fBKGlobalSettings::Completion\fP KCompletion::completionMode () const\fC [inline]\fP"
.PP
Return the current completion mode. 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
Definition at line 262 of file kcompletion.h.
.PP
References KGlobalSettings::Completion.
.SS "void KCompletion::setOrder (\fBCompOrder\fP order)\fC [virtual]\fP"
.PP
KCompletion offers three different ways in which it offers its items: 
.IP "\(bu" 2
in the order of insertion 
.IP "\(bu" 2
sorted alphabetically 
.IP "\(bu" 2
weighted. 
.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
Definition at line 58 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. \fBReturns:\fP
.RS 4
the current completion order. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetOrder\fP 
.RE
.PP
Definition at line 293 of file kcompletion.h.
.PP
References CompOrder.
.SS "void KCompletion::setIgnoreCase (bool ignoreCase)\fC [virtual]\fP"
.PP
Setting this to true makes KCompletion behave case insensitively. 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
Definition at line 64 of file kcompletion.cpp.
.SS "bool KCompletion::ignoreCase () const\fC [inline]\fP"
.PP
Return whether KCompletion acts case insensitively or not. 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
Definition at line 310 of file kcompletion.h.
.SS "\fBQStringList\fP KCompletion::allMatches ()"
.PP
Returns a list of all items matching the last completed string. 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
Definition at line 291 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. \fBParameters:\fP
.RS 4
\fIstring\fP the string to match 
.RE
.PP
\fBReturns:\fP
.RS 4
the list of all matches 
.RE
.PP
Definition at line 317 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. 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
Definition at line 304 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. \fBParameters:\fP
.RS 4
\fIstring\fP the string to match 
.RE
.PP
\fBReturns:\fP
.RS 4
a list of all matches 
.RE
.PP
Definition at line 327 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 
.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
For playing the sounds, \fBKNotifyClient\fP() is used.
.PP
\fBParameters:\fP
.RS 4
\fIenable\fP true to enable sounds 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBisSoundsEnabled\fP 
.RE
.PP
Definition at line 361 of file kcompletion.h.
.SS "bool KCompletion::isSoundsEnabled () const\fC [inline]\fP"
.PP
Tells you whether KCompletion will play sounds on certain occasions. 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
Definition at line 370 of file kcompletion.h.
.SS "bool KCompletion::hasMultipleMatches () const\fC [inline]\fP"
.PP
Returns true when more than one match is found. \fBReturns:\fP
.RS 4
true if there are more than one match 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBmultipleMatches\fP 
.RE
.PP
Definition at line 377 of file kcompletion.h.
.SS "void KCompletion::enableSounds ()\fC [inline]\fP"
.PP
\fBThis class or method is obsolete, it is provided for compatibility only.\fP \fBSee also:\fP
.RS 4
\fBsetEnableSounds\fP 
.RE
.PP
Definition at line 384 of file kcompletion.h.
.SS "void KCompletion::disableSounds ()\fC [inline]\fP"
.PP
\fBThis class or method is obsolete, it is provided for compatibility only.\fP \fBSee also:\fP
.RS 4
\fBsetEnableSounds\fP 
.RE
.PP
Definition at line 390 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(). 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
Definition at line 400 of file kcompletion.h.
.PP
References makeCompletion().
.SS "void KCompletion::slotPreviousMatch ()\fC [inline, slot]\fP"
.PP
Searches the previous matching item and emits it via \fBmatch\fP(). Same as \fBpreviousMatch\fP() (just as a slot). 
.PP
\fBSee also:\fP
.RS 4
\fBpreviousMatch\fP 
.RE
.PP
Definition at line 409 of file kcompletion.h.
.PP
References previousMatch().
.SS "void KCompletion::slotNextMatch ()\fC [inline, slot]\fP"
.PP
Searches the next matching item and emits it via \fBmatch\fP(). Same as \fBnextMatch\fP() (just as a slot). 
.PP
\fBSee also:\fP
.RS 4
\fBnextMatch\fP 
.RE
.PP
Definition at line 418 of file kcompletion.h.
.PP
References nextMatch().
.SS "void KCompletion::insertItems (const \fBQStringList\fP & items)\fC [slot]\fP"
.PP
Inserts \fCitems\fP into the list of possible completions. 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
Definition at line 76 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. 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
Definition at line 69 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. 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
Definition at line 101 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. 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
Definition at line 110 of file kcompletion.cpp.
.PP
References QString::at(), KCompTreeNode::confirm(), KCompTreeNode::insert(), QString::isEmpty(), QString::length(), Sorted, and Weighted.
.SS "void KCompletion::removeItem (const \fBQString\fP & item)\fC [slot]\fP"
.PP
Removes an item from the list of available completions. 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
Definition at line 163 of file kcompletion.cpp.
.PP
References KCompTreeNode::remove().
.SS "void KCompletion::clear ()\fC [virtual, slot]\fP"
.PP
Removes all inserted items. Definition at line 173 of file kcompletion.cpp.
.PP
Referenced by setItems().
.SS "void KCompletion::match (const \fBQString\fP & item)\fC [signal]\fP"
.PP
The matching item. 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
Referenced by makeCompletion(), nextMatch(), and previousMatch().
.SS "void KCompletion::matches (const \fBQStringList\fP & matchlist)\fC [signal]\fP"
.PP
All matching items. 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
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. \fBSee also:\fP
.RS 4
\fBhasMultipleMatches\fP 
.RE
.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. You can override this method to modify the string that will be emitted. This is necessary e.g. in \fBKURLCompletion\fP(), 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
Definition at line 519 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. 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
Definition at line 531 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. 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
Definition at line 543 of file kcompletion.h.

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