• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDE3Support

  • sources
  • kde-4.14
  • kdelibs
  • kde3support
  • kio
  • kfile
kfiletreebranch.h
Go to the documentation of this file.
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 kfile_tree_branch_h
23 #define kfile_tree_branch_h
24 
25 class QColorGroup;
26 
27 #include <Qt3Support/Q3ListView>
28 
29 #include <kfileitem.h>
30 #include <kio/global.h>
31 #include <kdirlister.h>
32 #include <kio/job.h>
33 #include <k3filetreeviewitem.h>
34 
35 class KUrl;
36 class K3FileTreeView;
37 
38 
49 class KDE3SUPPORT_EXPORT KFileTreeBranch : public KDirLister
50 {
51  Q_OBJECT
52 public:
63  KFileTreeBranch( K3FileTreeView*, const KUrl& url, const QString& name,
64  const QPixmap& pix, bool showHidden = false,
65  K3FileTreeViewItem *branchRoot = 0 );
66 
70  KUrl rootUrl() const;
71 
78  virtual void setRoot( K3FileTreeViewItem *r );
79 
83  K3FileTreeViewItem *root( );
84 
88  QString name() const;
89 
93  virtual void setName( const QString n );
94 
95  /*
96  * returns the current root item pixmap set in the constructor. The root
97  * item pixmap defaults to the icon for directories.
98  * @see openPixmap()
99  */
100  QPixmap pixmap() const;
101 
102  /*
103  * returns the current root item pixmap set by setOpenPixmap()
104  * which is displayed if the branch is expanded.
105  * The root item pixmap defaults to the icon for directories.
106  * @see pixmap()
107  * Note that it depends on K3FileTreeView::showFolderOpenPximap weather
108  * open pixmap are displayed or not.
109  */
110  QPixmap openPixmap() const;
111 
116  bool showExtensions( ) const;
117 
121  void setOpen( bool setopen = true );
122 
131  void setChildRecurse( bool t=true );
132 
137  bool childRecurse();
138 
139 public Q_SLOTS:
146  virtual bool populate( const KUrl &url, K3FileTreeViewItem* currItem );
147 
154  virtual void setShowExtensions( bool visible = true );
155 
156  void setOpenPixmap( const QPixmap& pix );
157 
158 protected:
163  virtual K3FileTreeViewItem *createTreeViewItem( K3FileTreeViewItem *parent,
164  const KFileItem &fileItem );
165 
166 public:
170  virtual K3FileTreeViewItem *findTVIByUrl( const KUrl& );
171 
172 Q_SIGNALS:
176  void populateFinished( K3FileTreeViewItem * );
177 
183  void newTreeViewItems( KFileTreeBranch*, const K3FileTreeViewItemList& );
184 
188  void directoryChildCount( K3FileTreeViewItem* item, int count );
189 
190 private Q_SLOTS:
191  void slotRefreshItems( const QList<QPair<KFileItem, KFileItem> >& );
192  void addItems( const KFileItemList& );
193  void slCompleted( const KUrl& );
194  void slotCanceled( const KUrl& );
195  void slotListerStarted( const KUrl& );
196  void slotDeleteItem( const KFileItem& );
197  void slotDirlisterClear();
198  void slotDirlisterClearUrl( const KUrl& url );
199  void slotRedirect( const KUrl& oldUrl, const KUrl&newUrl );
200 
201 private:
202  K3FileTreeViewItem *parentKFTVItem( const KFileItem &item );
203  static void deleteChildrenOf( Q3ListViewItem *parent );
204  K3FileTreeViewItem* treeItemForFileItem(const KFileItem &it);
205 
206  K3FileTreeViewItem *m_root;
207  KUrl m_startURL;
208  QString m_name;
209  QPixmap m_rootIcon;
210  QPixmap 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  K3FileTreeViewItem *m_lastFoundItem;
219 
220  bool m_recurseChildren :1;
221  bool m_showExtensions :1;
222 
223 private:
224  class KFileTreeBranchPrivate;
225  KFileTreeBranchPrivate *d;
226 };
227 
228 
232 typedef Q3PtrList<KFileTreeBranch> KFileTreeBranchList;
233 
237 typedef Q3PtrListIterator<KFileTreeBranch> KFileTreeBranchIterator;
238 
239 #endif
240 
kdirlister.h
KFileTreeBranch
This is the branch class of the K3FileTreeView, which represents one branch in the treeview...
Definition: kfiletreebranch.h:49
name
const char * name(StandardAction id)
Q3PtrList
global.h
KUrl
QObject::name
const char * name() const
Q3ListViewItem
k3filetreeviewitem.h
KFileItemList
QString
QList
QColorGroup
QPair
QPixmap
Q3PtrListIterator
QObject::setName
void setName(const char *name)
KFileTreeBranchList
Q3PtrList< KFileTreeBranch > KFileTreeBranchList
List of KFileTreeBranches.
Definition: kfiletreebranch.h:232
job.h
KFileTreeBranchIterator
Q3PtrListIterator< KFileTreeBranch > KFileTreeBranchIterator
Iterator for KFileTreeBranchLists.
Definition: kfiletreebranch.h:237
KUrl::List
K3FileTreeViewItem
An item for a K3FileTreeView that knows about its own KFileItem.
Definition: k3filetreeviewitem.h:41
K3FileTreeView
The filetreeview offers a treeview on the file system which behaves like a QTreeView showing files an...
Definition: k3filetreeview.h:53
KDirLister
kfileitem.h
KFileItem
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:26:48 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDE3Support

Skip menu "KDE3Support"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal