00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef konq_treeitem_h
00021 #define konq_treeitem_h
00022
00023 #include <tqlistview.h>
00024 #include <tqstringlist.h>
00025 #include <kurl.h>
00026
00027 class TQPainter;
00028 class TQDragObject;
00029 class TQStrList;
00030 class KonqSidebarTree;
00031 class KonqSidebarTreeItem;
00032 class KonqSidebarTreeModule;
00033 class KonqSidebarTreeTopLevelItem;
00034
00040 class KonqSidebarTreeItem : public QListViewItem
00041 {
00042 public:
00043
00044 KonqSidebarTreeItem( KonqSidebarTreeItem *parentItem, KonqSidebarTreeTopLevelItem *topLevelItem );
00045
00046 void initItem( KonqSidebarTreeTopLevelItem *topLevelItem );
00047
00048 virtual ~KonqSidebarTreeItem();
00049
00050
00051 virtual bool acceptsDrops( const TQStrList & ) { return false; }
00052
00053
00054
00055 virtual void drop( TQDropEvent * ) {}
00056
00057
00058 virtual TQDragObject * dragObject( TQWidget * parent, bool move = false ) = 0;
00059
00060 virtual void middleButtonClicked();
00061 virtual void rightButtonPressed() = 0;
00062
00063 virtual void paste() {}
00064 virtual void trash() {}
00065 virtual void del() {}
00066 virtual void shred() {}
00067 virtual void rename() {}
00068 virtual void rename( const TQString& ) {}
00069
00070
00071 virtual KURL externalURL() const = 0;
00072
00073
00074
00075 virtual TQString externalMimeType() const { return TQString::null; }
00076
00077
00078 virtual TQString toolTipText() const { return TQString::null; }
00079
00080
00081
00082 virtual void itemSelected() = 0;
00083
00084
00085 void setListable( bool b ) { m_bListable = b; }
00086 bool isListable() const { return m_bListable; }
00087
00088
00089 void setClickable( bool b ) { m_bClickable = b; }
00090 bool isClickable() const { return m_bClickable; }
00091
00092
00093 virtual bool isTopLevelItem() const { return false; }
00094
00095 KonqSidebarTreeTopLevelItem * topLevelItem() const { return m_topLevelItem; }
00096
00097
00098 KonqSidebarTreeModule * module() const;
00099
00100
00101 KonqSidebarTree *tree() const;
00102
00103 virtual TQString key( int column, bool ) const { return text( column ).lower(); }
00104
00105
00106 TQStringList alias;
00107 protected:
00108
00109 KonqSidebarTreeItem( KonqSidebarTree *parent, KonqSidebarTreeTopLevelItem *topLevelItem );
00110
00111 KonqSidebarTreeTopLevelItem *m_topLevelItem;
00112 bool m_bListable:1;
00113 bool m_bClickable:1;
00114 };
00115
00116 #endif