summaryrefslogtreecommitdiff
path: root/libopie2/opieui/olistview.h
Unidiff
Diffstat (limited to 'libopie2/opieui/olistview.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opieui/olistview.h25
1 files changed, 21 insertions, 4 deletions
diff --git a/libopie2/opieui/olistview.h b/libopie2/opieui/olistview.h
index 59b0973..8195a62 100644
--- a/libopie2/opieui/olistview.h
+++ b/libopie2/opieui/olistview.h
@@ -27,42 +27,46 @@
27 27
28*/ 28*/
29 29
30#ifndef OLISTVIEW_H 30#ifndef OLISTVIEW_H
31#define OLISTVIEW_H 31#define OLISTVIEW_H
32 32
33#include <qcolor.h> 33#include <qcolor.h>
34#include <qlistview.h> 34#include <qlistview.h>
35#include <qpen.h> 35#include <qpen.h>
36#include <qdatastream.h> 36#include <qdatastream.h>
37#include <qstringlist.h> 37#include <qstringlist.h>
38 38
39
40namespace Opie {
41namespace Ui {
39class OListViewItem; 42class OListViewItem;
40 43
41 44
42/*====================================================================================== 45/*======================================================================================
43 * OListView 46 * OListView
44 *======================================================================================*/ 47 *======================================================================================*/
45 48
46/** 49/**
47 * @brief A list/tree widget. 50 * @brief A list/tree widget.
48 * 51 *
49 * A @ref QListView variant featuring visual and functional enhancements 52 * A @ref QListView variant featuring visual and functional enhancements
50 * like an alternate background for odd rows, an autostretch mode 53 * like an alternate background for odd rows, an autostretch mode
51 * for the width of the widget ( >= Qt 3 only ) and persistence capabilities. 54 * for the width of the widget ( >= Qt 3 only ) and persistence capabilities.
52 * 55 *
53 * @author Michael 'Mickey' Lauer <mickey@vanille.de> 56 * @author Michael 'Mickey' Lauer <mickey@vanille.de>
54 */ 57 */
55class OListView: public QListView 58class OListView: public QListView
56{ 59{
60 Q_OBJECT
57 public: 61 public:
58 /** 62 /**
59 * Constructor. 63 * Constructor.
60 * 64 *
61 * The parameters @a parent and @a name are handled by 65 * The parameters @a parent and @a name are handled by
62 * @ref QListView, as usual. 66 * @ref QListView, as usual.
63 */ 67 */
64 OListView( QWidget* parent = 0, const char* name = 0 ); 68 OListView( QWidget* parent = 0, const char* name = 0 );
65 /** 69 /**
66 * Destructor. 70 * Destructor.
67 */ 71 */
68 virtual ~OListView(); 72 virtual ~OListView();
@@ -130,26 +134,28 @@ class OListView: public QListView
130 * Collapse all items 134 * Collapse all items
131 */ 135 */
132 void collapse(); 136 void collapse();
133 137
134 protected slots: 138 protected slots:
135 /** 139 /**
136 * expand the current OListViewItem 140 * expand the current OListViewItem
137 */ 141 */
138 void expand(QListViewItem*); 142 void expand(QListViewItem*);
139 143
140 private: 144 private:
141 QColor m_alternateBackground; 145 QColor m_alternateBackground;
142 bool m_fullWidth; 146 bool m_fullWidth : 1;
143 QPen m_columnSeparator; 147 QPen m_columnSeparator;
148 class Private;
149 Private *d;
144}; 150};
145 151
146#ifndef QT_NO_DATASTREAM 152#ifndef QT_NO_DATASTREAM
147/** 153/**
148 * @relates OListView 154 * @relates OListView
149 * Writes @a listview to the @a stream and returns a reference to the stream. 155 * Writes @a listview to the @a stream and returns a reference to the stream.
150 */ 156 */
151QDataStream& operator<<( QDataStream& stream, const OListView& listview ); 157QDataStream& operator<<( QDataStream& stream, const OListView& listview );
152/** 158/**
153 * @relates OListView 159 * @relates OListView
154 * Reads @a listview from the @a stream and returns a reference to the stream. 160 * Reads @a listview from the @a stream and returns a reference to the stream.
155 */ 161 */
@@ -233,26 +239,28 @@ class OListViewItem: public QListViewItem
233 * serialize this object to or from a @ref QDataStream 239 * serialize this object to or from a @ref QDataStream
234 * @param s the stream used to serialize this object. 240 * @param s the stream used to serialize this object.
235 */ 241 */
236 virtual void serializeFrom( QDataStream& s ); 242 virtual void serializeFrom( QDataStream& s );
237 #endif 243 #endif
238 244
239 /** 245 /**
240 * expand the the item 246 * expand the the item
241 */ 247 */
242 virtual void expand(){}; 248 virtual void expand(){};
243 249
244 private: 250 private:
245 bool m_known; 251 bool m_known : 1;
246 bool m_odd; 252 bool m_odd : 1;
253 class Private;
254 Private *d;
247}; 255};
248 256
249#ifndef QT_NO_DATASTREAM 257#ifndef QT_NO_DATASTREAM
250/** 258/**
251 * @relates QListViewItem 259 * @relates QListViewItem
252 * Writes listview @a item and all subitems recursively to @a stream 260 * Writes listview @a item and all subitems recursively to @a stream
253 * and returns a reference to the stream. 261 * and returns a reference to the stream.
254 */ 262 */
255QDataStream& operator<<( QDataStream& stream, const OListViewItem& item ); 263QDataStream& operator<<( QDataStream& stream, const OListViewItem& item );
256/** 264/**
257 * @relates QListViewItem 265 * @relates QListViewItem
258 * Reads listview @a item from @a stream and returns a reference to the stream. 266 * Reads listview @a item from @a stream and returns a reference to the stream.
@@ -345,24 +353,27 @@ class ONamedListView: public OListView
345 * Set @a recurse to indicate how much subchild levels to search, e.g.<ul> 353 * Set @a recurse to indicate how much subchild levels to search, e.g.<ul>
346 * <li>set it to 0 to search only among direct childs, 354 * <li>set it to 0 to search only among direct childs,
347 * <li>set it to 1 to search direct childs and all 1st order subchilds 355 * <li>set it to 1 to search direct childs and all 1st order subchilds
348 * <li>set it to -1 for maximum recursion. 356 * <li>set it to -1 for maximum recursion.
349 * </ul> 357 * </ul>
350 * @sa ONamedListViewItem::find() 358 * @sa ONamedListViewItem::find()
351 */ 359 */
352 virtual ONamedListViewItem* find( ONamedListViewItem* start, int column, const QString& text, int recurse = -1 ) const; 360 virtual ONamedListViewItem* find( ONamedListViewItem* start, int column, const QString& text, int recurse = -1 ) const;
353 virtual ONamedListViewItem* find( int column, const QString& text, int recurse = -1 ) const; 361 virtual ONamedListViewItem* find( int column, const QString& text, int recurse = -1 ) const;
354 362
355 virtual ONamedListViewItem* find( ONamedListViewItem* start, const QString& column, const QString& text, int recurse = -1 ) const; 363 virtual ONamedListViewItem* find( ONamedListViewItem* start, const QString& column, const QString& text, int recurse = -1 ) const;
356 virtual ONamedListViewItem* find( const QString& column, const QString& text, int recurse = -1 ) const; 364 virtual ONamedListViewItem* find( const QString& column, const QString& text, int recurse = -1 ) const;
365 private:
366 class Private;
367 Private *d;
357}; 368};
358 369
359/*====================================================================================== 370/*======================================================================================
360 * ONamedListViewItem 371 * ONamedListViewItem
361 *======================================================================================*/ 372 *======================================================================================*/
362 373
363/** 374/**
364 * @brief An OListView variant with named columns. 375 * @brief An OListView variant with named columns.
365 * 376 *
366 * This class provides a higher-level interface to an OListViewItem. 377 * This class provides a higher-level interface to an OListViewItem.
367 * 378 *
368 * @author Michael 'Mickey' Lauer <mickey@vanille.de> 379 * @author Michael 'Mickey' Lauer <mickey@vanille.de>
@@ -394,16 +405,22 @@ class ONamedListViewItem: public OListViewItem
394 virtual void setText( const QStringList& texts ); 405 virtual void setText( const QStringList& texts );
395 /** 406 /**
396 * @returns the first child which has a @a text in column @a column. 407 * @returns the first child which has a @a text in column @a column.
397 * Set @a recurse to indicate how much subchild levels to search, e.g.<ul> 408 * Set @a recurse to indicate how much subchild levels to search, e.g.<ul>
398 * <li>set it to 0 to search only among direct childs, 409 * <li>set it to 0 to search only among direct childs,
399 * <li>set it to 1 to search direct childs and all 1st order subchilds 410 * <li>set it to 1 to search direct childs and all 1st order subchilds
400 * <li>set it to -1 for maximum recursion. 411 * <li>set it to -1 for maximum recursion.
401 * </ul> 412 * </ul>
402 * @sa ONamedListView::find() 413 * @sa ONamedListView::find()
403 */ 414 */
404 virtual ONamedListViewItem* find( int column, const QString& text, int recurse = -1 ) const; 415 virtual ONamedListViewItem* find( int column, const QString& text, int recurse = -1 ) const;
405 virtual ONamedListViewItem* find( const QString& column, const QString& text, int recurse = -1 ) const; 416 virtual ONamedListViewItem* find( const QString& column, const QString& text, int recurse = -1 ) const;
406};
407 417
418 private:
419 class Private;
420 Private *d;
421
422};
423}
424}
408 425
409#endif // OLISTVIEW_H 426#endif // OLISTVIEW_H