00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KWIDGETLIST_H
00023 #define KWIDGETLIST_H
00024
00025 #include <tqscrollview.h>
00026
00027 class KWidgetListItem;
00028
00029 class KWidgetList : public TQScrollView
00030 {
00031 Q_OBJECT
00032
00033
00034 public:
00035 KWidgetList( TQWidget *parent = 0, const char *name = 0 );
00036 ~KWidgetList();
00037
00038 uint count() const;
00039
00040 void appendItem( KWidgetListItem *item );
00041 void removeItem( int index );
00042 void takeItem( KWidgetListItem *item );
00043
00044 void setSelected( KWidgetListItem *item );
00045 void setSelected( int index );
00046
00047 bool isSelected( KWidgetListItem *item ) const;
00048 bool isSelected( int index ) const;
00049
00050 KWidgetListItem *selectedItem() const;
00051 KWidgetListItem *item( int index ) const;
00052
00053 int index( KWidgetListItem *item ) const;
00054
00055 virtual bool eventFilter( TQObject *object, TQEvent *event );
00056
00057 public slots:
00058 void clear();
00059 virtual void setFocus();
00060
00061 signals:
00062 void selectionChanged( KWidgetListItem *item );
00063 void doubleClicked( KWidgetListItem *item );
00064
00065 private:
00066 class Private;
00067 Private *d;
00068 };
00069
00070 class KWidgetListItem : public TQWidget
00071 {
00072 public:
00073 KWidgetListItem( KWidgetList *parent, const char *name = 0 );
00074 ~KWidgetListItem();
00075
00076 void setSelected( bool selected );
00077
00078 protected:
00079 void setForegroundColor( const TQColor& );
00080 void setBackgroundColor( const TQColor& );
00081 void setSelectionForegroundColor( const TQColor& );
00082 void setSelectionBackgroundColor( const TQColor& );
00083
00084 private:
00085 TQColor mForegroundColor;
00086 TQColor mBackgroundColor;
00087 TQColor mSelectionForegroundColor;
00088 TQColor mSelectionBackgroundColor;
00089 };
00090
00091 #endif