home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kfiletreeviewitem.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  2.5 KB  |  107 lines

  1. /* This file is part of the KDE project
  2.    Copyright (C) 2000 David Faure <faure@kde.org>
  3.                  2000 Carsten Pfeiffer <pfeiffer@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 version 2 as published by the Free Software Foundation.
  8.  
  9.    This library is distributed in the hope that it will be useful,
  10.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.    Library General Public License for more details.
  13.  
  14.    You should have received a copy of the GNU Library General Public License
  15.    along with this library; see the file COPYING.LIB.  If not, write to
  16.    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  17.    Boston, MA 02110-1301, USA.
  18. */
  19.  
  20. #ifndef kfile_tree_view_item_h
  21. #define kfile_tree_view_item_h
  22.  
  23. #include <qptrlist.h>
  24. #include <klistview.h>
  25.  
  26. #include <kfileitem.h>
  27. #include <kio/global.h>
  28. #include <kdirlister.h>
  29. #include <kio/job.h>
  30.  
  31. class KURL;
  32. class KFileTreeView;
  33. class KFileTreeBranch;
  34. class KFileTreeItem;
  35.  
  36.  
  37. /**
  38.  * An item for a KFileTreeView that knows about its own KFileItem.
  39.  */
  40. class KIO_EXPORT KFileTreeViewItem : public KListViewItem
  41. {
  42. public:
  43.    KFileTreeViewItem( KFileTreeViewItem*, KFileItem*, KFileTreeBranch * );
  44.    KFileTreeViewItem( KFileTreeView*, KFileItem*, KFileTreeBranch * );
  45.    ~KFileTreeViewItem();
  46.  
  47.    /**
  48.     * @return the KFileTreeBranch the item is sorted in.
  49.     */
  50.    KFileTreeBranch* branch() const     { return m_branch; }
  51.  
  52.    /**
  53.     * @return the KFileItem the viewitem is representing.
  54.     */
  55.    KFileItem *fileItem() const         { return m_kfileitem; }
  56.  
  57.    /**
  58.     * @return the path of the item.
  59.     */
  60.    QString path() const;
  61.  
  62.    /**
  63.     * @return the items KURL
  64.     */
  65.    KURL    url() const;
  66.  
  67.    /**
  68.     * @return if the item represents a directory
  69.     */
  70.    bool    isDir() const;
  71.  
  72.    /**
  73.     * @return if this directory was already seen by a KDirLister.
  74.     */
  75.    bool    alreadyListed() const;
  76.  
  77.    /**
  78.     * set the flag if the directory was already listed.
  79.     */
  80.    void    setListed( bool wasListed );
  81.  
  82. protected:
  83.  
  84. private:
  85.  
  86.    KFileItem *m_kfileitem;
  87.    KFileTreeBranch *m_branch;
  88.    bool  m_wasListed;
  89.    class KFileTreeViewItemPrivate;
  90.    KFileTreeViewItemPrivate *d;
  91. };
  92.  
  93.  
  94. /**
  95.  * List of KFileTreeViewItems
  96.  */
  97. typedef QPtrList<KFileTreeViewItem> KFileTreeViewItemList;
  98.  
  99. /**
  100.  * Iterator for KFileTreeViewItemList
  101.  */
  102. typedef QPtrListIterator<KFileTreeViewItem> KFileTreeViewItemListIterator;
  103.  
  104.  
  105. #endif
  106.  
  107.