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

tdeio/tdefile

  • tdeio
  • tdefile
tdefiletreebranch.h
1
2/* This file is part of the KDE project
3 Copyright (C) 2000 David Faure <faure@kde.org>
4 2000 Carsten Pfeiffer <pfeiffer@kde.org>
5 2001 Klaas Freitag <freitag@suse.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 version 2 as published by the Free Software Foundation.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
20*/
21
22#ifndef TDEFILE_TREE_BRANCH_H
23#define TDEFILE_TREE_BRANCH_H
24
25#include <tqdict.h>
26#include <tqlistview.h>
27
28#include <tdefileitem.h>
29#include <tdeio/global.h>
30#include <kdirlister.h>
31#include <tdeio/job.h>
32#include <tdefiletreeviewitem.h>
33
34class KURL;
35class KFileTreeView;
36
37
48class TDEIO_EXPORT KFileTreeBranch : public KDirLister
49{
50 TQ_OBJECT
51public:
62 KFileTreeBranch( KFileTreeView*, const KURL& url, const TQString& name,
63 const TQPixmap& pix, bool showHidden = false,
64 KFileTreeViewItem *branchRoot = 0 );
65
69 KURL rootUrl() const { return( m_startURL ); }
70
77 virtual void setRoot( KFileTreeViewItem *r ){ m_root = r; };
78
82 KFileTreeViewItem *root( ) { return( m_root );}
83
87 TQString name() const { return( m_name ); }
88
92 virtual void setName( const TQString n ) { m_name = n; };
93
94 /*
95 * returns the current root item pixmap set in the constructor. The root
96 * item pixmap defaults to the icon for directories.
97 * @see openPixmap()
98 */
99 const TQPixmap& pixmap(){ return(m_rootIcon); }
100
101 /*
102 * returns the current root item pixmap set by setOpenPixmap()
103 * which is displayed if the branch is expanded.
104 * The root item pixmap defaults to the icon for directories.
105 * @see pixmap()
106 * Note that it depends on KFileTreeView::showFolderOpenPximap weather
107 * open pixmap are displayed or not.
108 */
109 const TQPixmap& openPixmap() { return(m_openRootIcon); }
110
115 bool showExtensions( ) const;
116
120 void setOpen( bool setopen = true )
121 { if( root() ) root()->setOpen( setopen ); }
122
131 void setChildRecurse( bool t=true );
132
137 bool childRecurse()
138 { return m_recurseChildren; }
139
140public slots:
147 virtual bool populate( const KURL &url, KFileTreeViewItem* currItem );
148
155 virtual void setShowExtensions( bool visible = true );
156
157 void setOpenPixmap( const TQPixmap& pix );
158
159protected:
164 virtual KFileTreeViewItem *createTreeViewItem( KFileTreeViewItem *parent,
165 KFileItem *fileItem );
166
167public:
171 virtual KFileTreeViewItem *findTVIByURL( const KURL& );
172
173signals:
177 void populateFinished( KFileTreeViewItem * );
178
184 void newTreeViewItems( KFileTreeBranch*, const KFileTreeViewItemList& );
185
189 void directoryChildCount( KFileTreeViewItem* item, int count );
190
191private slots:
192 void slotRefreshItems( const KFileItemList& );
193 void addItems( const KFileItemList& );
194 void slCompleted( const KURL& );
195 void slotCanceled( const KURL& );
196 void slotListerStarted( const KURL& );
197 void slotDeleteItem( KFileItem* );
198 void slotDirlisterClear();
199 void slotDirlisterClearURL( const KURL& url );
200 void slotRedirect( const KURL& oldUrl, const KURL&newUrl );
201
202private:
203 KFileTreeViewItem *parentKFTVItem( KFileItem *item );
204 static void deleteChildrenOf( TQListViewItem *parent );
205
206 KFileTreeViewItem *m_root;
207 KURL m_startURL;
208 TQString m_name;
209 TQPixmap m_rootIcon;
210 TQPixmap m_openRootIcon;
211
212 /* this list holds the url's which children are opened. */
213 KURL::List m_openChildrenURLs;
214
215
216 /* The next two members are used for caching purposes in findTVIByURL. */
217 KURL m_lastFoundURL;
218 KFileTreeViewItem *m_lastFoundItem;
219
220 bool m_recurseChildren :1;
221 bool m_showExtensions :1;
222
223protected:
224 virtual void virtual_hook( int id, void* data );
225private:
226 class KFileTreeBranchPrivate;
227 KFileTreeBranchPrivate *d;
228};
229
230
234typedef TQPtrList<KFileTreeBranch> KFileTreeBranchList;
235
239typedef TQPtrListIterator<KFileTreeBranch> KFileTreeBranchIterator;
240
241#endif
242
KFileTreeBranch
This is the branch class of the KFileTreeView, which represents one branch in the treeview.
Definition: tdefiletreebranch.h:49
KFileTreeBranch::newTreeViewItems
void newTreeViewItems(KFileTreeBranch *, const KFileTreeViewItemList &)
emitted with a list of new or updated KFileTreeViewItem which were found in a branch.
KFileTreeBranch::root
KFileTreeViewItem * root()
Definition: tdefiletreebranch.h:82
KFileTreeBranch::setName
virtual void setName(const TQString n)
sets the name of the branch.
Definition: tdefiletreebranch.h:92
KFileTreeBranch::setRoot
virtual void setRoot(KFileTreeViewItem *r)
sets a KFileTreeViewItem as root widget for the branch.
Definition: tdefiletreebranch.h:77
KFileTreeBranch::setOpen
void setOpen(bool setopen=true)
sets the root of the branch open or closed.
Definition: tdefiletreebranch.h:120
KFileTreeBranch::rootUrl
KURL rootUrl() const
Definition: tdefiletreebranch.h:69
KFileTreeBranch::childRecurse
bool childRecurse()
Definition: tdefiletreebranch.h:137
KFileTreeBranch::populateFinished
void populateFinished(KFileTreeViewItem *)
emitted with the item of a directory which was finished to populate
KFileTreeBranch::directoryChildCount
void directoryChildCount(KFileTreeViewItem *item, int count)
emitted with the exact count of children for a directory.
KFileTreeBranch::name
TQString name() const
Definition: tdefiletreebranch.h:87
KFileTreeViewItem
An item for a KFileTreeView that knows about its own KFileItem.
Definition: tdefiletreeviewitem.h:41
KFileTreeView
The filetreeview offers a treeview on the file system which behaves like a QTreeView showing files an...
Definition: tdefiletreeview.h:67

tdeio/tdefile

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

tdeio/tdefile

Skip menu "tdeio/tdefile"
  • 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/tdefile by doxygen 1.9.4
This website is maintained by Timothy Pearson.