KIO
kurlcompletion.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef KURLCOMPLETION_H
00024 #define KURLCOMPLETION_H
00025
00026 #include <kcompletion.h>
00027 #include <kio/jobclasses.h>
00028 #include <QtCore/QString>
00029
00030 class QStringList;
00031 class KUrl;
00032 class KUrlCompletionPrivate;
00033
00041 class KIO_EXPORT KUrlCompletion : public KCompletion
00042 {
00043 Q_OBJECT
00044
00045 public:
00053 enum Mode { ExeCompletion=1, FileCompletion, DirCompletion };
00054
00058 KUrlCompletion();
00063 KUrlCompletion(Mode);
00067 virtual ~KUrlCompletion();
00068
00082 virtual QString makeCompletion(const QString &text);
00083
00089 virtual void setDir(const QString &dir);
00090
00095 virtual QString dir() const;
00096
00101 virtual bool isRunning() const;
00102
00106 virtual void stop();
00107
00112 virtual Mode mode() const;
00113
00118 virtual void setMode( Mode mode );
00119
00126 virtual bool replaceEnv() const;
00127
00133 virtual void setReplaceEnv( bool replace );
00134
00141 virtual bool replaceHome() const;
00142
00149 virtual void setReplaceHome( bool replace );
00150
00160 QString replacedPath( const QString& text ) const;
00161
00165 static QString replacedPath( const QString& text,
00166 bool replaceHome, bool replaceEnv = true );
00167
00168 protected:
00169
00170 void postProcessMatch( QString *match ) const;
00171 void postProcessMatches( QStringList *matches ) const;
00172 void postProcessMatches( KCompletionMatches* matches ) const;
00173
00174 virtual void customEvent( QEvent *e );
00175
00176 private:
00177 KUrlCompletionPrivate* const d;
00178
00179 Q_PRIVATE_SLOT( d, void _k_slotEntries( KIO::Job*, const KIO::UDSEntryList& ) )
00180 Q_PRIVATE_SLOT( d, void _k_slotIOFinished( KJob* ) )
00181 };
00182
00183 #endif // KURLCOMPLETION_H