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

tdeio/tdefile

tdefiletreebranch.h
00001 
00002 /* This file is part of the KDE project
00003    Copyright (C) 2000 David Faure <faure@kde.org>
00004                  2000 Carsten Pfeiffer <pfeiffer@kde.org>
00005                  2001 Klaas Freitag <freitag@suse.de>
00006 
00007    This library is free software; you can redistribute it and/or
00008    modify it under the terms of the GNU Library General Public
00009    License version 2 as published by the Free Software Foundation.
00010 
00011    This library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Library General Public License for more details.
00015 
00016    You should have received a copy of the GNU Library General Public License
00017    along with this library; see the file COPYING.LIB.  If not, write to
00018    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019    Boston, MA 02110-1301, USA.
00020 */
00021 
00022 #ifndef TDEFILE_TREE_BRANCH_H
00023 #define TDEFILE_TREE_BRANCH_H
00024 
00025 #include <tqdict.h>
00026 #include <tqlistview.h>
00027 
00028 #include <tdefileitem.h>
00029 #include <tdeio/global.h>
00030 #include <kdirlister.h>
00031 #include <tdeio/job.h>
00032 #include <tdefiletreeviewitem.h>
00033 
00034 class KURL;
00035 class KFileTreeView;
00036 
00037 
00048 class TDEIO_EXPORT KFileTreeBranch : public KDirLister
00049 {
00050    Q_OBJECT
00051 public:
00062    KFileTreeBranch( KFileTreeView*, const KURL& url, const TQString& name,
00063                     const TQPixmap& pix, bool showHidden = false,
00064             KFileTreeViewItem *branchRoot = 0 );
00065 
00069    KURL     rootUrl() const { return( m_startURL ); }
00070 
00077    virtual void     setRoot( KFileTreeViewItem *r ){ m_root = r; };
00078 
00082    KFileTreeViewItem *root( ) { return( m_root );}
00083 
00087    TQString      name() const { return( m_name ); }
00088 
00092    virtual void         setName( const TQString n ) { m_name = n; };
00093 
00094    /*
00095     * returns the current root item pixmap set in the constructor. The root
00096     * item pixmap defaults to the icon for directories.
00097     * @see openPixmap()
00098     */
00099    const TQPixmap& pixmap(){ return(m_rootIcon); }
00100 
00101    /*
00102     * returns the current root item pixmap set by setOpenPixmap()
00103     * which is displayed if the branch is expanded.
00104     * The root item pixmap defaults to the icon for directories.
00105     * @see pixmap()
00106     * Note that it depends on KFileTreeView::showFolderOpenPximap weather
00107     * open pixmap are displayed or not.
00108     */
00109    const TQPixmap& openPixmap() { return(m_openRootIcon); }
00110 
00115    bool showExtensions( ) const;
00116 
00120    void setOpen( bool setopen = true )
00121       { if( root() ) root()->setOpen( setopen ); }
00122 
00131    void setChildRecurse( bool t=true );
00132 
00137    bool childRecurse()
00138       { return m_recurseChildren; }
00139 
00140 public slots:
00147    virtual bool populate( const KURL &url, KFileTreeViewItem* currItem );
00148 
00155    virtual void setShowExtensions( bool visible = true );
00156 
00157    void setOpenPixmap( const TQPixmap& pix );
00158 
00159 protected:
00164    virtual KFileTreeViewItem *createTreeViewItem( KFileTreeViewItem *parent,
00165                           KFileItem *fileItem );
00166 
00167 public:
00171    virtual KFileTreeViewItem *findTVIByURL( const KURL& );
00172 
00173 signals:
00177    void populateFinished( KFileTreeViewItem * );
00178 
00184    void newTreeViewItems( KFileTreeBranch*, const KFileTreeViewItemList& );
00185 
00189    void directoryChildCount( KFileTreeViewItem* item, int count );
00190 
00191 private slots:
00192    void slotRefreshItems( const KFileItemList& );
00193    void addItems( const KFileItemList& );
00194    void slCompleted( const KURL& );
00195    void slotCanceled( const KURL& );
00196    void slotListerStarted( const KURL& );
00197    void slotDeleteItem( KFileItem* );
00198    void slotDirlisterClear();
00199    void slotDirlisterClearURL( const KURL& url );
00200    void slotRedirect( const KURL& oldUrl, const KURL&newUrl );
00201 
00202 private:
00203    KFileTreeViewItem    *parentKFTVItem( KFileItem *item );
00204    static void           deleteChildrenOf( TQListViewItem *parent );
00205 
00206    KFileTreeViewItem    *m_root;
00207    KURL         m_startURL;
00208    TQString         m_name;
00209    TQPixmap         m_rootIcon;
00210    TQPixmap              m_openRootIcon;
00211 
00212    /* this list holds the url's which children are opened. */
00213    KURL::List           m_openChildrenURLs;
00214 
00215 
00216    /* The next two members are used for caching purposes in findTVIByURL. */
00217    KURL                 m_lastFoundURL;
00218    KFileTreeViewItem   *m_lastFoundItem;
00219 
00220    bool                 m_recurseChildren :1;
00221    bool                 m_showExtensions  :1;
00222 
00223 protected:
00224    virtual void virtual_hook( int id, void* data );
00225 private:
00226    class KFileTreeBranchPrivate;
00227    KFileTreeBranchPrivate *d;
00228 };
00229 
00230 
00234 typedef TQPtrList<KFileTreeBranch> KFileTreeBranchList;
00235 
00239 typedef TQPtrListIterator<KFileTreeBranch> KFileTreeBranchIterator;
00240 
00241 #endif
00242 

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.7.6.1
This website is maintained by Timothy Pearson.