author | mickeyl <mickeyl> | 2003-03-30 01:51:14 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-03-30 01:51:14 (UTC) |
commit | d11a0154e2d9732854c9a3d598857bc20f359849 (patch) (unidiff) | |
tree | af0e0273d01f4f6c64c9f230f22bb91a7a8a21d8 /noncore/net/wellenreiter/cornucopia | |
parent | 99899abc80a8aa05044eeecd8a061b0a8efaa713 (diff) | |
download | opie-d11a0154e2d9732854c9a3d598857bc20f359849.zip opie-d11a0154e2d9732854c9a3d598857bc20f359849.tar.gz opie-d11a0154e2d9732854c9a3d598857bc20f359849.tar.bz2 |
- the network work for libopie2 pays off...
- good bye to wellenreiterd, t'was fun but always too unstable and too hard to maintain
- good bye to libwellenreiter
Diffstat (limited to 'noncore/net/wellenreiter/cornucopia') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/cornucopia/.cvsignore | 8 | ||||
-rw-r--r-- | noncore/net/wellenreiter/cornucopia/README | 124 | ||||
-rw-r--r-- | noncore/net/wellenreiter/cornucopia/cornucopia.pro | 16 | ||||
-rw-r--r-- | noncore/net/wellenreiter/cornucopia/olistview.cpp | 417 | ||||
-rw-r--r-- | noncore/net/wellenreiter/cornucopia/olistview.h | 237 |
5 files changed, 0 insertions, 802 deletions
diff --git a/noncore/net/wellenreiter/cornucopia/.cvsignore b/noncore/net/wellenreiter/cornucopia/.cvsignore deleted file mode 100644 index 724d599..0000000 --- a/noncore/net/wellenreiter/cornucopia/.cvsignore +++ b/dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | *.o | ||
2 | *~ | ||
3 | Makefile* | ||
4 | moc_* | ||
5 | wellenreitertemplate.cpp | ||
6 | wellenreitertemplate.h | ||
7 | configbase.h | ||
8 | configbase.cpp | ||
diff --git a/noncore/net/wellenreiter/cornucopia/README b/noncore/net/wellenreiter/cornucopia/README deleted file mode 100644 index 486dc67..0000000 --- a/noncore/net/wellenreiter/cornucopia/README +++ b/dev/null | |||
@@ -1,124 +0,0 @@ | |||
1 | /******************************************************************** | ||
2 | /* This is an overview of the opielibs 1.2 project | ||
3 | /********************************************************************/ | ||
4 | |||
5 | Origin: opielibs is about creating classes to | ||
6 | * optimize Qt classes for the embedded environment | ||
7 | * provide sophisticated abstractions for developers | ||
8 | * provide complete documentation and working examples | ||
9 | * provide end users with a common look and feel | ||
10 | * reduce memory footprint through sharing code | ||
11 | * reduce possible bugs through reusing tested code | ||
12 | |||
13 | -------------------------------------------------------- | ||
14 | 1. General Overview | ||
15 | -------------------------------------------------------- | ||
16 | |||
17 | Separation into the following libraries: | ||
18 | - libopiecore | ||
19 | - libopieui | ||
20 | - libopiepim | ||
21 | - libopienet | ||
22 | |||
23 | 1.1 Contents of libopiecore [ opiecore ] | ||
24 | -------------------------------------------------------- | ||
25 | |||
26 | - oprocctrl | ||
27 | - oprocess | ||
28 | - odevice | ||
29 | - odevicebutton | ||
30 | |||
31 | - oconfig | ||
32 | - oconfiggroupsaver | ||
33 | - ocompletionbase | ||
34 | - ocompletion | ||
35 | - ocomptreenodelist | ||
36 | - ocomptreenode | ||
37 | - ocompletionwrapper | ||
38 | - oglobal | ||
39 | - oglobalsettings | ||
40 | - osortableitem | ||
41 | - osortablevaluelist | ||
42 | |||
43 | 1.2 Contents of libopieui [ opieui ] | ||
44 | -------------------------------------------------------- | ||
45 | |||
46 | - oapplication | ||
47 | |||
48 | - ofiledialog | ||
49 | - colordialog | ||
50 | - oclickablelabel | ||
51 | - ocolorbutton | ||
52 | - colorpopupmenu | ||
53 | - otabinfo | ||
54 | - otabbar | ||
55 | - otabwidget | ||
56 | - ofontmenu | ||
57 | - ofontselector | ||
58 | - ofileview | ||
59 | - oticker | ||
60 | |||
61 | - olistview | ||
62 | - olistviewitem | ||
63 | - oversatileview | ||
64 | - oversatileviewitem | ||
65 | - ocompletionbox | ||
66 | - olineedit | ||
67 | - ocombobox | ||
68 | - ohistorycombo | ||
69 | |||
70 | - omessagebox | ||
71 | - odialogbase | ||
72 | |||
73 | - todayconfigwidget (rather into opiepim?) | ||
74 | - orecurrancewidget (rather into opiepim?) | ||
75 | - otimepicker (rather into opiepim?) | ||
76 | |||
77 | 1.3 Contents of libopiepim [ opiepim ] | ||
78 | -------------------------------------------------------- | ||
79 | |||
80 | - ocheckitem | ||
81 | - todoevent | ||
82 | - todoresource | ||
83 | - todayplugininterface | ||
84 | - todovcalresource | ||
85 | |||
86 | 1.4 Contents of libopiedb [ opiedb ] | ||
87 | -------------------------------------------------------- | ||
88 | |||
89 | - tododb | ||
90 | - xmltree | ||
91 | |||
92 | 1.5 Contents of libopienet [ opienet ] | ||
93 | -------------------------------------------------------- | ||
94 | |||
95 | <libmail stuff> | ||
96 | <libbend stuff> | ||
97 | <libftp stuff> | ||
98 | |||
99 | -------------------------------------------------------- | ||
100 | 2.0 Feature Description | ||
101 | -------------------------------------------------------- | ||
102 | |||
103 | 2.1 libopiecore | ||
104 | |||
105 | ... | ||
106 | |||
107 | 2.2 libopieui | ||
108 | |||
109 | ... | ||
110 | |||
111 | 2.2.x OListView, OListViewItem, OListViewFactory | ||
112 | |||
113 | ... | ||
114 | |||
115 | 2.3 libopiepim | ||
116 | |||
117 | ... | ||
118 | |||
119 | 2.4 libopiedb | ||
120 | |||
121 | ... | ||
122 | |||
123 | 2.5 libopienet | ||
124 | |||
diff --git a/noncore/net/wellenreiter/cornucopia/cornucopia.pro b/noncore/net/wellenreiter/cornucopia/cornucopia.pro deleted file mode 100644 index 7ffa202..0000000 --- a/noncore/net/wellenreiter/cornucopia/cornucopia.pro +++ b/dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | DESTDIR = $(OPIEDIR)/lib | ||
2 | MOC_DIR = ./tmp | ||
3 | OBJECTS_DIR = ./tmp | ||
4 | TEMPLATE = lib | ||
5 | CONFIG = qt warn_on debug | ||
6 | VERSION = 0.1 | ||
7 | HEADERS = olistview.h | ||
8 | SOURCES = olistview.cpp | ||
9 | INCLUDEPATH = $(OPIEDIR)/include | ||
10 | DEPENDPATH = $(OPIEDIR)/include | ||
11 | TARGET = cornucopia | ||
12 | |||
13 | !contains( platform, x11 ) { | ||
14 | include ( $(OPIEDIR)/include.pro ) | ||
15 | } | ||
16 | |||
diff --git a/noncore/net/wellenreiter/cornucopia/olistview.cpp b/noncore/net/wellenreiter/cornucopia/olistview.cpp deleted file mode 100644 index c292eb9..0000000 --- a/noncore/net/wellenreiter/cornucopia/olistview.cpp +++ b/dev/null | |||
@@ -1,417 +0,0 @@ | |||
1 | /* | ||
2 | This file is part of the Opie Project | ||
3 | |||
4 | Copyright (C) 2003 Michael 'Mickey' Lauer | ||
5 | <mickey@tm.informatik.uni-frankfurt.de> | ||
6 | =. | ||
7 | .=l. | ||
8 | .>+-= | ||
9 | _;:, .> :=|. This program is free software; you can | ||
10 | .> <`_, > . <= redistribute it and/or modify it under | ||
11 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
12 | .="- .-=="i, .._ License as published by the Free Software | ||
13 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
14 | ._= =} : or (at your option) any later version. | ||
15 | .%`+i> _;_. | ||
16 | .i_,=:_. -<s. This program is distributed in the hope that | ||
17 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
18 | : .. .:, . . . without even the implied warranty of | ||
19 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
20 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
21 | ..}^=.= = ; Library General Public License for more | ||
22 | ++= -. .` .: details. | ||
23 | : = ...= . :.=- | ||
24 | -. .:....=;==+<; You should have received a copy of the GNU | ||
25 | -_. . . )=. = Library General Public License along with | ||
26 | -- :-=` this library; see the file COPYING.LIB. | ||
27 | If not, write to the Free Software Foundation, | ||
28 | Inc., 59 Temple Place - Suite 330, | ||
29 | Boston, MA 02111-1307, USA. | ||
30 | |||
31 | */ | ||
32 | |||
33 | #include <qcolor.h> | ||
34 | #include <qheader.h> | ||
35 | #include <qpainter.h> | ||
36 | #include <qpixmap.h> | ||
37 | |||
38 | #include "olistview.h" | ||
39 | |||
40 | //****************************** OListView ************************************************************************** | ||
41 | |||
42 | OListView::OListView( QWidget *parent, const char *name ) | ||
43 | :QListView( parent, name ) | ||
44 | { | ||
45 | //FIXME: get from global settings and calculate ==> see oglobalsettings.* | ||
46 | |||
47 | m_alternateBackground = QColor( 238, 246, 255 ); | ||
48 | m_columnSeparator = QPen( QColor( 150, 160, 170 ), 0, DotLine ); | ||
49 | m_fullWidth = true; | ||
50 | } | ||
51 | |||
52 | OListView::~OListView() | ||
53 | { | ||
54 | } | ||
55 | |||
56 | void OListView::setFullWidth( bool fullWidth ) | ||
57 | { | ||
58 | m_fullWidth = m_fullWidth; | ||
59 | #if QT_VERSION > 290 | ||
60 | header()->setStretchEnabled( fullWidth, columns()-1 ); | ||
61 | #endif | ||
62 | } | ||
63 | |||
64 | bool OListView::fullWidth() const | ||
65 | { | ||
66 | return m_fullWidth; | ||
67 | } | ||
68 | |||
69 | int OListView::addColumn( const QString& label, int width ) | ||
70 | { | ||
71 | int result = QListView::addColumn( label, width ); | ||
72 | #if QT_VERSION > 290 | ||
73 | if (m_fullWidth) { | ||
74 | header()->setStretchEnabled( false, columns()-2 ); | ||
75 | header()->setStretchEnabled( true, columns()-1 ); | ||
76 | } | ||
77 | #endif | ||
78 | return result; | ||
79 | } | ||
80 | |||
81 | int OListView::addColumn( const QIconSet& iconset, const QString& label, int width ) | ||
82 | { | ||
83 | int result = QListView::addColumn( iconset, label, width ); | ||
84 | #if QT_VERSION > 290 | ||
85 | if (m_fullWidth) { | ||
86 | header()->setStretchEnabled( false, columns()-2 ); | ||
87 | header()->setStretchEnabled( true, columns()-1 ); | ||
88 | } | ||
89 | #endif | ||
90 | return result; | ||
91 | } | ||
92 | |||
93 | void OListView::removeColumn( int index ) | ||
94 | { | ||
95 | QListView::removeColumn(index); | ||
96 | #if QT_VERSION > 290 | ||
97 | if ( m_fullWidth && index == columns() ) | ||
98 | { | ||
99 | header()->setStretchEnabled( true, columns()-1 ); | ||
100 | } | ||
101 | #endif | ||
102 | } | ||
103 | |||
104 | const QColor& OListView::alternateBackground() const | ||
105 | { | ||
106 | return m_alternateBackground; | ||
107 | } | ||
108 | |||
109 | void OListView::setAlternateBackground( const QColor &c ) | ||
110 | { | ||
111 | m_alternateBackground = c; | ||
112 | repaint(); | ||
113 | } | ||
114 | |||
115 | const QPen& OListView::columnSeparator() const | ||
116 | { | ||
117 | return m_columnSeparator; | ||
118 | } | ||
119 | |||
120 | void OListView::setColumnSeparator( const QPen& p ) | ||
121 | { | ||
122 | m_columnSeparator = p; | ||
123 | repaint(); | ||
124 | } | ||
125 | |||
126 | OListViewItem* OListView::childFactory() | ||
127 | { | ||
128 | return new OListViewItem( this ); | ||
129 | } | ||
130 | |||
131 | #ifndef QT_NO_DATASTREAM | ||
132 | void OListView::serializeTo( QDataStream& s ) const | ||
133 | { | ||
134 | #warning Caution... the binary format is still under construction... | ||
135 | qDebug( "storing OListView..." ); | ||
136 | |||
137 | // store number of columns and the labels | ||
138 | s << columns(); | ||
139 | for ( int i = 0; i < columns(); ++i ) | ||
140 | s << columnText( i ); | ||
141 | |||
142 | // calculate the number of top-level items to serialize | ||
143 | int items = 0; | ||
144 | QListViewItem* item = firstChild(); | ||
145 | while ( item ) | ||
146 | { | ||
147 | item = item->nextSibling(); | ||
148 | items++; | ||
149 | } | ||
150 | |||
151 | // store number of items and the items itself | ||
152 | s << items; | ||
153 | item = firstChild(); | ||
154 | for ( int i = 0; i < items; ++i ) | ||
155 | { | ||
156 | s << *static_cast<OListViewItem*>( item ); | ||
157 | item = item->nextSibling(); | ||
158 | } | ||
159 | |||
160 | qDebug( "OListview stored." ); | ||
161 | } | ||
162 | |||
163 | void OListView::serializeFrom( QDataStream& s ) | ||
164 | { | ||
165 | #warning Caution... the binary format is still under construction... | ||
166 | qDebug( "loading OListView..." ); | ||
167 | |||
168 | int cols; | ||
169 | s >> cols; | ||
170 | qDebug( "read number of columns = %d", cols ); | ||
171 | |||
172 | while ( columns() < cols ) addColumn( QString::null ); | ||
173 | |||
174 | for ( int i = 0; i < cols; ++i ) | ||
175 | { | ||
176 | QString coltext; | ||
177 | s >> coltext; | ||
178 | qDebug( "read text '%s' for column %d", (const char*) coltext, i ); | ||
179 | setColumnText( i, coltext ); | ||
180 | } | ||
181 | |||
182 | int items; | ||
183 | s >> items; | ||
184 | qDebug( "read number of items = %d", items ); | ||
185 | |||
186 | for ( int i = 0; i < items; ++i ) | ||
187 | { | ||
188 | OListViewItem* item = childFactory(); | ||
189 | s >> *item; | ||
190 | } | ||
191 | |||
192 | qDebug( "OListView loaded." ); | ||
193 | |||
194 | } | ||
195 | |||
196 | QDataStream& operator<<( QDataStream& s, const OListView& lv ) | ||
197 | { | ||
198 | lv.serializeTo( s ); | ||
199 | } | ||
200 | |||
201 | QDataStream& operator>>( QDataStream& s, OListView& lv ) | ||
202 | { | ||
203 | lv.serializeFrom( s ); | ||
204 | } | ||
205 | #endif // QT_NO_DATASTREAM | ||
206 | |||
207 | //****************************** OListViewItem *********************************************************************** | ||
208 | |||
209 | OListViewItem::OListViewItem(QListView *parent) | ||
210 | : QListViewItem(parent) | ||
211 | { | ||
212 | init(); | ||
213 | } | ||
214 | |||
215 | OListViewItem::OListViewItem(QListViewItem *parent) | ||
216 | : QListViewItem(parent) | ||
217 | { | ||
218 | init(); | ||
219 | } | ||
220 | |||
221 | OListViewItem::OListViewItem(QListView *parent, QListViewItem *after) | ||
222 | : QListViewItem(parent, after) | ||
223 | { | ||
224 | init(); | ||
225 | } | ||
226 | |||
227 | OListViewItem::OListViewItem(QListViewItem *parent, QListViewItem *after) | ||
228 | : QListViewItem(parent, after) | ||
229 | { | ||
230 | init(); | ||
231 | } | ||
232 | |||
233 | OListViewItem::OListViewItem(QListView *parent, | ||
234 | QString label1, QString label2, QString label3, QString label4, | ||
235 | QString label5, QString label6, QString label7, QString label8) | ||
236 | : QListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8) | ||
237 | { | ||
238 | init(); | ||
239 | } | ||
240 | |||
241 | OListViewItem::OListViewItem(QListViewItem *parent, | ||
242 | QString label1, QString label2, QString label3, QString label4, | ||
243 | QString label5, QString label6, QString label7, QString label8) | ||
244 | : QListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8) | ||
245 | { | ||
246 | init(); | ||
247 | } | ||
248 | |||
249 | OListViewItem::OListViewItem(QListView *parent, QListViewItem *after, | ||
250 | QString label1, QString label2, QString label3, QString label4, | ||
251 | QString label5, QString label6, QString label7, QString label8) | ||
252 | : QListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8) | ||
253 | { | ||
254 | init(); | ||
255 | } | ||
256 | |||
257 | OListViewItem::OListViewItem(QListViewItem *parent, QListViewItem *after, | ||
258 | QString label1, QString label2, QString label3, QString label4, | ||
259 | QString label5, QString label6, QString label7, QString label8) | ||
260 | : QListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8) | ||
261 | { | ||
262 | init(); | ||
263 | } | ||
264 | |||
265 | OListViewItem::~OListViewItem() | ||
266 | { | ||
267 | } | ||
268 | |||
269 | void OListViewItem::init() | ||
270 | { | ||
271 | m_known = false; | ||
272 | } | ||
273 | |||
274 | const QColor &OListViewItem::backgroundColor() | ||
275 | { | ||
276 | return isAlternate() ? static_cast<OListView*>(listView())->alternateBackground() : | ||
277 | listView()->viewport()->colorGroup().base(); | ||
278 | } | ||
279 | |||
280 | bool OListViewItem::isAlternate() | ||
281 | { | ||
282 | OListView *lv = static_cast<OListView*>( listView() ); | ||
283 | |||
284 | // check if the item above is an OListViewItem | ||
285 | OListViewItem *above = static_cast<OListViewItem*>( itemAbove() ); | ||
286 | /*if (! itemAbove()->inherits( "OListViewItem" )) return false;*/ | ||
287 | |||
288 | // check if we have a valid alternate background color | ||
289 | if (!(lv && lv->alternateBackground().isValid())) return false; | ||
290 | |||
291 | m_known = above ? above->m_known : true; | ||
292 | if (m_known) | ||
293 | { | ||
294 | m_odd = above ? !above->m_odd : false; | ||
295 | } | ||
296 | else | ||
297 | { | ||
298 | OListViewItem *item; | ||
299 | bool previous = true; | ||
300 | if (parent()) | ||
301 | { | ||
302 | item = static_cast<OListViewItem *>(parent()); | ||
303 | if ( item /*&& item->inherits( "OListViewItem" )*/ ) previous = item->m_odd; | ||
304 | item = static_cast<OListViewItem *>(parent()->firstChild()); | ||
305 | /* if ( !item.inherits( "OListViewItem" ) item = 0; */ | ||
306 | } | ||
307 | else | ||
308 | { | ||
309 | item = static_cast<OListViewItem *>(lv->firstChild()); | ||
310 | } | ||
311 | |||
312 | while(item) | ||
313 | { | ||
314 | item->m_odd = previous = !previous; | ||
315 | item->m_known = true; | ||
316 | item = static_cast<OListViewItem *>(item->nextSibling()); | ||
317 | /* if (!item.inherits( "OListViewItem" ) ) break; */ | ||
318 | } | ||
319 | } | ||
320 | return m_odd; | ||
321 | } | ||
322 | |||
323 | void OListViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment) | ||
324 | { | ||
325 | QColorGroup _cg = cg; | ||
326 | const QPixmap *pm = listView()->viewport()->backgroundPixmap(); | ||
327 | if (pm && !pm->isNull()) | ||
328 | { | ||
329 | _cg.setBrush( QColorGroup::Base, QBrush(backgroundColor(), *pm) ); | ||
330 | p->setBrushOrigin( -listView()->contentsX(), -listView()->contentsY() ); | ||
331 | } | ||
332 | else if ( isAlternate() ) | ||
333 | { | ||
334 | _cg.setColor( QColorGroup::Base, static_cast<OListView*>( listView() )->alternateBackground() ); | ||
335 | } | ||
336 | QListViewItem::paintCell( p, _cg, column, width, alignment ); | ||
337 | |||
338 | //FIXME: Use styling here! | ||
339 | |||
340 | const QPen& pen = static_cast<OListView*>( listView() )->columnSeparator(); | ||
341 | p->setPen( pen ); | ||
342 | p->drawLine( width-1, 0, width-1, height() ); | ||
343 | } | ||
344 | |||
345 | OListViewItem* OListViewItem::childFactory() | ||
346 | { | ||
347 | return new OListViewItem( this ); | ||
348 | } | ||
349 | |||
350 | #ifndef QT_NO_DATASTREAM | ||
351 | void OListViewItem::serializeTo( QDataStream& s ) const | ||
352 | { | ||
353 | #warning Caution... the binary format is still under construction... | ||
354 | qDebug( "storing OListViewItem..." ); | ||
355 | |||
356 | // store item text | ||
357 | for ( int i = 0; i < listView()->columns(); ++i ) | ||
358 | { | ||
359 | s << text( i ); | ||
360 | } | ||
361 | |||
362 | // calculate the number of children to serialize | ||
363 | int items = 0; | ||
364 | QListViewItem* item = firstChild(); | ||
365 | while ( item ) | ||
366 | { | ||
367 | item = item->nextSibling(); | ||
368 | items++; | ||
369 | } | ||
370 | |||
371 | // store number of items and the items itself | ||
372 | s << items; | ||
373 | item = firstChild(); | ||
374 | for ( int i = 0; i < items; ++i ) | ||
375 | { | ||
376 | s << *static_cast<OListViewItem*>( item ); | ||
377 | item = item->nextSibling(); | ||
378 | } | ||
379 | |||
380 | qDebug( "OListviewItem stored." ); | ||
381 | } | ||
382 | void OListViewItem::serializeFrom( QDataStream& s ) | ||
383 | { | ||
384 | #warning Caution... the binary format is still under construction... | ||
385 | qDebug( "loading OListViewItem..." ); | ||
386 | |||
387 | for ( int i = 0; i < listView()->columns(); ++i ) | ||
388 | { | ||
389 | QString coltext; | ||
390 | s >> coltext; | ||
391 | qDebug( "read text '%s' for column %d", (const char*) coltext, i ); | ||
392 | setText( i, coltext ); | ||
393 | } | ||
394 | |||
395 | int items; | ||
396 | s >> items; | ||
397 | qDebug( "read number of items = %d", items ); | ||
398 | |||
399 | for ( int i = 0; i < items; ++i ) | ||
400 | { | ||
401 | OListViewItem* item = childFactory(); | ||
402 | s >> (*item); | ||
403 | } | ||
404 | |||
405 | qDebug( "OListViewItem loaded." ); | ||
406 | } | ||
407 | |||
408 | QDataStream& operator<<( QDataStream& s, const OListViewItem& lvi ) | ||
409 | { | ||
410 | lvi.serializeTo( s ); | ||
411 | } | ||
412 | |||
413 | QDataStream& operator>>( QDataStream& s, OListViewItem& lvi ) | ||
414 | { | ||
415 | lvi.serializeFrom( s ); | ||
416 | } | ||
417 | #endif // QT_NO_DATASTREAM | ||
diff --git a/noncore/net/wellenreiter/cornucopia/olistview.h b/noncore/net/wellenreiter/cornucopia/olistview.h deleted file mode 100644 index 8911e22..0000000 --- a/noncore/net/wellenreiter/cornucopia/olistview.h +++ b/dev/null | |||
@@ -1,237 +0,0 @@ | |||
1 | /* | ||
2 | This file is part of the Opie Project | ||
3 | |||
4 | Copyright (C) 2003 Michael 'Mickey' Lauer | ||
5 | <mickey@tm.informatik.uni-frankfurt.de> | ||
6 | =. | ||
7 | .=l. | ||
8 | .>+-= | ||
9 | _;:, .> :=|. This program is free software; you can | ||
10 | .> <`_, > . <= redistribute it and/or modify it under | ||
11 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
12 | .="- .-=="i, .._ License as published by the Free Software | ||
13 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
14 | ._= =} : or (at your option) any later version. | ||
15 | .%`+i> _;_. | ||
16 | .i_,=:_. -<s. This program is distributed in the hope that | ||
17 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
18 | : .. .:, . . . without even the implied warranty of | ||
19 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
20 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
21 | ..}^=.= = ; Library General Public License for more | ||
22 | ++= -. .` .: details. | ||
23 | : = ...= . :.=- | ||
24 | -. .:....=;==+<; You should have received a copy of the GNU | ||
25 | -_. . . )=. = Library General Public License along with | ||
26 | -- :-=` this library; see the file COPYING.LIB. | ||
27 | If not, write to the Free Software Foundation, | ||
28 | Inc., 59 Temple Place - Suite 330, | ||
29 | Boston, MA 02111-1307, USA. | ||
30 | |||
31 | */ | ||
32 | |||
33 | #ifndef OLISTVIEW_H | ||
34 | #define OLISTVIEW_H | ||
35 | |||
36 | #include <qcolor.h> | ||
37 | #include <qlistview.h> | ||
38 | #include <qpen.h> | ||
39 | #include <qdatastream.h> | ||
40 | |||
41 | class OListViewItem; | ||
42 | |||
43 | /** | ||
44 | * A @ref QListView variant featuring visual and functional enhancements | ||
45 | * like an alternate background for odd rows, an autostretch mode | ||
46 | * for the width of the widget ( >= Qt 3 only ) and persistence capabilities. | ||
47 | * | ||
48 | * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> | ||
49 | * @short OListView list/tree widget. | ||
50 | */ | ||
51 | class OListView: public QListView | ||
52 | { | ||
53 | public: | ||
54 | /** | ||
55 | * Constructor. | ||
56 | * | ||
57 | * The parameters @p parent and @p name are handled by | ||
58 | * @ref QListView, as usual. | ||
59 | */ | ||
60 | OListView ( QWidget *parent = 0, const char *name = 0 ); | ||
61 | |||
62 | /** | ||
63 | * Destructor. | ||
64 | */ | ||
65 | virtual ~OListView(); | ||
66 | |||
67 | /** | ||
68 | * Let the last column fit exactly all the available width. | ||
69 | */ | ||
70 | void setFullWidth( bool fullWidth ); | ||
71 | |||
72 | /** | ||
73 | * Returns whether the last column is set to fit the available width. | ||
74 | */ | ||
75 | bool fullWidth() const; | ||
76 | |||
77 | /** | ||
78 | * Reimplemented for full width support | ||
79 | */ | ||
80 | virtual int addColumn( const QString& label, int width = -1 ); | ||
81 | |||
82 | /** | ||
83 | * Reimplemented for full width support | ||
84 | */ | ||
85 | virtual int addColumn( const QIconSet& iconset, const QString& label, int width = -1 ); | ||
86 | |||
87 | /** | ||
88 | * Reimplemented for full width support | ||
89 | */ | ||
90 | virtual void removeColumn(int index); | ||
91 | |||
92 | /** | ||
93 | * sets the alternate background background color. | ||
94 | * This only has an effect if the items are OListViewItems | ||
95 | * | ||
96 | * @param c the color to use for every other item. Set to an invalid | ||
97 | * color to disable alternate colors. | ||
98 | */ | ||
99 | void setAlternateBackground( const QColor &c ); | ||
100 | |||
101 | /** | ||
102 | * sets the column separator pen. | ||
103 | * | ||
104 | * @param p the pen used to draw the column separator. | ||
105 | */ | ||
106 | void setColumnSeparator( const QPen &p ); | ||
107 | |||
108 | /** | ||
109 | * @return the alternate background color | ||
110 | */ | ||
111 | const QColor& alternateBackground() const; | ||
112 | |||
113 | /** | ||
114 | * @return the column separator pen | ||
115 | */ | ||
116 | const QPen& columnSeparator() const; | ||
117 | |||
118 | /** | ||
119 | * create a list view item as child of this object | ||
120 | * @return the new object | ||
121 | */ | ||
122 | virtual OListViewItem* childFactory(); | ||
123 | |||
124 | #ifndef QT_NO_DATASTREAM | ||
125 | /** | ||
126 | * serialize this object to a @ref QDataStream | ||
127 | * @param s the stream used to serialize this object. | ||
128 | */ | ||
129 | virtual void serializeTo( QDataStream& s ) const; | ||
130 | |||
131 | /** | ||
132 | * serialize this object from a @ref QDataStream | ||
133 | * @param s the stream used to serialize this object. | ||
134 | */ | ||
135 | virtual void serializeFrom( QDataStream& s ); | ||
136 | #endif | ||
137 | |||
138 | private: | ||
139 | QColor m_alternateBackground; | ||
140 | bool m_fullWidth; | ||
141 | QPen m_columnSeparator; | ||
142 | }; | ||
143 | |||
144 | #ifndef QT_NO_DATASTREAM | ||
145 | /** | ||
146 | * \relates QListView | ||
147 | * Writes a listview to the stream and returns a reference to the stream. | ||
148 | */ | ||
149 | QDataStream& operator<<( QDataStream& s, const OListView& lv ); | ||
150 | /** | ||
151 | * \relates QListView | ||
152 | * Reads a listview from the stream and returns a reference to the stream. | ||
153 | */ | ||
154 | QDataStream& operator>>( QDataStream& s, OListView& lv ); | ||
155 | #endif // QT_NO_DATASTREAM | ||
156 | |||
157 | //****************************** OListViewItem ****************************************************************** | ||
158 | |||
159 | class OListViewItem: public QListViewItem | ||
160 | { | ||
161 | public: | ||
162 | OListViewItem( QListView * parent ); | ||
163 | OListViewItem( QListViewItem * parent ); | ||
164 | OListViewItem( QListView * parent, QListViewItem * after ); | ||
165 | OListViewItem( QListViewItem * parent, QListViewItem * after ); | ||
166 | |||
167 | OListViewItem( QListView * parent, | ||
168 | QString, QString = QString::null, | ||
169 | QString = QString::null, QString = QString::null, | ||
170 | QString = QString::null, QString = QString::null, | ||
171 | QString = QString::null, QString = QString::null ); | ||
172 | |||
173 | OListViewItem( QListViewItem * parent, | ||
174 | QString, QString = QString::null, | ||
175 | QString = QString::null, QString = QString::null, | ||
176 | QString = QString::null, QString = QString::null, | ||
177 | QString = QString::null, QString = QString::null ); | ||
178 | |||
179 | OListViewItem( QListView * parent, QListViewItem * after, | ||
180 | QString, QString = QString::null, | ||
181 | QString = QString::null, QString = QString::null, | ||
182 | QString = QString::null, QString = QString::null, | ||
183 | QString = QString::null, QString = QString::null ); | ||
184 | |||
185 | OListViewItem( QListViewItem * parent, QListViewItem * after, | ||
186 | QString, QString = QString::null, | ||
187 | QString = QString::null, QString = QString::null, | ||
188 | QString = QString::null, QString = QString::null, | ||
189 | QString = QString::null, QString = QString::null ); | ||
190 | |||
191 | virtual ~OListViewItem(); | ||
192 | |||
193 | const QColor& backgroundColor(); | ||
194 | bool isAlternate(); | ||
195 | void paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int alignment ); | ||
196 | void init(); | ||
197 | |||
198 | /** | ||
199 | * create a list view item as child of this object | ||
200 | * @return the new object | ||
201 | */ | ||
202 | virtual OListViewItem* childFactory(); | ||
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 | |||
218 | private: | ||
219 | bool m_known; | ||
220 | bool m_odd; | ||
221 | }; | ||
222 | |||
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 | ||