.TH "KURLCompletion" kde3 "11 Jun 2005" "Version Version 3.4.1" "kio Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KURLCompletion \- This class does completion of URLs including user directories (~user) and environment variables. Completion of a single URL.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kurlcompletion.h>\fP
.PP
Inherits \fBKCompletion\fP.
.PP
Inherited by \fBKShellCompletion\fP.
.PP
.SS "Public Types"

.in +1c
.ti -1c
.RI "enum \fBMode\fP { \fBExeCompletion\fP = 1, \fBFileCompletion\fP, \fBDirCompletion\fP }"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKURLCompletion\fP ()"
.br
.ti -1c
.RI "\fBKURLCompletion\fP (\fBMode\fP)"
.br
.ti -1c
.RI "virtual \fB~KURLCompletion\fP ()"
.br
.ti -1c
.RI "virtual \fBQString\fP \fBmakeCompletion\fP (const \fBQString\fP &text)"
.br
.ti -1c
.RI "virtual void \fBsetDir\fP (const \fBQString\fP &dir)"
.br
.ti -1c
.RI "virtual \fBQString\fP \fBdir\fP () const "
.br
.ti -1c
.RI "virtual bool \fBisRunning\fP () const "
.br
.ti -1c
.RI "virtual void \fBstop\fP ()"
.br
.ti -1c
.RI "virtual \fBMode\fP \fBmode\fP () const "
.br
.ti -1c
.RI "virtual void \fBsetMode\fP (\fBMode\fP mode)"
.br
.ti -1c
.RI "virtual bool \fBreplaceEnv\fP () const "
.br
.ti -1c
.RI "virtual void \fBsetReplaceEnv\fP (bool replace)"
.br
.ti -1c
.RI "virtual bool \fBreplaceHome\fP () const "
.br
.ti -1c
.RI "virtual void \fBsetReplaceHome\fP (bool replace)"
.br
.ti -1c
.RI "\fBQString\fP \fBreplacedPath\fP (const \fBQString\fP &text)"
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static \fBQString\fP \fBreplacedPath\fP (const \fBQString\fP &text, bool replaceHome, bool replaceEnv=true)"
.br
.in -1c
.SS "Protected Slots"

.in +1c
.ti -1c
.RI "void \fBslotEntries\fP (\fBKIO::Job\fP *, const \fBKIO::UDSEntryList\fP &)"
.br
.ti -1c
.RI "void \fBslotIOFinished\fP (\fBKIO::Job\fP *)"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "void \fBpostProcessMatch\fP (\fBQString\fP *\fBmatch\fP) const "
.br
.ti -1c
.RI "void \fBpostProcessMatches\fP (\fBQStringList\fP *\fBmatches\fP) const "
.br
.ti -1c
.RI "void \fBpostProcessMatches\fP (\fBKCompletionMatches\fP *\fBmatches\fP) const "
.br
.ti -1c
.RI "virtual void \fBcustomEvent\fP (\fBQCustomEvent\fP *e)"
.br
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SH "Detailed Description"
.PP 
This class does completion of URLs including user directories (~user) and environment variables. Completion of a single URL. 

Remote URLs are passed to \fBKIO\fP.
.PP
\fBAuthor:\fP
.RS 4
David Smith <dsmith@algonet.se> 
.RE
.PP

.PP
Definition at line 41 of file kurlcompletion.h.
.SH "Member Enumeration Documentation"
.PP 
.SS "enum \fBKURLCompletion::Mode\fP"
.PP
Determines how completion is done. 
.PP
.PD 0
.IP "\(bu" 2
ExeCompletion - executables in $PATH or with full path. 
.IP "\(bu" 2
FileCompletion - all files with full path or in \fBdir()\fP, URLs are listed using \fBKIO\fP. 
.IP "\(bu" 2
DirCompletion - Same as FileCompletion but only returns directories.
.PP

.PP
Definition at line 53 of file kurlcompletion.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KURLCompletion::KURLCompletion ()"
.PP
Constructs a KURLCompletion object in FileCompletion mode. 
.PP

.PP
Definition at line 478 of file kurlcompletion.cpp.
.SS "KURLCompletion::KURLCompletion (\fBMode\fP)"
.PP
This overloaded constructor allows you to set the Mode to ExeCompletion or FileCompletion without using setMode. 
.PP
Default is FileCompletion.
.PP
Definition at line 484 of file kurlcompletion.cpp.
.PP
References setMode().
.SS "KURLCompletion::~\fBKURLCompletion\fP ()\fC [virtual]\fP"
.PP
Destructs the KURLCompletion object. 
.PP

.PP
Definition at line 490 of file kurlcompletion.cpp.
.PP
References stop().
.SH "Member Function Documentation"
.PP 
.SS "\fBQString\fP KURLCompletion::makeCompletion (const \fBQString\fP & text)\fC [virtual]\fP"
.PP
Finds completions to the given text. 
.PP
Remote URLs are listed with \fBKIO\fP. For performance reasons, local files are listed with \fBKIO\fP only if KURLCOMPLETION_LOCAL_KIO is set. The completion is done asyncronously if \fBKIO\fP is used.
.PP
Returns the first match for user, environment, and local dir completion and QString::null for asynchronous completion (\fBKIO\fP or threaded).
.PP
\fBParameters:\fP
.RS 4
\fItext\fP the text to complete 
.RE
.PP
\fBReturns:\fP
.RS 4
the first match, or QString::null if not found
.RE
.PP

