kitchensync
kwidgetlist.h00001
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 <qscrollview.h>
00026
00027 class KWidgetListItem;
00028
00029 class KWidgetList : public QScrollView
00030 {
00031 Q_OBJECT
00032
00033 public:
00034 KWidgetList( QWidget *parent = 0, const char *name = 0 );
00035 ~KWidgetList();
00036
00037 uint count() const;
00038
00039 void appendItem( KWidgetListItem *item );
00040 void removeItem( int index );
00041 void takeItem( KWidgetListItem *item );
00042
00043 void setSelected( KWidgetListItem *item );
00044 void setSelected( int index );
00045
00046 bool isSelected( KWidgetListItem *item ) const;
00047 bool isSelected( int index ) const;
00048
00049 KWidgetListItem *selectedItem() const;
00050 KWidgetListItem *item( int index ) const;
00051
00052 int index( KWidgetListItem *item ) const;
00053
00054 virtual bool eventFilter( QObject *object, QEvent *event );
00055
00056 public slots:
00057 void clear();
00058 virtual void setFocus();
00059
00060 signals:
00061 void selectionChanged( KWidgetListItem *item );
00062 void doubleClicked( KWidgetListItem *item );
00063
00064 private:
00065 class Private;
00066 Private *d;
00067 };
00068
00069 class KWidgetListItem : public QWidget
00070 {
00071 public:
00072 KWidgetListItem( KWidgetList *parent, const char *name = 0 );
00073 ~KWidgetListItem();
00074
00075 void setSelected( bool selected );
00076
00077 protected:
00078 void setForegroundColor( const QColor& );
00079 void setBackgroundColor( const QColor& );
00080 void setSelectionForegroundColor( const QColor& );
00081 void setSelectionBackgroundColor( const QColor& );
00082
00083 private:
00084 QColor mForegroundColor;
00085 QColor mBackgroundColor;
00086 QColor mSelectionForegroundColor;
00087 QColor mSelectionBackgroundColor;
00088 };
00089
00090 #endif
|