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

tdeio/tdeio

  • tdeio
  • tdeio
kdirlister.h
1 /* This file is part of the KDE project
2  Copyright (C) 1999 David Faure <faure@kde.org>
3  2001, 2002, 2004, 2005 Michael Brade <brade@kde.org>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 
21 #ifndef kdirlister_h
22 #define kdirlister_h
23 
24 #include "tdefileitem.h"
25 #include "kdirnotify.h"
26 
27 #include <tqstring.h>
28 #include <tqstringlist.h>
29 
30 #include <kurl.h>
31 
32 namespace TDEIO { class Job; class LocalURLJob; class ListJob; }
33 
55 class TDEIO_EXPORT KDirLister : public TQObject
56 {
57  class KDirListerPrivate;
58  friend class KDirListerPrivate;
59  friend class KDirListerCache;
60 
61  TQ_OBJECT
62  TQ_PROPERTY( bool autoUpdate READ autoUpdate WRITE setAutoUpdate )
63  TQ_PROPERTY( bool showingDotFiles READ showingDotFiles WRITE setShowingDotFiles )
64  TQ_PROPERTY( bool dirOnlyMode READ dirOnlyMode WRITE setDirOnlyMode )
65  TQ_PROPERTY( bool autoErrorHandlingEnabled READ autoErrorHandlingEnabled )
66  TQ_PROPERTY( TQString nameFilter READ nameFilter WRITE setNameFilter )
67  TQ_PROPERTY( TQStringList mimeFilter READ mimeFilters WRITE setMimeFilter RESET clearMimeFilter )
68 
69 public:
75  KDirLister( bool _delayedMimeTypes = false );
76 
80  virtual ~KDirLister();
81 
105  virtual bool openURL( const KURL& _url, bool _keep = false, bool _reload = false );
106 
114  virtual void stop();
115 
125  virtual void stop( const KURL& _url );
126 
132  bool autoUpdate() const;
133 
139  virtual void setAutoUpdate( bool enable );
140 
148  bool autoErrorHandlingEnabled() const;
149 
159  void setAutoErrorHandlingEnabled( bool enable, TQWidget *parent );
160 
168  bool showingDotFiles() const;
169 
178  virtual void setShowingDotFiles( bool _showDotFiles );
179 
186  bool dirOnlyMode() const;
187 
193  virtual void setDirOnlyMode( bool dirsOnly );
194 
203  const KURL& url() const;
204 
214  const KURL::List& directories() const;
215 
220  virtual void emitChanges();
221 
233  virtual void updateDirectory( const KURL& _dir );
234 
239  bool isFinished() const;
240 
245  KFileItem *rootItem() const;
246 
252  virtual KFileItem *findByURL( const KURL& _url ) const;
253 #ifndef KDE_NO_COMPAT
254  KFileItem *find( const KURL& _url ) const;
255 #endif
256 
262  virtual KFileItem *findByName( const TQString& name ) const;
263 
274  virtual void setNameFilter( const TQString &filter );
275 
281  const TQString& nameFilter() const;
282 
294  virtual void setMimeFilter( const TQStringList &mimeList );
295 
311  void setMimeExcludeFilter(const TQStringList &mimeList );
312 
313 
319  virtual void clearMimeFilter();
320 
325  const TQStringList& mimeFilters() const;
326 
333  bool matchesFilter( const TQString& name ) const;
334 
342  bool matchesMimeFilter( const TQString& mime ) const;
343 
350  void setMainWindow( TQWidget *window );
351 
357  TQWidget *mainWindow();
358 
363  enum WhichItems
364  {
365  AllItems = 0,
366  FilteredItems = 1
367  };
368 
386  KFileItemList items( WhichItems which = FilteredItems ) const;
387 
408  KFileItemList itemsForDir( const KURL& dir,
409  WhichItems which = FilteredItems ) const;
410 
411 signals:
421  void started( const KURL& _url );
422 
426  void completed();
427 
433  void completed( const KURL& _url );
434 
438  void canceled();
439 
445  void canceled( const KURL& _url );
446 
453  void redirection( const KURL& _url );
454 
460  void redirection( const KURL& oldUrl, const KURL& newUrl );
461 
466  void clear();
467 
473  void clear( const KURL& _url );
474 
479  void newItems( const KFileItemList& items );
480 
485  void itemsFilteredByMime( const KFileItemList& items );
486 
496  void deleteItem( KFileItem *_fileItem );
497 
503  void refreshItems( const KFileItemList& items );
504 
510  void infoMessage( const TQString& msg );
511 
517  void percent( int percent );
518 
523  void totalSize( TDEIO::filesize_t size );
524 
529  void processedSize( TDEIO::filesize_t size );
530 
535  void speed( int bytes_per_second );
536 
537 protected:
538  enum Changes {
539  NONE=0, NAME_FILTER=1, MIME_FILTER=2, DOT_FILES=4, DIR_ONLY_MODE=8
540  };
541 
554  virtual bool matchesFilter( const KFileItem * ) const;
555 
568  virtual bool matchesMimeFilter( const KFileItem * ) const;
569 
577  virtual bool doNameFilter( const TQString& name, const TQPtrList<TQRegExp>& filters ) const;
578 
586  virtual bool doMimeFilter( const TQString& mime, const TQStringList& filters ) const;
587 
591  bool doMimeExcludeFilter( const TQString& mimeExclude, const TQStringList& filters ) const;
592 
598  virtual bool validURL( const KURL& ) const;
599 
601  virtual void handleError( TDEIO::Job * );
602 
603 protected:
604  virtual void virtual_hook( int id, void *data );
605 
606 private slots:
607  void slotInfoMessage( TDEIO::Job *, const TQString& );
608  void slotPercent( TDEIO::Job *, unsigned long );
609  void slotTotalSize( TDEIO::Job *, TDEIO::filesize_t );
610  void slotProcessedSize( TDEIO::Job *, TDEIO::filesize_t );
611  void slotSpeed( TDEIO::Job *, unsigned long );
612  void slotOpenURLGotLocalURL( TDEIO::LocalURLJob*, const KURL&, bool );
613  void slotLocalURLKIODestroyed( );
614 
615 private:
616  void jobStarted( TDEIO::ListJob * );
617  void connectJob( TDEIO::ListJob * );
618  void jobDone( TDEIO::ListJob * );
619 
620  uint numJobs();
621 
622 public:
623  void emitCompleted( const KURL& _url );
624 
625 private:
626  virtual void addNewItem( const KFileItem *item );
627  virtual void addNewItems( const KFileItemList& items );
628  /*virtual*/ void aboutToRefreshItem( const KFileItem *item ); // TODO: KDE 4.0 make virtual
629  virtual void addRefreshItem( const KFileItem *item );
630  virtual void emitItems();
631  virtual void emitDeleteItem( KFileItem *item );
632 
633  KDirListerPrivate *d;
634 };
635 
636 #endif
637 
KDirLister
The dir lister deals with the tdeiojob used to list and update a directory and has signals for the us...
Definition: kdirlister.h:56
KDirLister::newItems
void newItems(const KFileItemList &items)
Signal new items.
KDirLister::speed
void speed(int bytes_per_second)
Emitted to display information about the speed of the jobs.
KDirLister::canceled
void canceled()
Tell the view that the user canceled the listing.
KDirLister::completed
void completed()
Tell the view that listing is finished.
KDirLister::deleteItem
void deleteItem(KFileItem *_fileItem)
Signal an item to remove.
KDirLister::canceled
void canceled(const KURL &_url)
Tell the view that the listing of the directory _url was canceled.
KDirLister::processedSize
void processedSize(TDEIO::filesize_t size)
Regularly emitted to show the progress of this KDirLister.
KDirLister::refreshItems
void refreshItems(const KFileItemList &items)
Signal an item to refresh (its mimetype/icon/name has changed).
KDirLister::clear
void clear()
Signal to clear all items.
KDirLister::completed
void completed(const KURL &_url)
Tell the view that the listing of the directory _url is finished.
KDirLister::started
void started(const KURL &_url)
Tell the view that we started to list url.
KDirLister::totalSize
void totalSize(TDEIO::filesize_t size)
Emitted when we know the size of the jobs.
KDirLister::itemsFilteredByMime
void itemsFilteredByMime(const KFileItemList &items)
Send a list of items filtered-out by mime-type.
KDirLister::redirection
void redirection(const KURL &oldUrl, const KURL &newUrl)
Signal a redirection.
KDirLister::WhichItems
WhichItems
Used by items() and itemsForDir() to specify whether you want all items for a directory or just the f...
Definition: kdirlister.h:364
KDirLister::percent
void percent(int percent)
Progress signal showing the overall progress of the KDirLister.
KDirLister::clear
void clear(const KURL &_url)
Signal to empty the directory _url.
KDirLister::infoMessage
void infoMessage(const TQString &msg)
Emitted to display information about running jobs.
KDirLister::redirection
void redirection(const KURL &_url)
Signal a redirection.
KFileItem
A KFileItem is a generic class to handle a file, local or remote.
Definition: tdefileitem.h:42
TDEIO::Job
The base class for all jobs.
Definition: jobclasses.h:67
TDEIO::ListJob
A ListJob is allows you to get the get the content of a directory.
Definition: jobclasses.h:1391
TDEIO::LocalURLJob
A TDEIO job that finds a local URL.
Definition: jobclasses.h:1865
TDEIO
A namespace for TDEIO globals.
Definition: authinfo.h:29
TDEIO::filesize_t
TQ_ULLONG filesize_t
64-bit file size
Definition: global.h:39

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
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/tdeio by doxygen 1.9.1
This website is maintained by Timothy Pearson.