00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef _KHLISTVIEW_H_
00012 #define _KHLISTVIEW_H_
00013
00014 #include <tqtimer.h>
00015
00016 #include <klistview.h>
00017 #include <kdemacros.h>
00018
00019 namespace KHotKeys
00020 {
00021
00022 class KDE_EXPORT KHListView
00023 : public KListView
00024 {
00025 Q_OBJECT
00026 Q_PROPERTY( bool forceSelect READ forceSelect WRITE setForceSelect )
00027 public:
00028 KHListView( TQWidget* parent_P, const char* name_P = NULL );
00029 virtual void clear();
00030 virtual void insertItem( TQListViewItem* item_P );
00031 virtual void clearSelection();
00032 bool forceSelect() const;
00033 void setForceSelect( bool force_P );
00034 signals:
00035 void current_changed( TQListViewItem* item_P );
00036 protected:
00037 virtual void contentsDropEvent (TQDropEvent*);
00038 private slots:
00039 void slot_selection_changed( TQListViewItem* item_P );
00040 void slot_selection_changed();
00041 void slot_current_changed( TQListViewItem* item_P );
00042 void slot_insert_select();
00043 private:
00044 TQListViewItem* saved_current_item;
00045 bool in_clear;
00046 bool ignore;
00047 bool force_select;
00048 TQTimer insert_select_timer;
00049 };
00050
00051
00052
00053
00054
00055 inline
00056 void KHListView::setForceSelect( bool force_P )
00057 {
00058 force_select = force_P;
00059 }
00060
00061 inline
00062 bool KHListView::forceSelect() const
00063 {
00064 return force_select;
00065 }
00066
00067 }
00068
00069 #endif