23 #ifndef KURLCOMPLETION_H
24 #define KURLCOMPLETION_H
26 #include <kcompletion.h>
27 #include <tdeio/jobclasses.h>
29 #include <tqstringlist.h>
32 class KURLCompletionPrivate;
53 enum Mode { ExeCompletion=1, FileCompletion, DirCompletion, SystemExeCompletion };
82 virtual TQString makeCompletion(
const TQString &text);
89 virtual void setDir(
const TQString &dir);
95 virtual TQString dir()
const;
101 virtual bool isRunning()
const;
112 virtual Mode mode()
const;
118 virtual void setMode( Mode mode );
126 virtual bool replaceEnv()
const;
133 virtual void setReplaceEnv(
bool replace );
141 virtual bool replaceHome()
const;
149 virtual void setReplaceHome(
bool replace );
160 TQString replacedPath(
const TQString& text );
166 static TQString replacedPath(
const TQString& text,
167 bool replaceHome,
bool replaceEnv =
true );
172 void postProcessMatch( TQString *match )
const;
173 void postProcessMatches( TQStringList *matches )
const;
174 void postProcessMatches( TDECompletionMatches* matches )
const;
176 virtual void customEvent( TQCustomEvent *e );
179 void slotEntries(
TDEIO::Job *,
const TDEIO::UDSEntryList& );
184 bool isAutoCompletion();
186 bool userCompletion(
const MyURL &url, TQString *match);
187 bool envCompletion(
const MyURL &url, TQString *match);
188 bool exeCompletion(
const MyURL &url, TQString *match);
189 bool systemexeCompletion(
const MyURL &url, TQString *match);
190 bool fileCompletion(
const MyURL &url, TQString *match);
191 bool urlCompletion(
const MyURL &url, TQString *match);
194 void listDir(
const TQString& dir,
195 TQStringList *matches,
196 const TQString& filter,
201 TQString listDirectories(
const TQStringList &,
203 bool only_exe =
false,
204 bool only_dir =
false,
205 bool no_hidden =
false,
206 bool stat_files =
true);
208 void listURLs(
const TQValueList<KURL *> &urls,
209 const TQString &filter = TQString::null,
210 bool only_exe =
false,
211 bool no_hidden =
false );
213 void addMatches(
const TQStringList & );
218 void setListedURL(
int compl_type ,
219 const TQString& dir = TQString::null,
220 const TQString& filter = TQString::null,
221 bool no_hidden =
false );
223 bool isListedURL(
int compl_type ,
224 const TQString& dir = TQString::null,
225 const TQString& filter = TQString::null,
226 bool no_hidden =
false );
228 void adjustMatch( TQString& match )
const;
231 virtual void virtual_hook(
int id,
void* data );
233 KURLCompletionPrivate *d;
This class does completion of URLs including user directories (~user) and environment variables.
Mode
Determines how completion is done.
The base class for all jobs.