KDE3Support
kfiletreebranch.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 #ifndef kfile_tree_branch_h
00023 #define kfile_tree_branch_h
00024
00025 class QColorGroup;
00026
00027 #include <Qt3Support/Q3ListView>
00028
00029 #include <kfileitem.h>
00030 #include <kio/global.h>
00031 #include <kdirlister.h>
00032 #include <kio/job.h>
00033 #include <k3filetreeviewitem.h>
00034
00035 class KUrl;
00036 class K3FileTreeView;
00037
00038
00049 class KDE3SUPPORT_EXPORT KFileTreeBranch : public KDirLister
00050 {
00051 Q_OBJECT
00052 public:
00063 KFileTreeBranch( K3FileTreeView*, const KUrl& url, const QString& name,
00064 const QPixmap& pix, bool showHidden = false,
00065 K3FileTreeViewItem *branchRoot = 0 );
00066
00070 KUrl rootUrl() const;
00071
00078 virtual void setRoot( K3FileTreeViewItem *r );
00079
00083 K3FileTreeViewItem *root( );
00084
00088 QString name() const;
00089
00093 virtual void setName( const QString n );
00094
00095
00096
00097
00098
00099
00100 QPixmap pixmap() const;
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110 QPixmap openPixmap() const;
00111
00116 bool showExtensions( ) const;
00117
00121 void setOpen( bool setopen = true );
00122
00131 void setChildRecurse( bool t=true );
00132
00137 bool childRecurse();
00138
00139 public Q_SLOTS:
00146 virtual bool populate( const KUrl &url, K3FileTreeViewItem* currItem );
00147
00154 virtual void setShowExtensions( bool visible = true );
00155
00156 void setOpenPixmap( const QPixmap& pix );
00157
00158 protected:
00163 virtual K3FileTreeViewItem *createTreeViewItem( K3FileTreeViewItem *parent,
00164 const KFileItem &fileItem );
00165
00166 public:
00170 virtual K3FileTreeViewItem *findTVIByUrl( const KUrl& );
00171
00172 Q_SIGNALS:
00176 void populateFinished( K3FileTreeViewItem * );
00177
00183 void newTreeViewItems( KFileTreeBranch*, const K3FileTreeViewItemList& );
00184
00188 void directoryChildCount( K3FileTreeViewItem* item, int count );
00189
00190 private Q_SLOTS:
00191 void slotRefreshItems( const QList<QPair<KFileItem, KFileItem> >& );
00192 void addItems( const KFileItemList& );
00193 void slCompleted( const KUrl& );
00194 void slotCanceled( const KUrl& );
00195 void slotListerStarted( const KUrl& );
00196 void slotDeleteItem( const KFileItem& );
00197 void slotDirlisterClear();
00198 void slotDirlisterClearUrl( const KUrl& url );
00199 void slotRedirect( const KUrl& oldUrl, const KUrl&newUrl );
00200
00201 private:
00202 K3FileTreeViewItem *parentKFTVItem( const KFileItem &item );
00203 static void deleteChildrenOf( Q3ListViewItem *parent );
00204 K3FileTreeViewItem* treeItemForFileItem(const KFileItem &it);
00205
00206 K3FileTreeViewItem *m_root;
00207 KUrl m_startURL;
00208 QString m_name;
00209 QPixmap m_rootIcon;
00210 QPixmap m_openRootIcon;
00211
00212
00213 KUrl::List m_openChildrenURLs;
00214
00215
00216
00217 KUrl m_lastFoundURL;
00218 K3FileTreeViewItem *m_lastFoundItem;
00219
00220 bool m_recurseChildren :1;
00221 bool m_showExtensions :1;
00222
00223 private:
00224 class KFileTreeBranchPrivate;
00225 KFileTreeBranchPrivate *d;
00226 };
00227
00228
00232 typedef Q3PtrList<KFileTreeBranch> KFileTreeBranchList;
00233
00237 typedef Q3PtrListIterator<KFileTreeBranch> KFileTreeBranchIterator;
00238
00239 #endif
00240