\section{KURLCompletion Class Reference}
\label{classKURLCompletion}\index{KURLCompletion@{KURLCompletion}}
This class does completion of URLs including user directories ($\sim$user) and environment variables. Completion of a single URL.  


{\tt \#include $<$kurlcompletion.h$>$}

Inheritance diagram for KURLCompletion:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=69pt]{classKURLCompletion__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KURLCompletion:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=69pt]{classKURLCompletion__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{CompactItemize}
\item 
enum {\bf Mode} \{ {\bf Exe\-Completion} = 1, 
{\bf File\-Completion}, 
{\bf Dir\-Completion}
 \}
\begin{CompactList}\small\item\em Determines how completion is done. \item\end{CompactList}\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KURLCompletion} ()
\begin{CompactList}\small\item\em Constructs a KURLCompletion object in File\-Completion mode. \item\end{CompactList}\item 
{\bf KURLCompletion} ({\bf Mode})
\begin{CompactList}\small\item\em This overloaded constructor allows you to set the Mode to Exe\-Completion or File\-Completion without using {\bf set\-Mode}{\rm (p.\,\pageref{classKURLCompletion_a9})}. \item\end{CompactList}\item 
virtual {\bf $\sim$KURLCompletion} ()
\begin{CompactList}\small\item\em Destructs the KURLCompletion object. \item\end{CompactList}\item 
virtual {\bf QString} {\bf make\-Completion} (const  {\bf QString} \&)
\begin{CompactList}\small\item\em Finds completions to the given text. \item\end{CompactList}\item 
virtual void {\bf set\-Dir} (const  {\bf QString} \&dir)
\begin{CompactList}\small\item\em Sets the current directory (used as base for completion) Default = \$HOME. \item\end{CompactList}\item 
virtual {\bf QString} {\bf dir} () const 
\begin{CompactList}\small\item\em Returns the current directory. \item\end{CompactList}\item 
virtual bool {\bf is\-Running} () const 
\begin{CompactList}\small\item\em Returns true if asyncronous completion is in progress. \item\end{CompactList}\item 
virtual void {\bf stop} ()
\begin{CompactList}\small\item\em Stops asyncronous completion. \item\end{CompactList}\item 
virtual {\bf Mode} {\bf mode} () const 
\begin{CompactList}\small\item\em Returns the completion mode: exe or file completion (default File\-Completion). \item\end{CompactList}\item 
virtual void {\bf set\-Mode} ({\bf Mode} mode)
\begin{CompactList}\small\item\em Changes the completion mode: exe or file completion. \item\end{CompactList}\item 
virtual bool {\bf replace\-Env} () const 
\begin{CompactList}\small\item\em Returns whether environment variables are completed and whether they are replaced internally while finding completions. \item\end{CompactList}\item 
virtual void {\bf set\-Replace\-Env} (bool replace)
\begin{CompactList}\small\item\em Enables/disables completion and replacement (internally) of environment variables in URLs. \item\end{CompactList}\item 
virtual bool {\bf replace\-Home} () const 
\begin{CompactList}\small\item\em Returns whether $\sim$username is completed and whether $\sim$username is replaced internally with the user's home directory while finding completions. \item\end{CompactList}\item 
virtual void {\bf set\-Replace\-Home} (bool replace)
\begin{CompactList}\small\item\em Enables/disables completion of $\sim$username and replacement (internally) of $\sim$username with the user's home directory. \item\end{CompactList}\item 
{\bf QString} {\bf replaced\-Path} (const  {\bf QString} \&text)
\begin{CompactList}\small\item\em Replaces username and/or environment variables, depending on the current settings and returns the filtered url. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Slots}
\begin{CompactItemize}
\item 
void {\bf slot\-Entries} ({\bf KIO::Job} $\ast$, const  {\bf KIO::UDSEntry\-List} \&)\label{classKURLCompletion_j0}

\item 
void {\bf slot\-IOFinished} ({\bf KIO::Job} $\ast$)\label{classKURLCompletion_j1}

\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
void {\bf post\-Process\-Match} ({\bf QString} $\ast${\bf match}) const \label{classKURLCompletion_b0}

\item 
void {\bf post\-Process\-Matches} ({\bf QString\-List} $\ast${\bf matches}) const \label{classKURLCompletion_b1}

\item 
void {\bf post\-Process\-Matches} ({\bf KCompletion\-Matches} $\ast${\bf matches}) const \label{classKURLCompletion_b2}

\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKURLCompletion_b3}

\end{CompactItemize}


\subsection{Detailed Description}
This class does completion of URLs including user directories ($\sim$user) and environment variables. Completion of a single URL. 

Remote URLs are passed to {\bf KIO}{\rm (p.\,\pageref{namespaceKIO})}.

