summaryrefslogtreecommitdiff
path: root/noncore/net/wellenreiter/cornucopia/olistview.h
Unidiff
Diffstat (limited to 'noncore/net/wellenreiter/cornucopia/olistview.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/cornucopia/olistview.h87
1 files changed, 78 insertions, 9 deletions
diff --git a/noncore/net/wellenreiter/cornucopia/olistview.h b/noncore/net/wellenreiter/cornucopia/olistview.h
index 4b9e4b0..9df5500 100644
--- a/noncore/net/wellenreiter/cornucopia/olistview.h
+++ b/noncore/net/wellenreiter/cornucopia/olistview.h
@@ -33,14 +33,17 @@
33#ifndef OLISTVIEW_H 33#ifndef OLISTVIEW_H
34#define OLISTVIEW_H 34#define OLISTVIEW_H
35 35
36#include <qlistview.h>
37#include <qcolor.h> 36#include <qcolor.h>
37#include <qlistview.h>
38#include <qpen.h> 38#include <qpen.h>
39#include <qdatastream.h>
40
41class OListViewFactory;
39 42
40/** 43/**
41 * A @ref QListView variant featuring visual enhancements 44 * A @ref QListView variant featuring visual and functional enhancements
42 * like an alternate background for odd rows and an autostretch 45 * like an alternate background for odd rows, an autostretch mode
43 * mode for the width of the widget. 46 * for the width of the widget ( >= Qt 3 only ) and persistence capabilities.
44 * 47 *
45 * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> 48 * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de>
46 * @short OListView list/tree widget. 49 * @short OListView list/tree widget.
@@ -112,13 +115,51 @@
112 */ 115 */
113 const QPen& columnSeparator() const; 116 const QPen& columnSeparator() const;
114 117
118 #ifndef QT_NO_DATASTREAM
119 /**
120 * serialize this object to a @ref QDataStream
121 * @param s the stream used to serialize this object.
122 */
123 virtual void serializeTo( QDataStream& s ) const;
124
125 /**
126 * serialize this object from a @ref QDataStream
127 * @param s the stream used to serialize this object.
128 */
129 virtual void serializeFrom( QDataStream& s );
130 #endif
131
132 /**
133 * returns a factory for OListView classes
134 * creates one on the fly if it doesn't exist
135 * @return the XML Factory
136 */
137 #ifndef QT_NO_XML
138 //OListViewFactory* Factory();
139 #endif
140
115 private: 141 private:
116 QColor m_alternateBackground; 142 QColor m_alternateBackground;
117 bool m_fullWidth; 143 bool m_fullWidth;
118 QPen m_columnSeparator; 144 QPen m_columnSeparator;
119 145 #ifndef QT_NO_XML
146 //OListViewFactory* m_Factory;
147 #endif
120}; 148};
121 149
150#ifndef QT_NO_DATASTREAM
151/**
152 * \relates QListView
153 * Writes a listview to the stream and returns a reference to the stream.
154 */
155QDataStream& operator<<( QDataStream& s, const OListView& lv );
156/**
157 * \relates QListView
158 * Reads a listview from the stream and returns a reference to the stream.
159 */
160QDataStream& operator>>( QDataStream& s, OListView& lv );
161#endif // QT_NO_DATASTREAM
162
122//****************************** OListViewItem ****************************************************************** 163//****************************** OListViewItem ******************************************************************
123 164
124class OListViewItem: public QListViewItem 165class OListViewItem: public QListViewItem
@@ -146,23 +187,51 @@ class OListViewItem: public QListViewItem
146 QString = QString::null, QString = QString::null, 187 QString = QString::null, QString = QString::null,
147 QString = QString::null, QString = QString::null, 188 QString = QString::null, QString = QString::null,
148 QString = QString::null, QString = QString::null ); 189 QString = QString::null, QString = QString::null );
149 190
150 OListViewItem( QListViewItem * parent, QListViewItem * after, 191 OListViewItem( QListViewItem * parent, QListViewItem * after,
151 QString, QString = QString::null, 192 QString, QString = QString::null,
152 QString = QString::null, QString = QString::null, 193 QString = QString::null, QString = QString::null,
153 QString = QString::null, QString = QString::null, 194 QString = QString::null, QString = QString::null,
154 QString = QString::null, QString = QString::null ); 195 QString = QString::null, QString = QString::null );
155 196
156 virtual ~OListViewItem(); 197 virtual ~OListViewItem();
157 198
158 const QColor& backgroundColor(); 199 const QColor& backgroundColor();
159 bool isAlternate(); 200 bool isAlternate();
160 void paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int alignment ); 201 void paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int alignment );
161 void init(); 202 void init();
162 203
204 #ifndef QT_NO_DATASTREAM
205 /**
206 * serialize this object to or from a @ref QDataStream
207 * @param s the stream used to serialize this object.
208 */
209 virtual void serializeTo( QDataStream& s ) const;
210
211 /**
212 * serialize this object to or from a @ref QDataStream
213 * @param s the stream used to serialize this object.
214 */
215 virtual void serializeFrom( QDataStream& s );
216 #endif
217
163 private: 218 private:
164 bool m_known; 219 bool m_known;
165 bool m_odd; 220 bool m_odd;
166}; 221};
167 222
168#endif 223#ifndef QT_NO_DATASTREAM
224/**
225 * \relates QListViewItem
226 * Writes a listview item and all subitems recursively to the stream
227 * and returns a reference to the stream.
228 */
229QDataStream& operator<<( QDataStream &s, const OListViewItem& lvi );
230/**
231 * \relates QListViewItem
232 * Reads a listview item from the stream and returns a reference to the stream.
233 */
234QDataStream& operator>>( QDataStream &s, OListViewItem& lvi );
235#endif // QT_NO_DATASTREAM
236
237#endif // OLISTVIEW_H