.PP
Reimplemented from \fBKCompletion\fP.
.PP
Reimplemented in \fBKShellCompletion\fP.
.PP
Definition at line 564 of file kurlcompletion.cpp.
.PP
References QString::left(), QString::length(), QString::prepend(), QString::ref(), and stop().
.PP
Referenced by KShellCompletion::makeCompletion().
.SS "void KURLCompletion::setDir (const \fBQString\fP & dir)\fC [virtual]\fP"
.PP
Sets the current directory (used as base for completion). 
.PP
Default = $HOME. 
.PP
\fBParameters:\fP
.RS 4
\fIdir\fP the current directory, either as a path or URL
.RE
.PP

.PP
Definition at line 519 of file kurlcompletion.cpp.
.PP
Referenced by KFileDialog::init().
.SS "\fBQString\fP KURLCompletion::dir () const\fC [virtual]\fP"
.PP
Returns the current directory, as it was given in setDir. 
.PP
\fBReturns:\fP
.RS 4
the current directory (path or URL)
.RE
.PP

.PP
Definition at line 524 of file kurlcompletion.cpp.
.SS "bool KURLCompletion::isRunning () const\fC [virtual]\fP"
.PP
Check whether asynchronous completion is in progress. 
.PP
\fBReturns:\fP
.RS 4
true if asynchronous completion is in progress
.RE
.PP

.PP
Definition at line 650 of file kurlcompletion.cpp.
.SS "void KURLCompletion::stop ()\fC [virtual]\fP"
.PP
Stops asynchronous completion. 
.PP

.PP
Definition at line 660 of file kurlcompletion.cpp.
.PP
References QString::isEmpty().
.PP
Referenced by makeCompletion(), and ~KURLCompletion().
.SS "\fBKURLCompletion::Mode\fP KURLCompletion::mode () const\fC [virtual]\fP"
.PP
Returns the completion mode: exe or file completion (default FileCompletion). 
.PP
\fBReturns:\fP
.RS 4
the completion mode
.RE
.PP

.PP
Definition at line 529 of file kurlcompletion.cpp.
.SS "void KURLCompletion::setMode (\fBMode\fP mode)\fC [virtual]\fP"
.PP
Changes the completion mode: exe or file completion. 
.PP
\fBParameters:\fP
.RS 4
\fImode\fP the new completion mode
.RE
.PP

.PP
Definition at line 534 of file kurlcompletion.cpp.
.PP
Referenced by KDirSelectDialog::KDirSelectDialog(), KURLCompletion(), and KShellCompletion::makeCompletion().
.SS "bool KURLCompletion::replaceEnv () const\fC [virtual]\fP"
.PP
Checks whether environment variables are completed and whether they are replaced internally while finding completions. 
.PP
Default is enabled. 
.PP
\fBReturns:\fP
.RS 4
true if environment vvariables will be replaced
.RE
.PP

.PP
Definition at line 539 of file kurlcompletion.cpp.
.SS "void KURLCompletion::setReplaceEnv (bool replace)\fC [virtual]\fP"
.PP
Enables/disables completion and replacement (internally) of environment variables in URLs. 
.PP
Default is enabled. 
.PP
\fBParameters:\fP
.RS 4
\fIreplace\fP true to replace environment variables
.RE
.PP

.PP
Definition at line 544 of file kurlcompletion.cpp.
.SS "bool KURLCompletion::replaceHome () const\fC [virtual]\fP"
.PP
Returns whether ~username is completed and whether ~username is replaced internally with the user's home directory while finding completions. 
.PP
Default is enabled. 
.PP
\fBReturns:\fP
.RS 4
true to replace tilde with the home directory
.RE
.PP

.PP
Definition at line 549 of file kurlcompletion.cpp.
.SS "void KURLCompletion::setReplaceHome (bool replace)\fC [virtual]\fP"
.PP
Enables/disables completion of ~username and replacement (internally) of ~username with the user's home directory. 
.PP
Default is enabled. 
.PP
\fBParameters:\fP
.RS 4
\fIreplace\fP true to replace tilde with the home directory
.RE
.PP

.PP
Definition at line 554 of file kurlcompletion.cpp.
.SS "\fBQString\fP KURLCompletion::replacedPath (const \fBQString\fP & text)"
.PP
Replaces username and/or environment variables, depending on the current settings and returns the filtered url. 
.PP
Only works with local files, i.e. returns back the original string for non-local urls. 
.PP
\fBParameters:\fP
.RS 4
\fItext\fP the text to process 
.RE
.PP
\fBReturns:\fP
.RS 4
the path or URL resulting from this operation. If you want to convert it to a \fBKURL\fP, use \fBKURL::fromPathOrURL\fP.
.RE
.PP

.PP
Definition at line 1365 of file kurlcompletion.cpp.

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