\begin{Desc}
\item[Author:]David Smith $<${\tt dsmith@algonet.se}$>$ \end{Desc}
\begin{Desc}
\item[Version:]\begin{Desc}
\item[Id]{\bf kurlcompletion.h}{\rm (p.\,\pageref{kurlcompletion_8h})},v 1.28 2002/06/19 17:46:01 domi Exp \end{Desc}
\end{Desc}




Definition at line 42 of file kurlcompletion.h.

\subsection{Member Enumeration Documentation}
\index{KURLCompletion@{KURLCompletion}!Mode@{Mode}}
\index{Mode@{Mode}!KURLCompletion@{KURLCompletion}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum {\bf KURLCompletion::Mode}}\label{classKURLCompletion_w3}


Determines how completion is done. 

\begin{itemize}
\item Exe\-Completion - executables in \$PATH or with full path. \item File\-Completion - all files with full path or in {\bf dir()}{\rm (p.\,\pageref{classKURLCompletion_a5})}, URLs are listed using {\bf KIO}{\rm (p.\,\pageref{namespaceKIO})}. \item Dir\-Completion - as File\-Completion but only returns directories.\end{itemize}


Definition at line 54 of file kurlcompletion.h.

Referenced by KShell\-Completion::make\-Completion(), and mode().

\subsection{Constructor \& Destructor Documentation}
\index{KURLCompletion@{KURLCompletion}!KURLCompletion@{KURLCompletion}}
\index{KURLCompletion@{KURLCompletion}!KURLCompletion@{KURLCompletion}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KURLCompletion::KURLCompletion ()}\label{classKURLCompletion_a0}


Constructs a KURLCompletion object in File\-Completion mode. 



Definition at line 475 of file kurlcompletion.cpp.\index{KURLCompletion@{KURLCompletion}!KURLCompletion@{KURLCompletion}}
\index{KURLCompletion@{KURLCompletion}!KURLCompletion@{KURLCompletion}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KURLCompletion::KURLCompletion ({\bf Mode})}\label{classKURLCompletion_a1}


This overloaded constructor allows you to set the Mode to Exe\-Completion or File\-Completion without using {\bf set\-Mode}{\rm (p.\,\pageref{classKURLCompletion_a9})}. 

Default is File\-Completion

Definition at line 481 of file kurlcompletion.cpp.

References mode().\index{KURLCompletion@{KURLCompletion}!~KURLCompletion@{$\sim$KURLCompletion}}
\index{~KURLCompletion@{$\sim$KURLCompletion}!KURLCompletion@{KURLCompletion}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KURLCompletion::$\sim${\bf KURLCompletion} ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKURLCompletion_a2}


Destructs the KURLCompletion object. 



Definition at line 486 of file kurlcompletion.cpp.

References stop().

\subsection{Member Function Documentation}
\index{KURLCompletion@{KURLCompletion}!makeCompletion@{makeCompletion}}
\index{makeCompletion@{makeCompletion}!KURLCompletion@{KURLCompletion}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KURLCompletion::make\-Completion (const {\bf QString} \&)\hspace{0.3cm}{\tt  [virtual]}}\label{classKURLCompletion_a3}


Finds completions to the given text. 

Remote URLs are listed with {\bf KIO}{\rm (p.\,\pageref{namespaceKIO})}. For performance reasons, local files are listed with {\bf KIO}{\rm (p.\,\pageref{namespaceKIO})} only if KURLCOMPLETION\_\-LOCAL\_\-KIO is set. The completion is done asyncronously if {\bf KIO}{\rm (p.\,\pageref{namespaceKIO})} is used.

Returns the first match for user, environment, and local dir completion and QString::null for asyncronous completion ({\bf KIO}{\rm (p.\,\pageref{namespaceKIO})}).

Reimplemented from {\bf KCompletion}.

Reimplemented in {\bf KShell\-Completion} {\rm (p.\,\pageref{classKShellCompletion_a1})}.

Definition at line 560 of file kurlcompletion.cpp.

References KCompletion::match(), and stop().

Referenced by KShell\-Completion::make\-Completion().\index{KURLCompletion@{KURLCompletion}!setDir@{setDir}}
\index{setDir@{setDir}!KURLCompletion@{KURLCompletion}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURLCompletion::set\-Dir (const {\bf QString} \& {\em dir})\hspace{0.3cm}{\tt  [virtual]}}\label{classKURLCompletion_a4}


Sets the current directory (used as base for completion) Default = \$HOME. 



Definition at line 515 of file kurlcompletion.cpp.\index{KURLCompletion@{KURLCompletion}!dir@{dir}}
\index{dir@{dir}!KURLCompletion@{KURLCompletion}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KURLCompletion::dir () const\hspace{0.3cm}{\tt  [virtual]}}\label{classKURLCompletion_a5}


