• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeio/tdeio
 

tdeio/tdeio

  • tdeio
  • tdeio
kurlcompletion.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 2000 David Smith <dsmith@algonet.se>
3 
4  This class was inspired by a previous KURLCompletion by
5  Henner Zeller <zeller@think.de>
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Library General Public
9  License as published by the Free Software Foundation; either
10  version 2 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Library General Public License for more details.
16 
17  You should have received a copy of the GNU Library General Public License
18  along with this library; see the file COPYING.LIB. If not, write to
19  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  Boston, MA 02110-1301, USA.
21 */
22 
23 #ifndef KURLCOMPLETION_H
24 #define KURLCOMPLETION_H
25 
26 #include <kcompletion.h>
27 #include <tdeio/jobclasses.h>
28 #include <tqstring.h>
29 #include <tqstringlist.h>
30 
31 class KURL;
32 class KURLCompletionPrivate;
33 
41 class TDEIO_EXPORT KURLCompletion : public TDECompletion
42 {
43  Q_OBJECT
44 
45 public:
53  enum Mode { ExeCompletion=1, FileCompletion, DirCompletion, SystemExeCompletion };
54 
58  KURLCompletion();
63  KURLCompletion(Mode);
67  virtual ~KURLCompletion();
68 
82  virtual TQString makeCompletion(const TQString &text); // KDE4: remove return value, it's often null due to threading
83 
89  virtual void setDir(const TQString &dir);
90 
95  virtual TQString dir() const;
96 
101  virtual bool isRunning() const;
102 
106  virtual void stop();
107 
112  virtual Mode mode() const;
113 
118  virtual void setMode( Mode mode );
119 
126  virtual bool replaceEnv() const;
127 
133  virtual void setReplaceEnv( bool replace );
134 
141  virtual bool replaceHome() const;
142 
149  virtual void setReplaceHome( bool replace );
150 
160  TQString replacedPath( const TQString& text );
161 
166  static TQString replacedPath( const TQString& text,
167  bool replaceHome, bool replaceEnv = true );
168 
169  class MyURL;
170 protected:
171  // Called by TDECompletion, adds '/' to directories
172  void postProcessMatch( TQString *match ) const;
173  void postProcessMatches( TQStringList *matches ) const;
174  void postProcessMatches( TDECompletionMatches* matches ) const;
175 
176  virtual void customEvent( TQCustomEvent *e );
177 
178 protected slots:
179  void slotEntries( TDEIO::Job *, const TDEIO::UDSEntryList& );
180  void slotIOFinished( TDEIO::Job * );
181 
182 private:
183 
184  bool isAutoCompletion();
185 
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);
192 
193  // List a directory using readdir()
194  void listDir( const TQString& dir,
195  TQStringList *matches,
196  const TQString& filter,
197  bool only_exe,
198  bool no_hidden );
199 
200  // List the next dir in m_dirs
201  TQString listDirectories(const TQStringList &,
202  const TQString &,
203  bool only_exe = false,
204  bool only_dir = false,
205  bool no_hidden = false,
206  bool stat_files = true);
207 
208  void listURLs( const TQValueList<KURL *> &urls,
209  const TQString &filter = TQString::null,
210  bool only_exe = false,
211  bool no_hidden = false );
212 
213  void addMatches( const TQStringList & );
214  TQString finished();
215 
216  void init();
217 
218  void setListedURL(int compl_type /* enum ComplType */,
219  const TQString& dir = TQString::null,
220  const TQString& filter = TQString::null,
221  bool no_hidden = false );
222 
223  bool isListedURL( int compl_type /* enum ComplType */,
224  const TQString& dir = TQString::null,
225  const TQString& filter = TQString::null,
226  bool no_hidden = false );
227 
228  void adjustMatch( TQString& match ) const;
229 
230 protected:
231  virtual void virtual_hook( int id, void* data );
232 private:
233  KURLCompletionPrivate *d;
234 };
235 
236 #endif // KURLCOMPLETION_H
KURLCompletion
This class does completion of URLs including user directories (~user) and environment variables...
Definition: kurlcompletion.h:41
KURLCompletion::Mode
Mode
Determines how completion is done.
Definition: kurlcompletion.h:53
TDEIO::Job
The base class for all jobs.
Definition: jobclasses.h:67

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/tdeio by doxygen 1.8.8
This website is maintained by Timothy Pearson.