Diffstat (limited to 'noncore/net/wellenreiter/cornucopia/olistview.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/cornucopia/olistview.h | 81 |
1 files changed, 75 insertions, 6 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 | |||
@@ -30,20 +30,23 @@ | |||
30 | 30 | ||
31 | */ | 31 | */ |
32 | 32 | ||
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 | |||
41 | class 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. |
47 | */ | 50 | */ |
48 | class OListView: public QListView | 51 | class OListView: public QListView |
49 | { | 52 | { |
@@ -109,19 +112,57 @@ | |||
109 | 112 | ||
110 | /** | 113 | /** |
111 | * @return the column separator pen | 114 | * @return the column separator pen |
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 | */ | ||
155 | QDataStream& 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 | */ | ||
160 | QDataStream& operator>>( QDataStream& s, OListView& lv ); | ||
161 | #endif // QT_NO_DATASTREAM | ||
162 | |||
122 | //****************************** OListViewItem ****************************************************************** | 163 | //****************************** OListViewItem ****************************************************************** |
123 | 164 | ||
124 | class OListViewItem: public QListViewItem | 165 | class OListViewItem: public QListViewItem |
125 | { | 166 | { |
126 | public: | 167 | public: |
127 | OListViewItem( QListView * parent ); | 168 | OListViewItem( QListView * parent ); |
@@ -157,12 +198,40 @@ class OListViewItem: public QListViewItem | |||
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 | */ | ||
229 | QDataStream& 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 | */ | ||
234 | QDataStream& operator>>( QDataStream &s, OListViewItem& lvi ); | ||
235 | #endif // QT_NO_DATASTREAM | ||
236 | |||
237 | #endif // OLISTVIEW_H | ||