author | mickeyl <mickeyl> | 2004-03-05 21:36:58 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-03-05 21:36:58 (UTC) |
commit | b9d58b616102970872129b5bc2f55569910f5c03 (patch) (side-by-side diff) | |
tree | 593b40cce6f3da75593c90bff337b9b9c5092f7e /libopie2/opieui/olistview.h | |
parent | 4a18103940564be8585af8121203561e16f0a32c (diff) | |
download | opie-b9d58b616102970872129b5bc2f55569910f5c03.zip opie-b9d58b616102970872129b5bc2f55569910f5c03.tar.gz opie-b9d58b616102970872129b5bc2f55569910f5c03.tar.bz2 |
add OCheckListItem
change my email address
-rw-r--r-- | libopie2/opieui/olistview.h | 71 |
1 files changed, 63 insertions, 8 deletions
diff --git a/libopie2/opieui/olistview.h b/libopie2/opieui/olistview.h index a00b43a..59b0973 100644 --- a/libopie2/opieui/olistview.h +++ b/libopie2/opieui/olistview.h @@ -1,10 +1,9 @@ /* This file is part of the Opie Project - - =. (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> + =. (C) 2003-2004 Michael 'Mickey' Lauer <mickey@vanille.de> .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software @@ -48,13 +47,13 @@ class OListViewItem; * @brief A list/tree widget. * * A @ref QListView variant featuring visual and functional enhancements * like an alternate background for odd rows, an autostretch mode * for the width of the widget ( >= Qt 3 only ) and persistence capabilities. * - * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> + * @author Michael 'Mickey' Lauer <mickey@vanille.de> */ class OListView: public QListView { public: /** * Constructor. @@ -119,17 +118,27 @@ class OListView: public QListView /** * Serialize this object from a @ref QDataStream @a stream */ virtual void serializeFrom( QDataStream& s ); #endif -protected slots: - /** + public slots: + /** + * Expand all items + */ + void expand(); + /** + * Collapse all items + */ + void collapse(); + + protected slots: + /** * expand the current OListViewItem */ - void expand(QListViewItem*); + void expand(QListViewItem*); private: QColor m_alternateBackground; bool m_fullWidth; QPen m_columnSeparator; }; @@ -150,12 +159,13 @@ QDataStream& operator>>( QDataStream& stream, OListView& listview ); /*====================================================================================== * OListViewItem *======================================================================================*/ class OListViewItem: public QListViewItem { + friend class OCheckListItem; public: /** * Constructors. */ OListViewItem( QListView * parent ); OListViewItem( QListViewItem * parent ); @@ -247,24 +257,69 @@ QDataStream& operator<<( QDataStream& stream, const OListViewItem& item ); * @relates QListViewItem * Reads listview @a item from @a stream and returns a reference to the stream. */ QDataStream& operator>>( QDataStream& stream, OListViewItem& item ); #endif // QT_NO_DATASTREAM + +/*====================================================================================== + * OCheckListItem + *======================================================================================*/ + +class OCheckListItem : public QCheckListItem +{ + public: + + OCheckListItem( QCheckListItem *parent, const QString &text, + Type = Controller ); + OCheckListItem( QListViewItem *parent, const QString &text, + Type = Controller ); + OCheckListItem( QListView *parent, const QString &text, + Type = Controller ); + OCheckListItem( QListViewItem *parent, const QString &text, + const QPixmap & ); + OCheckListItem( QListView *parent, const QString &text, + const QPixmap & ); + ~OCheckListItem(); + /** + * @returns the background color of the list item. + */ + const QColor& backgroundColor(); + /** + * @returns true, if the item is at an odd position and + * thus have to be painted with the alternate background color. + */ + bool isAlternate(); + /** + * @note: Reimplemented for internal purposes - the API is not affected + * + */ + void paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int alignment ); + /** + * Perform object initialization. + */ + void init(); + + private: + bool m_known; + bool m_odd; +}; + + /*====================================================================================== * ONamedListView *======================================================================================*/ class ONamedListViewItem; /** * @brief An OListView variant with named columns. * * This class provides a higher-level interface to an OListView. * - * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> + * @author Michael 'Mickey' Lauer <mickey@vanille.de> */ class ONamedListView: public OListView { public: /** * Constructor. @@ -307,13 +362,13 @@ class ONamedListView: public OListView /** * @brief An OListView variant with named columns. * * This class provides a higher-level interface to an OListViewItem. * - * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> + * @author Michael 'Mickey' Lauer <mickey@vanille.de> */ class ONamedListViewItem: public OListViewItem { public: /** * Constructor. Accepts the same parameters as a @ref OListViewItem, |