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,10 +1,9 @@
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
8.> <`_,   >  .   <= redistribute it and/or modify it under 7.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU Library General Public 8:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
10.="- .-=="i,     .._ License as published by the Free Software 9.="- .-=="i,     .._ License as published by the Free Software
@@ -48,13 +47,13 @@ class OListViewItem;
48 * @brief A list/tree widget. 47 * @brief A list/tree widget.
49 * 48 *
50 * A @ref QListView variant featuring visual and functional enhancements 49 * A @ref QListView variant featuring visual and functional enhancements
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{
58 public: 57 public:
59 /** 58 /**
60 * Constructor. 59 * Constructor.
@@ -119,17 +118,27 @@ class OListView: public QListView
119 /** 118 /**
120 * Serialize this object from a @ref QDataStream @a stream 119 * Serialize this object from a @ref QDataStream @a stream
121 */ 120 */
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;
133 bool m_fullWidth; 142 bool m_fullWidth;
134 QPen m_columnSeparator; 143 QPen m_columnSeparator;
135}; 144};
@@ -150,12 +159,13 @@ QDataStream& operator>>( QDataStream& stream, OListView& listview );
150/*====================================================================================== 159/*======================================================================================
151 * OListViewItem 160 * OListViewItem
152 *======================================================================================*/ 161 *======================================================================================*/
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.
159 */ 169 */
160 OListViewItem( QListView * parent ); 170 OListViewItem( QListView * parent );
161 OListViewItem( QListViewItem * parent ); 171 OListViewItem( QListViewItem * parent );
@@ -247,24 +257,69 @@ QDataStream& operator<<( QDataStream& stream, const OListViewItem& item );
247 * @relates QListViewItem 257 * @relates QListViewItem
248 * Reads listview @a item from @a stream and returns a reference to the stream. 258 * Reads listview @a item from @a stream and returns a reference to the stream.
249 */ 259 */
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 *======================================================================================*/
256 311
257class ONamedListViewItem; 312class ONamedListViewItem;
258 313
259/** 314/**
260 * @brief An OListView variant with named columns. 315 * @brief An OListView variant with named columns.
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{
268 public: 323 public:
269 /** 324 /**
270 * Constructor. 325 * Constructor.
@@ -307,13 +362,13 @@ class ONamedListView: public OListView
307 362
308/** 363/**
309 * @brief An OListView variant with named columns. 364 * @brief An OListView variant with named columns.
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{
317 public: 372 public:
318 /** 373 /**
319 * Constructor. Accepts the same parameters as a @ref OListViewItem, 374 * Constructor. Accepts the same parameters as a @ref OListViewItem,