Returns the current directory. 



Definition at line 520 of file kurlcompletion.cpp.\index{KURLCompletion@{KURLCompletion}!isRunning@{isRunning}}
\index{isRunning@{isRunning}!KURLCompletion@{KURLCompletion}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KURLCompletion::is\-Running () const\hspace{0.3cm}{\tt  [virtual]}}\label{classKURLCompletion_a6}


Returns true if asyncronous completion is in progress. 



Definition at line 639 of file kurlcompletion.cpp.\index{KURLCompletion@{KURLCompletion}!stop@{stop}}
\index{stop@{stop}!KURLCompletion@{KURLCompletion}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURLCompletion::stop ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKURLCompletion_a7}


Stops asyncronous completion. 



Definition at line 650 of file kurlcompletion.cpp.

Referenced by make\-Completion(), and $\sim$KURLCompletion().\index{KURLCompletion@{KURLCompletion}!mode@{mode}}
\index{mode@{mode}!KURLCompletion@{KURLCompletion}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KURLCompletion::Mode} KURLCompletion::mode () const\hspace{0.3cm}{\tt  [virtual]}}\label{classKURLCompletion_a8}


Returns the completion mode: exe or file completion (default File\-Completion). 



Definition at line 525 of file kurlcompletion.cpp.

References Mode.

Referenced by KURLCompletion(), and KShell\-Completion::make\-Completion().\index{KURLCompletion@{KURLCompletion}!setMode@{setMode}}
\index{setMode@{setMode}!KURLCompletion@{KURLCompletion}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURLCompletion::set\-Mode ({\bf Mode} {\em mode})\hspace{0.3cm}{\tt  [virtual]}}\label{classKURLCompletion_a9}


Changes the completion mode: exe or file completion. 



Definition at line 530 of file kurlcompletion.cpp.

Referenced by KDir\-Select\-Dialog::KDir\-Select\-Dialog(), KShell\-Completion::make\-Completion(), and KURLRequester::set\-Mode().\index{KURLCompletion@{KURLCompletion}!replaceEnv@{replaceEnv}}
\index{replaceEnv@{replaceEnv}!KURLCompletion@{KURLCompletion}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KURLCompletion::replace\-Env () const\hspace{0.3cm}{\tt  [virtual]}}\label{classKURLCompletion_a10}


Returns whether environment variables are completed and whether they are replaced internally while finding completions. 

Default is enabled.

Definition at line 535 of file kurlcompletion.cpp.\index{KURLCompletion@{KURLCompletion}!setReplaceEnv@{setReplaceEnv}}
\index{setReplaceEnv@{setReplaceEnv}!KURLCompletion@{KURLCompletion}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURLCompletion::set\-Replace\-Env (bool {\em replace})\hspace{0.3cm}{\tt  [virtual]}}\label{classKURLCompletion_a11}


Enables/disables completion and replacement (internally) of environment variables in URLs. 

Default is enabled.

Definition at line 540 of file kurlcompletion.cpp.

References KStd\-Accel::replace().\index{KURLCompletion@{KURLCompletion}!replaceHome@{replaceHome}}
\index{replaceHome@{replaceHome}!KURLCompletion@{KURLCompletion}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KURLCompletion::replace\-Home () const\hspace{0.3cm}{\tt  [virtual]}}\label{classKURLCompletion_a12}


Returns whether $\sim$username is completed and whether $\sim$username is replaced internally with the user's home directory while finding completions. 

Default is enabled.

Definition at line 545 of file kurlcompletion.cpp.\index{KURLCompletion@{KURLCompletion}!setReplaceHome@{setReplaceHome}}
\index{setReplaceHome@{setReplaceHome}!KURLCompletion@{KURLCompletion}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURLCompletion::set\-Replace\-Home (bool {\em replace})\hspace{0.3cm}{\tt  [virtual]}}\label{classKURLCompletion_a13}


Enables/disables completion of $\sim$username and replacement (internally) of $\sim$username with the user's home directory. 

Default is enabled.

Definition at line 550 of file kurlcompletion.cpp.

References KStd\-Accel::replace().\index{KURLCompletion@{KURLCompletion}!replacedPath@{replacedPath}}
\index{replacedPath@{replacedPath}!KURLCompletion@{KURLCompletion}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KURLCompletion::replaced\-Path (const {\bf QString} \& {\em text})}\label{classKURLCompletion_a14}


Replaces username and/or environment variables, depending on the current settings and returns the filtered url. 

Only works with local files, i.e. returns back the original string for non-local urls.

Definition at line 1342 of file kurlcompletion.cpp.

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kurlcompletion.h\item 
kurlcompletion.cpp\end{CompactItemize}
