summaryrefslogtreecommitdiff
path: root/libopie2/opieui/olistview.h
authormickeyl <mickeyl>2004-03-05 21:36:58 (UTC)
committer mickeyl <mickeyl>2004-03-05 21:36:58 (UTC)
commitb9d58b616102970872129b5bc2f55569910f5c03 (patch) (unidiff)
tree593b40cce6f3da75593c90bff337b9b9c5092f7e /libopie2/opieui/olistview.h
parent4a18103940564be8585af8121203561e16f0a32c (diff)
downloadopie-b9d58b616102970872129b5bc2f55569910f5c03.zip
opie-b9d58b616102970872129b5bc2f55569910f5c03.tar.gz
opie-b9d58b616102970872129b5bc2f55569910f5c03.tar.bz2
add OCheckListItem
change my email address
Diffstat (limited to 'libopie2/opieui/olistview.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opieui/olistview.h71
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,7 +1,6 @@
1/* 1/*
2                 This file is part of the Opie Project 2                 This file is part of the Opie Project
3 3 =. (C) 2003-2004 Michael 'Mickey' Lauer <mickey@vanille.de>
4 =. (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de>
5 .=l. 4 .=l.
6           .>+-= 5           .>+-=
7 _;:,     .>    :=|. This program is free software; you can 6 _;:,     .>    :=|. This program is free software; you can
@@ -51,7 +50,7 @@ class OListViewItem;
51 * like an alternate background for odd rows, an autostretch mode 50 * like an alternate background for odd rows, an autostretch mode
52 * for the width of the widget ( >= Qt 3 only ) and persistence capabilities. 51 * for the width of the widget ( >= Qt 3 only ) and persistence capabilities.
53 * 52 *
54 * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> 53 * @author Michael 'Mickey' Lauer <mickey@vanille.de>
55 */ 54 */
56class OListView: public QListView 55class OListView: public QListView
57{ 56{
@@ -122,11 +121,21 @@ class OListView: public QListView
122 virtual void serializeFrom( QDataStream& s ); 121 virtual void serializeFrom( QDataStream& s );
123#endif 122#endif
124 123
125protected slots: 124 public slots:
126 /** 125 /**
126 * Expand all items
127 */
128 void expand();
129 /**
130 * Collapse all items
131 */
132 void collapse();
133
134 protected slots:
135 /**
127 * expand the current OListViewItem 136 * expand the current OListViewItem
128 */ 137 */
129 void expand(QListViewItem*); 138 void expand(QListViewItem*);
130 139
131 private: 140 private:
132 QColor m_alternateBackground; 141 QColor m_alternateBackground;
@@ -153,6 +162,7 @@ QDataStream& operator>>( QDataStream& stream, OListView& listview );
153 162
154class OListViewItem: public QListViewItem 163class OListViewItem: public QListViewItem
155{ 164{
165 friend class OCheckListItem;
156 public: 166 public:
157 /** 167 /**
158 * Constructors. 168 * Constructors.
@@ -250,6 +260,51 @@ QDataStream& operator<<( QDataStream& stream, const OListViewItem& item );
250QDataStream& operator>>( QDataStream& stream, OListViewItem& item ); 260QDataStream& operator>>( QDataStream& stream, OListViewItem& item );
251#endif // QT_NO_DATASTREAM 261#endif // QT_NO_DATASTREAM
252 262
263
264/*======================================================================================
265 * OCheckListItem
266 *======================================================================================*/
267
268class OCheckListItem : public QCheckListItem
269{
270 public:
271
272 OCheckListItem( QCheckListItem *parent, const QString &text,
273 Type = Controller );
274 OCheckListItem( QListViewItem *parent, const QString &text,
275 Type = Controller );
276 OCheckListItem( QListView *parent, const QString &text,
277 Type = Controller );
278 OCheckListItem( QListViewItem *parent, const QString &text,
279 const QPixmap & );
280 OCheckListItem( QListView *parent, const QString &text,
281 const QPixmap & );
282 ~OCheckListItem();
283 /**
284 * @returns the background color of the list item.
285 */
286 const QColor& backgroundColor();
287 /**
288 * @returns true, if the item is at an odd position and
289 * thus have to be painted with the alternate background color.
290 */
291 bool isAlternate();
292 /**
293 * @note: Reimplemented for internal purposes - the API is not affected
294 *
295 */
296 void paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int alignment );
297 /**
298 * Perform object initialization.
299 */
300 void init();
301
302 private:
303 bool m_known;
304 bool m_odd;
305};
306
307
253/*====================================================================================== 308/*======================================================================================
254 * ONamedListView 309 * ONamedListView
255 *======================================================================================*/ 310 *======================================================================================*/
@@ -261,7 +316,7 @@ class ONamedListViewItem;
261 * 316 *
262 * This class provides a higher-level interface to an OListView. 317 * This class provides a higher-level interface to an OListView.
263 * 318 *
264 * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> 319 * @author Michael 'Mickey' Lauer <mickey@vanille.de>
265 */ 320 */
266class ONamedListView: public OListView 321class ONamedListView: public OListView
267{ 322{
@@ -310,7 +365,7 @@ class ONamedListView: public OListView
310 * 365 *
311 * This class provides a higher-level interface to an OListViewItem. 366 * This class provides a higher-level interface to an OListViewItem.
312 * 367 *
313 * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> 368 * @author Michael 'Mickey' Lauer <mickey@vanille.de>
314 */ 369 */
315class ONamedListViewItem: public OListViewItem 370class ONamedListViewItem: public OListViewItem
316{ 371{