summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2005-05-17 10:18:18 (UTC)
committer mickeyl <mickeyl>2005-05-17 10:18:18 (UTC)
commitcce15d6b9a27880df72ea2638f9295900ea6c21e (patch) (unidiff)
tree86a03b32e5fbac908eb96cadc7cc2e620ac1f213
parentc31a425a9a080238569f7c04372f10fc6cc10383 (diff)
downloadopie-cce15d6b9a27880df72ea2638f9295900ea6c21e.zip
opie-cce15d6b9a27880df72ea2638f9295900ea6c21e.tar.gz
opie-cce15d6b9a27880df72ea2638f9295900ea6c21e.tar.bz2
remove OVersatileView and OVersatileViewItem from libopieui2. This widget
wasn't used in any application, it wasn't even completed and with the QListView in Qt4, there is something more thought-out coming soon.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opieui/opieui.pro14
-rw-r--r--libopie2/opieui/oversatileview.cpp1172
-rw-r--r--libopie2/opieui/oversatileview.h399
-rw-r--r--libopie2/opieui/oversatileviewitem.cpp134
-rw-r--r--libopie2/opieui/oversatileviewitem.h105
5 files changed, 5 insertions, 1819 deletions
diff --git a/libopie2/opieui/opieui.pro b/libopie2/opieui/opieui.pro
index 5525ea2..4c92ece 100644
--- a/libopie2/opieui/opieui.pro
+++ b/libopie2/opieui/opieui.pro
@@ -1,65 +1,61 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qt warn_on 2CONFIG += qt warn_on
3DESTDIR = $(OPIEDIR)/lib 3DESTDIR = $(OPIEDIR)/lib
4HEADERS = oclickablelabel.h \ 4HEADERS = oclickablelabel.h \
5 odialog.h \ 5 odialog.h \
6 ofontselector.h \ 6 ofontselector.h \
7 oimageeffect.h \ 7 oimageeffect.h \
8 okeyconfigwidget.h \ 8 okeyconfigwidget.h \
9 oledbox.h \ 9 oledbox.h \
10 olistview.h \ 10 olistview.h \
11 opixmapeffect.h \ 11 opixmapeffect.h \
12 opopupmenu.h \ 12 opopupmenu.h \
13 opixmapprovider.h \ 13 opixmapprovider.h \
14 oselector.h \ 14 oselector.h \
15 oseparator.h \ 15 oseparator.h \
16 otabinfo.h \ 16 otabinfo.h \
17 otabbar.h \ 17 otabbar.h \
18 otabwidget.h \ 18 otabwidget.h \
19 otaskbarapplet.h \ 19 otaskbarapplet.h \
20 otimepicker.h \ 20 otimepicker.h \
21 oversatileview.h \
22 oversatileviewitem.h \
23 owait.h 21 owait.h
24 22
25SOURCES = oclickablelabel.cpp \ 23SOURCES = oclickablelabel.cpp \
26 odialog.cpp \ 24 odialog.cpp \
27 ofontselector.cpp \ 25 ofontselector.cpp \
28 oimageeffect.cpp \ 26 oimageeffect.cpp \
29 okeyconfigwidget.cpp \ 27 okeyconfigwidget.cpp \
30 oledbox.cpp \ 28 oledbox.cpp \
31 olistview.cpp \ 29 olistview.cpp \
32 opixmapeffect.cpp \ 30 opixmapeffect.cpp \
33 opopupmenu.cpp \ 31 opopupmenu.cpp \
34 opixmapprovider.cpp \ 32 opixmapprovider.cpp \
35 oselector.cpp \ 33 oselector.cpp \
36 oseparator.cpp \ 34 oseparator.cpp \
37 otabbar.cpp \ 35 otabbar.cpp \
38 otabwidget.cpp \ 36 otabwidget.cpp \
39 otaskbarapplet.cpp \ 37 otaskbarapplet.cpp \
40 otimepicker.cpp \ 38 otimepicker.cpp \
41 oversatileview.cpp \
42 oversatileviewitem.cpp \
43 owait.cpp 39 owait.cpp
44 40
45include( big-screen/big-screen.pro ) 41include( big-screen/big-screen.pro )
46include( fileselector/fileselector.pro ) 42include( fileselector/fileselector.pro )
47 43
48INTERFACES = otimepickerbase.ui 44INTERFACES = otimepickerbase.ui
49 45
50TARGET = opieui2 46TARGET = opieui2
51VERSION = 1.9.1 47VERSION = 1.9.2
52 48
53INCLUDEPATH += $(OPIEDIR)/include 49INCLUDEPATH += $(OPIEDIR)/include
54DEPENDPATH += $(OPIEDIR)/include 50DEPENDPATH += $(OPIEDIR)/include
55 51
56LIBS += -lopiecore2 52LIBS += -lopiecore2
57 53
58!contains( platform, x11 ) { 54!contains( platform, x11 ) {
59 include( $(OPIEDIR)/include.pro ) 55 include( $(OPIEDIR)/include.pro )
60} 56}
61 57
62contains( platform, x11 ) { 58contains( platform, x11 ) {
63 LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib 59 LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib
64} 60}
65 61
diff --git a/libopie2/opieui/oversatileview.cpp b/libopie2/opieui/oversatileview.cpp
deleted file mode 100644
index f6c6410..0000000
--- a/libopie2/opieui/oversatileview.cpp
+++ b/dev/null
@@ -1,1172 +0,0 @@
1/*
2                 This file is part of the Opie Project
3
4 =. (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de>
5 .=l.
6           .>+-=
7 _;:,     .>    :=|. This program is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This program is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.=       =       ; Library General Public License for more
20++=   -.     .`     .: details.
21 :     =  ...= . :.=-
22 -.   .:....=;==+<; You should have received a copy of the GNU
23  -_. . .   )=.  = Library General Public License along with
24    --        :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA.
28
29*/
30
31/* OPIE */
32
33#include <opie2/odebug.h>
34#include <opie2/oversatileview.h>
35#include <opie2/oversatileviewitem.h>
36#include <opie2/olistview.h>
37
38/* QT */
39
40#include <qaction.h>
41#include <qpopupmenu.h>
42
43using namespace Opie::Core;
44using namespace Opie::Ui;
45
46/* XPM */
47static const char * view_icon_xpm[] = {
48"16 16 16 1",
49 " c None",
50 ".c #87BD88",
51 "+c #8BBE8B",
52 "@c #81BA81",
53 "#c #6DAF6D",
54 "$c #87BD87",
55 "%c #FCFDFC",
56 "&c #AED0AE",
57 "*c #4E9C4C",
58 "=c #91BD91",
59 "-c #72B172",
60 ";c #448643",
61 ">c #519F50",
62 ",c #499247",
63 "'c #356A35",
64 ")c #686868",
65" ",
66" .+@# .+@# ",
67" $%&* $%&* ",
68" @=-; @=-; ",
69" #>,' #>,' ",
70" ",
71" )))))) )))))) ",
72" ",
73" ",
74" .+@# .+@# ",
75" $%&* $%&* ",
76" @=-; @=-; ",
77" #>,' #>,' ",
78" ",
79" )))))) )))))) ",
80" "};
81
82/* XPM */
83static const char * view_tree_xpm[] = {
84"16 16 17 1",
85 " c None",
86 ".c #3A3A3A",
87 "+c #87BD88",
88 "@c #8BBE8B",
89 "#c #81BA81",
90 "$c #6DAF6D",
91 "%c #87BD87",
92 "&c #FCFDFC",
93 "*c #AED0AE",
94 "=c #4E9C4C",
95 "-c #91BD91",
96 ";c #72B172",
97 ">c #448643",
98 ",c #686868",
99 "'c #519F50",
100 ")c #499247",
101 "!c #356A35",
102" . ",
103" . ",
104" . +@#$ ",
105" . %&*= ",
106" .. #-;> ,, ,,,",
107" . $')! ",
108" . ",
109" . ",
110" . ",
111" . +@#$ ",
112" . %&*= ",
113" .. #-;> ,, ,,,",
114" $')! ",
115" ",
116" ",
117" "};
118
119OVersatileView::OVersatileView( QWidget* parent, const char* name, int mode )
120 :QWidgetStack( parent, name ),
121 _viewmode( mode ), _warningpolicy( None ),
122 _treeleaf(), _treeopened(), _treeclosed(),
123 _iconleaf(), _iconopened(), _iconclosed()
124{
125 //
126 // Create child widgets and set some reasonable default styles
127 //
128
129 _listview = new OListView( this, "oversatileview embedded listview" );
130 _iconview = new QIconView( this, "oversatileview embedded iconview" );
131
132 _listview->setAllColumnsShowFocus( true );
133 _listview->setRootIsDecorated( true );
134 _listview->setShowSortIndicator( true );
135 _iconview->setGridX( 90 );
136 _iconview->setGridY( 42 );
137 _iconview->setAutoArrange( true );
138
139 #ifdef QWS // TODO: Let this depend on current geometry (rotation)
140 _iconview->setArrangement( QIconView::TopToBottom );
141 #else
142 _iconview->setArrangement( QIconView::LeftToRight );
143 #endif
144
145 _iconview->setResizeMode( QIconView::Adjust );
146
147 // qt-embedded: map stylus right on hold to right button press
148
149 #ifdef QWS
150 ( (QPEApplication*) qApp)->setStylusOperation( _iconview->viewport(), QPEApplication::RightOnHold );
151 ( (QPEApplication*) qApp)->setStylusOperation( _listview->viewport(), QPEApplication::RightOnHold );
152 #endif
153
154 setViewMode( mode ); // TODO: Read last style from config
155 // setSynchronization( true ); // TODO: Implement this
156
157 // create context menu allowing to switch between the views
158
159 _contextmenu = new QPopupMenu( 0, "oversatileview contextmenu" );
160 _contextmenu->setCaption( "Style" );
161 _contextmenu->setCheckable( true );
162 QActionGroup* ag = new QActionGroup( _contextmenu, "style option group" );
163 QAction* a1 = new QAction( "View Items in Icon Style", QIconSet( QPixmap( view_icon_xpm ) ),
164 "View Icons", 0, ag, "viewicon action", true );
165 QAction* a2 = new QAction( "View Items in Tree Style", QIconSet( QPixmap( view_tree_xpm ) ),
166 "View Tree", 0, ag, "viewtree action", true );
167 ag->addTo( _contextmenu );
168 if ( mode == Icons )
169 a1->setOn( true );
170 else if ( mode == Tree )
171 a2->setOn( true );
172 connect( a1, SIGNAL( activated() ), this, SLOT( setIconViewMode() ) );
173 connect( a2, SIGNAL( activated() ), this, SLOT( setTreeViewMode() ) );
174
175 #if (QT_VERSION >= 0x030000)
176 connect( _listview, SIGNAL( contextMenuRequested(QListViewItem*,const QPoint&,int) ), this, SLOT( contextMenuRequested(QListViewItem*,const QPoint&,int) ) );
177 connect( _iconview, SIGNAL( contextMenuRequested(QIconViewItem*,const QPoint&) ), this, SLOT( contextMenuRequested(QIconViewItem*,const QPoint&) ) );
178 #else
179 connect( _listview, SIGNAL( rightButtonPressed(QListViewItem*,const QPoint&,int) ), this, SLOT( contextMenuRequested(QListViewItem*,const QPoint&,int) ) );
180 connect( _iconview, SIGNAL( rightButtonPressed(QIconViewItem*,const QPoint&) ), this, SLOT( contextMenuRequested(QIconViewItem*,const QPoint&) ) );
181 #endif
182
183 //
184 // signal forwarders
185 //
186 // unfortunately we can't short-circuit all the QListView and QIconView signals
187 // to OVersatileView signals, because the signal/slot mechanism doesn't allow
188 // type-conversion :-(
189
190 // common signals for listview
191
192 connect( _listview, SIGNAL( selectionChanged() ), this, SIGNAL( selectionChanged() ) );
193 connect( _listview, SIGNAL( selectionChanged(QListViewItem*) ), this, SLOT( selectionChanged(QListViewItem*) ) );
194 connect( _listview, SIGNAL( currentChanged(QListViewItem*) ), this, SLOT( currentChanged(QListViewItem*) ) );
195 connect( _listview, SIGNAL( clicked(QListViewItem*) ), this, SLOT( clicked(QListViewItem*) ) );
196 connect( _listview, SIGNAL( pressed(QListViewItem*) ), this, SLOT( pressed(QListViewItem*) ) );
197
198 connect( _listview, SIGNAL( doubleClicked(QListViewItem*) ), this, SLOT( doubleClicked(QListViewItem*) ) );
199 connect( _listview, SIGNAL( returnPressed(QListViewItem*) ), this, SLOT( returnPressed(QListViewItem*) ) );
200
201 connect( _listview, SIGNAL( onItem(QListViewItem*) ), this, SLOT( onItem(QListViewItem*) ) );
202 connect( _listview, SIGNAL( onViewport() ), this, SIGNAL( onViewport() ) );
203
204 // common signals for iconview
205
206 connect( _iconview, SIGNAL( selectionChanged() ), this, SIGNAL( selectionChanged() ) );
207 connect( _iconview, SIGNAL( selectionChanged(QIconViewItem*) ), this, SLOT( selectionChanged(QIconViewItem*) ) );
208 connect( _iconview, SIGNAL( currentChanged(QIconViewItem*) ), this, SLOT( currentChanged(QIconViewItem*) ) );
209 connect( _iconview, SIGNAL( clicked(QIconViewItem*) ), this, SLOT( clicked(QIconViewItem*) ) );
210 connect( _iconview, SIGNAL( pressed(QIconViewItem*) ), this, SLOT( pressed(QIconViewItem*) ) );
211
212 connect( _iconview, SIGNAL( doubleClicked(QIconViewItem*) ), this, SLOT( doubleClicked(QIconViewItem*) ) );
213 connect( _iconview, SIGNAL( returnPressed(QIconViewItem*) ), this, SLOT( returnPressed(QIconViewItem*) ) );
214
215 connect( _iconview, SIGNAL( onItem(QIconViewItem*) ), this, SLOT( onItem(QIconViewItem*) ) );
216 connect( _iconview, SIGNAL( onViewport() ), this, SIGNAL( onViewport() ) );
217
218 // listview only signals
219
220 connect( _listview, SIGNAL( expanded(QListViewItem*) ), this, SLOT( expanded(QListViewItem*) ) );
221 connect( _listview, SIGNAL( collapsed(QListViewItem*) ), this, SLOT( collapsed(QListViewItem*) ) );
222
223 // iconview only signals
224
225 connect( _iconview, SIGNAL( moved() ), this, SIGNAL( moved() ) );
226}
227
228OVersatileView::~OVersatileView()
229{
230}
231
232QPopupMenu* OVersatileView::contextMenu() const
233{
234 return _contextmenu;
235}
236
237void OVersatileView::contextMenuRequested( QListViewItem* item, const QPoint& pos, int col )
238{
239 // can't use QObject::inherits here, because ListViewItems, beit Q, O or K,
240 // do not inherit from QObject - assuming here the programmer is
241 // disciplined enough to only add OVersatileViewItems to an OVersatileView
242 popupContextMenu( static_cast<OVersatileViewItem*>( item ), pos, col );
243}
244
245void OVersatileView::contextMenuRequested( QIconViewItem* item, const QPoint& pos )
246{
247 // see above
248 popupContextMenu( static_cast<OVersatileViewItem*>( item ), pos, -1 );
249}
250
251void OVersatileView::popupContextMenu( OVersatileViewItem* item, const QPoint& pos, int col )
252{
253 if ( !item )
254 _contextmenu->exec( pos );
255 else
256 emit( contextMenuRequested( item, pos, col ) );
257}
258
259void OVersatileView::setSynchronization( bool sync )
260{
261 _synchronization = sync;
262}
263
264bool OVersatileView::synchronization()
265{
266 return _synchronization;
267}
268
269void OVersatileView::setDefaultPixmaps( int mode, QPixmap& leaf, QPixmap& opened, QPixmap& closed )
270{
271 if ( mode == Tree )
272 {
273 _treeleaf = leaf;
274 _treeopened = opened;
275 _treeclosed = closed;
276 }
277 else if ( mode == Icons )
278 {
279 _iconleaf = leaf;
280 _iconopened = opened;
281 _iconclosed = closed;
282 }
283 else
284 {
285 odebug << "OVersatileView::setDefaultPixmaps(): invalid mode" << oendl;
286 }
287}
288
289QIconView* OVersatileView::iconView() const
290{
291 return _iconview;
292}
293
294OListView* OVersatileView::listView() const
295{
296 return _listview;
297}
298
299void OVersatileView::setViewMode( int mode )
300{
301 if ( mode == Tree )
302 {
303 _viewmode = mode;
304 raiseWidget( _listview );
305 }
306 else if ( mode == Icons )
307 {
308 _viewmode = mode;
309 raiseWidget( _iconview );
310 }
311 else
312 {
313 odebug << "OVersatileView::setViewMode(): invalid mode" << oendl;
314 }
315}
316
317void OVersatileView::setIconViewMode()
318{
319 setViewMode( Icons );
320}
321
322void OVersatileView::setTreeViewMode()
323{
324 setViewMode( Tree );
325}
326
327bool OVersatileView::isValidViewMode( int mode ) const
328{
329 switch ( _warningpolicy )
330 {
331 case OVersatileView::None:
332 {
333 return true;
334 }
335 case OVersatileView::Warn:
336 {
337 if ( _viewmode != mode )
338 {
339 odebug << "OVersatileView::isValidViewMode(): Requested operation not valid in current mode." << oendl;
340 return true;
341 }
342 }
343 case OVersatileView::WarnReturn:
344 {
345 if ( _viewmode != mode )
346 {
347 odebug << "OVersatileView::isValidViewMode(): Requested operation not valid in current mode." << oendl;
348 return false;
349 }
350 }
351 default:
352 {
353 owarn << "OVersatileView::isValidViewMode(): Inconsistent object state!" << oendl;
354 return true;
355 }
356 }
357}
358void OVersatileView::setWarningPolicy( int policy ) const
359{
360 _warningpolicy = policy;
361}
362bool OVersatileView::warningPolicy() const
363{
364 return _warningpolicy;
365}
366//==============================================================================================//
367// Stupid Signal forwarders...
368// Folks, this is why I like python with its dynamic typing:
369// I can code the following dozens of lines C++ in four Python lines...
370//==============================================================================================//
371
372void OVersatileView::selectionChanged( QListViewItem * item )
373{
374 emit( selectionChanged( static_cast<OVersatileViewItem*>( item ) ) );
375}
376
377void OVersatileView::selectionChanged( QIconViewItem * item )
378{
379 emit( selectionChanged( static_cast<OVersatileViewItem*>( item ) ) );
380}
381
382void OVersatileView::currentChanged( QListViewItem * item )
383{
384 emit( currentChanged( static_cast<OVersatileViewItem*>( item ) ) );
385}
386
387void OVersatileView::currentChanged( QIconViewItem * item )
388{
389 emit( currentChanged( static_cast<OVersatileViewItem*>( item ) ) );
390}
391
392void OVersatileView::clicked( QListViewItem * item )
393{
394 emit( clicked( static_cast<OVersatileViewItem*>( item ) ) );
395}
396
397void OVersatileView::clicked( QIconViewItem * item )
398{
399 emit( clicked( static_cast<OVersatileViewItem*>( item ) ) );
400}
401
402void OVersatileView::pressed( QListViewItem * item )
403{
404 emit( pressed( static_cast<OVersatileViewItem*>( item ) ) );
405}
406
407void OVersatileView::pressed( QIconViewItem * item )
408{
409 emit( pressed( static_cast<OVersatileViewItem*>( item ) ) );
410}
411
412void OVersatileView::doubleClicked( QListViewItem * item )
413{
414 emit( doubleClicked( static_cast<OVersatileViewItem*>( item ) ) );
415}
416
417void OVersatileView::doubleClicked( QIconViewItem * item )
418{
419 emit( doubleClicked( static_cast<OVersatileViewItem*>( item ) ) );
420}
421
422void OVersatileView::returnPressed( QListViewItem * item )
423{
424 emit( returnPressed( static_cast<OVersatileViewItem*>( item ) ) );
425}
426
427void OVersatileView::returnPressed( QIconViewItem * item )
428{
429 emit( returnPressed( static_cast<OVersatileViewItem*>( item ) ) );
430}
431
432void OVersatileView::onItem( QListViewItem * item )
433{
434 emit( onItem( static_cast<OVersatileViewItem*>( item ) ) );
435}
436
437void OVersatileView::onItem( QIconViewItem * item )
438{
439 emit( onItem( static_cast<OVersatileViewItem*>( item ) ) );
440}
441
442void OVersatileView::expanded( QListViewItem *item ) // QListView
443{
444 //odebug << "OVersatileView::expanded(): opening tree..." << oendl;
445 if ( !_treeopened.isNull() )
446 item->setPixmap( 0, _treeopened );
447 emit( expanded( static_cast<OVersatileViewItem*>( item ) ) );
448}
449void OVersatileView::collapsed( QListViewItem *item ) // QListView
450{
451 if ( !_treeclosed.isNull() )
452 item->setPixmap( 0, _treeclosed );
453 emit( collapsed( static_cast<OVersatileViewItem*>( item ) ) );
454}
455
456//=============================================================================================//
457// OVersatileView Case I - API only existing in QListView or QIconView but not in both!
458//==============================================================================================//
459
460int OVersatileView::treeStepSize() const // QListView
461{
462 if ( !isValidViewMode( Tree ) )
463 {
464 return -1;
465 }
466 return _listview->treeStepSize();
467}
468 void OVersatileView::setTreeStepSize( int size ) // QListView
469{
470 if ( !isValidViewMode( Tree ) )
471 {
472 return;
473 }
474 _listview->setTreeStepSize( size );
475}
476
477QHeader * OVersatileView::header() const // QListView
478{
479 if ( !isValidViewMode( Tree ) )
480 {
481 return 0;
482 }
483 return _listview->header();
484}
485
486 int OVersatileView::addColumn( const QString &label, int size ) // QListView
487{
488 if ( !isValidViewMode( Tree ) )
489 {
490 return -1;
491 }
492 return _listview->addColumn( label, size );
493}
494
495 int OVersatileView::addColumn( const QIconSet& iconset, const QString &label, int size ) // QListView
496{
497 if ( !isValidViewMode( Tree ) )
498 {
499 return -1;
500 }
501 return _listview->addColumn( iconset, label, size );
502}
503
504void OVersatileView::removeColumn( int index ) // QListView
505{
506 if ( !isValidViewMode( Tree ) )
507 {
508 return;
509 }
510 _listview->removeColumn( index );
511}
512 void OVersatileView::setColumnText( int column, const QString &label ) // QListView
513{
514 if ( !isValidViewMode( Tree ) )
515 {
516 return;
517 }
518 _listview->setColumnText( column, label );
519}
520 void OVersatileView::setColumnText( int column, const QIconSet& iconset, const QString &label ) // QListView
521{
522 if ( !isValidViewMode( Tree ) )
523 {
524 return;
525 }
526 _listview->setColumnText( column, iconset, label );
527}
528QString OVersatileView::columnText( int column ) const // QListView
529{
530 if ( !isValidViewMode( Tree ) )
531 {
532 return QString::null;
533 }
534 return _listview->columnText( column );
535}
536 void OVersatileView::setColumnWidth( int column, int width ) // QListView
537{
538 if ( !isValidViewMode( Tree ) )
539 {
540 return;
541 }
542 _listview->setColumnWidth( column, width );
543}
544int OVersatileView::columnWidth( int column ) const // QListView
545{
546 if ( !isValidViewMode( Tree ) )
547 {
548 return -1;
549 }
550 return _listview->columnWidth( column );
551}
552 void OVersatileView::setColumnWidthMode( int column, WidthMode mode ) // QListView
553{
554 if ( !isValidViewMode( Tree ) )
555 {
556 return;
557 }
558 _listview->setColumnWidth( column, mode );
559}
560int OVersatileView::columns() const // QListView
561{
562 if ( !isValidViewMode( Tree ) )
563 {
564 return -1;
565 }
566 return _listview->columns();
567}
568
569 void OVersatileView::setColumnAlignment( int column, int align ) // QListView
570{
571 if ( !isValidViewMode( Tree ) )
572 {
573 return;
574 }
575 _listview->setColumnAlignment( column, align );
576}
577int OVersatileView::columnAlignment( int column ) const // QListView
578{
579 if ( !isValidViewMode( Tree ) )
580 {
581 return -1;
582 }
583 return _listview->columnAlignment( column );
584}
585
586OVersatileViewItem * OVersatileView::itemAt( const QPoint & screenPos ) const // QListView
587{
588 if ( !isValidViewMode( Tree ) )
589 {
590 return 0;
591 }
592 return static_cast<OVersatileViewItem*>( _listview->itemAt( screenPos ) );
593}
594QRect OVersatileView::itemRect( const OVersatileViewItem * item ) const // QListView
595{
596 if ( !isValidViewMode( Tree ) )
597 {
598 return QRect( -1, -1, -1, -1 );
599 }
600 return _listview->itemRect( item );
601}
602int OVersatileView::itemPos( const OVersatileViewItem * item ) // QListView
603{
604 if ( !isValidViewMode( Tree ) )
605 {
606 return -1;
607 }
608 return _listview->itemPos( item );
609}
610
611bool OVersatileView::isSelected( const OVersatileViewItem * item ) const // QListView // also in QIconViewItem but !in QIconView *shrug*
612{
613 if ( !isValidViewMode( Tree ) )
614 {
615 return false;
616 }
617 return _listview->isSelected( item );
618}
619
620 void OVersatileView::setMultiSelection( bool enable )
621{
622 _listview->setMultiSelection( enable );
623}
624bool OVersatileView::isMultiSelection() const
625{
626 return _listview->isMultiSelection();
627}
628
629OVersatileViewItem * OVersatileView::selectedItem() const // QListView
630{
631 if ( !isValidViewMode( Tree ) )
632 {
633 return 0;
634 }
635 return static_cast<OVersatileViewItem*>( _listview->selectedItem() );
636}
637 void OVersatileView::setOpen( OVersatileViewItem * item, bool open ) // QListView
638{
639 if ( !isValidViewMode( Tree ) )
640 {
641 return;
642 }
643 _listview->setOpen( item, open );
644}
645bool OVersatileView::isOpen( const OVersatileViewItem * item ) const // QListView
646{
647 if ( !isValidViewMode( Tree ) )
648 {
649 return false;
650 }
651 return _listview->isOpen( item );
652}
653
654OVersatileViewItem * OVersatileView::firstChild() const // QListView
655{
656 if ( !isValidViewMode( Tree ) )
657 {
658 return 0;
659 }
660 return static_cast<OVersatileViewItem*>( _listview->firstChild() );
661}
662int OVersatileView::childCount() const // QListView
663{
664 if ( !isValidViewMode( Tree ) )
665 {
666 return -1;
667 }
668 return _listview->childCount();
669}
670
671 void OVersatileView::setAllColumnsShowFocus( bool focus ) // QListView
672{
673 if ( !isValidViewMode( Tree ) )
674 {
675 return;
676 }
677 _listview->setAllColumnsShowFocus( focus );
678}
679bool OVersatileView::allColumnsShowFocus() const // QListView
680{
681 if ( !isValidViewMode( Tree ) )
682 {
683 return false;
684 }
685 return _listview->allColumnsShowFocus();
686}
687
688 void OVersatileView::setItemMargin( int margin ) // QListView
689{
690 if ( !isValidViewMode( Tree ) )
691 {
692 return;
693 }
694 _listview->setItemMargin( margin );
695}
696int OVersatileView::itemMargin() const // QListView
697{
698 if ( !isValidViewMode( Tree ) )
699 {
700 return -1;
701 }
702 return _listview->itemMargin();
703}
704
705 void OVersatileView::setRootIsDecorated( bool decorate ) // QListView
706{
707 if ( !isValidViewMode( Tree ) )
708 {
709 return;
710 }
711 _listview->setRootIsDecorated( decorate );
712}
713bool OVersatileView::rootIsDecorated() const // QListView
714{
715 if ( !isValidViewMode( Tree ) )
716 {
717 return false;
718 }
719 return _listview->rootIsDecorated();
720}
721
722void OVersatileView::setShowSortIndicator( bool show ) // QListView
723{
724 if ( !isValidViewMode( Tree ) )
725 {
726 return;
727 }
728 _listview->setShowSortIndicator( show );
729}
730bool OVersatileView::showSortIndicator() const // QListView
731{
732 if ( !isValidViewMode( Tree ) )
733 {
734 return false;
735 }
736 return _listview->showSortIndicator();
737}
738
739void OVersatileView::triggerUpdate() // QListView
740{
741 if ( !isValidViewMode( Tree ) )
742 {
743 return;
744 }
745 _listview->triggerUpdate();
746}
747
748//
749// only in QIconView
750//
751
752uint OVersatileView::count() const // QIconView
753{
754 if ( !isValidViewMode( Icons ) )
755 {
756 return 0;
757 }
758 return _iconview->count();
759}
760
761int OVersatileView::index( const OVersatileViewItem *item ) const // QIconView
762{
763 if ( !isValidViewMode( Icons ) )
764 {
765 return -1;
766 }
767 return _iconview->index( item );
768}
769
770OVersatileViewItem* OVersatileView::firstItem() const // QIconView
771{
772 if ( !isValidViewMode( Icons ) )
773 {
774 return 0;
775 }
776 return static_cast<OVersatileViewItem*>( _iconview->firstItem() );
777}
778OVersatileViewItem* OVersatileView::lastItem() const // QIconView
779{
780 if ( !isValidViewMode( Icons ) )
781 {
782 return 0;
783 }
784 return static_cast<OVersatileViewItem*>( _iconview->lastItem() );
785}
786
787OVersatileViewItem* OVersatileView::findItem( const QPoint &pos ) const // QIconView
788{
789 if ( !isValidViewMode( Icons ) )
790 {
791 return 0;
792 }
793 return static_cast<OVersatileViewItem*>( _iconview->findItem( pos ) );
794}
795OVersatileViewItem* OVersatileView::findItem( const QString &text ) const // QIconView
796{
797 if ( !isValidViewMode( Icons ) )
798 {
799 return 0;
800 }
801 return static_cast<OVersatileViewItem*>( _iconview->findItem( text ) );
802}
803
804OVersatileViewItem* OVersatileView::findFirstVisibleItem( const QRect &r ) const // QIconView
805{
806 if ( !isValidViewMode( Icons ) )
807 {
808 return 0;
809 }
810 return static_cast<OVersatileViewItem*>( _iconview->findFirstVisibleItem( r ) );
811}
812OVersatileViewItem* OVersatileView::findLastVisibleItem( const QRect &r ) const // QIconView
813{
814 if ( !isValidViewMode( Icons ) )
815 {
816 return 0;
817 }
818 return static_cast<OVersatileViewItem*>( _iconview->findLastVisibleItem( r ) );
819}
820
821 void OVersatileView::setGridX( int rx ) // QIconView
822{
823 if ( !isValidViewMode( Icons ) )
824 {
825 return;
826 }
827 _iconview->setGridX( rx );
828}
829 void OVersatileView::setGridY( int ry ) // QIconView
830{
831 if ( !isValidViewMode( Icons ) )
832 {
833 return;
834 }
835 _iconview->setGridY( ry );
836}
837int OVersatileView::gridX() const // QIconView
838{
839 if ( !isValidViewMode( Icons ) )
840 {
841 return -1;
842 }
843 return _iconview->gridX();
844}
845int OVersatileView::gridY() const // QIconView
846{
847 if ( !isValidViewMode( Icons ) )
848 {
849 return -1;
850 }
851 return _iconview->gridY();
852}
853 void OVersatileView::setSpacing( int sp ) // QIconView
854{
855 if ( !isValidViewMode( Icons ) )
856 {
857 return;
858 }
859 _iconview->setSpacing( sp );
860}
861int OVersatileView::spacing() const // QIconView
862{
863 if ( !isValidViewMode( Icons ) )
864 {
865 return -1;
866 }
867 return _iconview->spacing();
868}
869 void OVersatileView::setItemTextPos( QIconView::ItemTextPos pos ) // QIconView
870{
871 if ( !isValidViewMode( Icons ) )
872 {
873 return;
874 }
875 _iconview->setItemTextPos( pos );
876}
877QIconView::ItemTextPos OVersatileView::itemTextPos() const // QIconView
878{
879 if ( !isValidViewMode( Icons ) )
880 {
881 return (QIconView::ItemTextPos) -1;
882 }
883 return _iconview->itemTextPos();
884}
885 void OVersatileView::setItemTextBackground( const QBrush &b ) // QIconView
886{
887 if ( !isValidViewMode( Icons ) )
888 {
889 return;
890 }
891 _iconview->setItemTextBackground( b );
892}
893QBrush OVersatileView::itemTextBackground() const // QIconView
894{
895 if ( !isValidViewMode( Icons ) )
896 {
897 return QBrush();
898 }
899 return _iconview->itemTextBackground();
900}
901 void OVersatileView::setArrangement( QIconView::Arrangement am ) // QIconView
902{
903 if ( !isValidViewMode( Icons ) )
904 {
905 return;
906 }
907 _iconview->setArrangement( am );
908}
909QIconView::Arrangement OVersatileView::arrangement() const // QIconView
910{
911 if ( !isValidViewMode( Icons ) )
912 {
913 return (QIconView::Arrangement) -1;
914 }
915 return _iconview->arrangement();
916}
917 void OVersatileView::setResizeMode( QIconView::ResizeMode am ) // QIconView
918{
919 if ( !isValidViewMode( Icons ) )
920 {
921 return;
922 }
923 _iconview->setResizeMode( am );
924}
925QIconView::ResizeMode OVersatileView::resizeMode() const // QIconView
926{
927 if ( !isValidViewMode( Icons ) )
928 {
929 return (QIconView::ResizeMode) -1;
930 }
931 return _iconview->resizeMode();
932}
933 void OVersatileView::setMaxItemWidth( int w ) // QIconView
934{
935 if ( !isValidViewMode( Icons ) )
936 {
937 return;
938 }
939 _iconview->setMaxItemWidth( w );
940}
941int OVersatileView::maxItemWidth() const // QIconView
942{
943 if ( !isValidViewMode( Icons ) )
944 {
945 return -1;
946 }
947 return _iconview->maxItemWidth();
948}
949 void OVersatileView::setMaxItemTextLength( int w ) // QIconView
950{
951 if ( !isValidViewMode( Icons ) )
952 {
953 return;
954 }
955 _iconview->setMaxItemTextLength( w );
956}
957int OVersatileView::maxItemTextLength() const // QIconView
958{
959 if ( !isValidViewMode( Icons ) )
960 {
961 return -1;
962 }
963 return _iconview->maxItemTextLength();
964}
965 void OVersatileView::setAutoArrange( bool b ) // QIconView
966{
967 if ( !isValidViewMode( Icons ) )
968 {
969 return;
970 }
971 _iconview->setAutoArrange( b );
972}
973bool OVersatileView::autoArrange() const // QIconView
974{
975 if ( !isValidViewMode( Icons ) )
976 {
977 return false;
978 }
979 return _iconview->autoArrange();
980}
981 void OVersatileView::setShowToolTips( bool b ) // QIconView
982{
983 if ( !isValidViewMode( Icons ) )
984 {
985 return;
986 }
987 _iconview->setShowToolTips( b );
988}
989bool OVersatileView::showToolTips() const // QIconView
990{
991 if ( !isValidViewMode( Icons ) )
992 {
993 return false;
994 }
995 return _iconview->showToolTips();
996}
997
998bool OVersatileView::sorting() const // QIconView
999{
1000 if ( !isValidViewMode( Icons ) )
1001 {
1002 return false;
1003 }
1004 return _iconview->sorting();
1005}
1006bool OVersatileView::sortDirection() const // QIconView
1007{
1008 if ( !isValidViewMode( Icons ) )
1009 {
1010 return false;
1011 }
1012 return _iconview->sortDirection();
1013}
1014
1015 void OVersatileView::setItemsMovable( bool b ) // QIconView
1016{
1017 if ( !isValidViewMode( Icons ) )
1018 {
1019 return;
1020 }
1021 _iconview->setItemsMovable( b );
1022}
1023bool OVersatileView::itemsMovable() const // QIconView
1024{
1025 if ( !isValidViewMode( Icons ) )
1026 {
1027 return false;
1028 }
1029 return _iconview->itemsMovable();
1030}
1031void OVersatileView::setWordWrapIconText( bool b ) // QIconView
1032{
1033 if ( !isValidViewMode( Icons ) )
1034 {
1035 return;
1036 }
1037 _iconview->setWordWrapIconText( b );
1038}
1039bool OVersatileView::wordWrapIconText() const // QIconView
1040{
1041 if ( !isValidViewMode( Icons ) )
1042 {
1043 return false;
1044 }
1045 return _iconview->wordWrapIconText();
1046}
1047
1048void OVersatileView::arrangeItemsInGrid( const QSize &grid, bool update ) // QIconView
1049{
1050 if ( !isValidViewMode( Icons ) )
1051 {
1052 return;
1053 }
1054 _iconview->arrangeItemsInGrid( grid, update );
1055}
1056void OVersatileView::arrangeItemsInGrid( bool update ) // QIconView
1057{
1058 if ( !isValidViewMode( Icons ) )
1059 {
1060 return;
1061 }
1062 _iconview->arrangeItemsInGrid( update );
1063}
1064void OVersatileView::updateContents() // QIconView
1065{
1066 if ( !isValidViewMode( Icons ) )
1067 {
1068 return;
1069 }
1070 _iconview->updateContents();
1071}
1072
1073//==============================================================================================//
1074// OVersatileView Case II - QListView / QIconView common API
1075//==============================================================================================//
1076
1077void OVersatileView::clear()
1078{
1079 _iconview->clear();
1080 _listview->clear();
1081}
1082
1083void OVersatileView::setFont( const QFont & font )
1084{
1085 _iconview->setFont( font );
1086 _listview->setFont( font );
1087}
1088void OVersatileView::setPalette( const QPalette & palette )
1089{
1090 _iconview->setPalette( palette );
1091 _listview->setPalette( palette );
1092}
1093
1094void OVersatileView::takeItem( OVersatileViewItem * item )
1095{
1096 _iconview->takeItem( item );
1097 _listview->takeItem( item );
1098}
1099
1100void OVersatileView::setSelectionMode( SelectionMode mode )
1101{
1102 _iconview->setSelectionMode( (QIconView::SelectionMode) mode );
1103 _listview->setSelectionMode( (QListView::SelectionMode) mode );
1104}
1105OVersatileView::SelectionMode OVersatileView::selectionMode() const
1106{
1107 return (OVersatileView::SelectionMode) _iconview->selectionMode();
1108}
1109
1110void OVersatileView::selectAll( bool select )
1111{
1112 _iconview->selectAll( select );
1113}
1114void OVersatileView::clearSelection()
1115{
1116 _iconview->clearSelection();
1117 _listview->clearSelection();
1118}
1119void OVersatileView::invertSelection()
1120{
1121 _iconview->invertSelection();
1122 _listview->invertSelection();
1123}
1124
1125void OVersatileView::ensureItemVisible( const OVersatileViewItem * item )
1126{
1127 _iconview->ensureItemVisible( const_cast<OVersatileViewItem*>( item ) );
1128 _listview->ensureItemVisible( item );
1129}
1130void OVersatileView::repaintItem( const OVersatileViewItem * item ) const
1131{
1132 _iconview->repaintItem( const_cast<OVersatileViewItem*>( item ) );
1133 _listview->repaintItem( item );
1134}
1135
1136void OVersatileView::setCurrentItem( OVersatileViewItem * item )
1137{
1138 _iconview->setCurrentItem( item );
1139 _listview->setCurrentItem( item );
1140}
1141OVersatileViewItem * OVersatileView::currentItem() const
1142{
1143 return static_cast<OVersatileViewItem*>( _listview->currentItem() );
1144}
1145
1146// bool eventFilter( QObject * o, QEvent * ) // use QWidgetStack implementation
1147
1148// QSize minimumSizeHint() const // use QWidgetStack implementation
1149// QSizePolicy sizePolicy() const // use QWidgetStack implementation
1150// QSize sizeHint() const // use QWidgetStack implementation
1151
1152//==============================================================================================//
1153// OVersatileView Case III - APIs which differ slightly
1154//==============================================================================================//
1155
1156/*
1157
1158 void OVersatileView::insertItem( OVersatileViewItem * ) // QListView
1159 void OVersatileView::insertItem( OVersatileViewItem *item, OVersatileViewItem *after = 0L ) // QIconView
1160
1161 void OVersatileView::setSelected( OVersatileViewItem *, bool ) // QListView
1162 void OVersatileView::setSelected( OVersatileViewItem *item, bool s, bool cb = FALSE ) // QIconView
1163
1164 void OVersatileView::setSorting( int column, bool increasing = TRUE ) // QListView
1165void OVersatileView::setSorting( bool sort, bool ascending = TRUE ) // QIconView
1166
1167void OVersatileView::sort() // #### make in next major release // QListView
1168 void OVersatileView::sort( bool ascending = TRUE ) // QIconView
1169
1170*/
1171
1172
diff --git a/libopie2/opieui/oversatileview.h b/libopie2/opieui/oversatileview.h
deleted file mode 100644
index 8cba65c..0000000
--- a/libopie2/opieui/oversatileview.h
+++ b/dev/null
@@ -1,399 +0,0 @@
1/*
2                 This file is part of the Opie Project
3
4 =. (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de>
5 .=l.
6           .>+-=
7 _;:,     .>    :=|. This program is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This program is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.=       =       ; Library General Public License for more
20++=   -.     .`     .: details.
21 :     =  ...= . :.=-
22 -.   .:....=;==+<; You should have received a copy of the GNU
23  -_. . .   )=.  = Library General Public License along with
24    --        :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA.
28
29*/
30
31#ifndef OVERSATILEVIEW_H
32#define OVERSATILEVIEW_H
33
34/* QT */
35
36#include <qwidgetstack.h>
37#include <qiconview.h>
38
39/* OPIE */
40
41#include <opie2/oapplication.h>
42
43/* FORWARDS */
44
45class QHeader;
46class QIconSet;
47class QIconViewItem;
48class QListViewItem;
49class QPopupMenu;
50class QString;
51
52#ifndef QT_NO_DRAGANDDROP
53class QIconDragItem;
54#endif
55
56namespace Opie {
57namespace Ui {
58class OListView;
59
60class OVersatileView : public QWidgetStack
61{
62 Q_OBJECT
63
64 friend class OVersatileViewItem;
65
66 //==============================================================================================//
67 // OVersatileView High Level API
68 //==============================================================================================//
69
70 public:
71 OVersatileView( QWidget* parent = 0, const char* name = 0, int mode = 0 );
72 ~OVersatileView();
73
74 QPopupMenu* contextMenu() const;
75
76 void setSynchronization( bool sync );
77 bool synchronization();
78
79 enum ViewMode { Tree = 0, Icons };
80 int viewMode();
81
82 QIconView* iconView() const;
83 OListView* listView() const;
84
85 enum WarningPolicy { None = 0, Warn, WarnReturn };
86
87 void setWarningPolicy( int ) const; // warn, if calling a method which doesn't apply to the current viewmode
88 bool warningPolicy() const;
89
90 void setDefaultPixmaps( int mode, QPixmap& leaf, QPixmap& opened, QPixmap& closed );
91
92 public slots:
93 void setViewMode( int mode );
94 void setIconViewMode();
95 void setTreeViewMode();
96
97 protected:
98 virtual bool isValidViewMode( int mode ) const;
99 virtual void popupContextMenu( OVersatileViewItem* item, const QPoint& pos, int col = 0 );
100
101 private:
102 int _viewmode;
103 bool _synchronization;
104 mutable int _warningpolicy;
105
106 OListView* _listview;
107 QIconView* _iconview;
108
109 QPixmap _treeleaf;
110 QPixmap _treeopened;
111 QPixmap _treeclosed;
112
113 QPixmap _iconleaf;
114 QPixmap _iconopened;
115 QPixmap _iconclosed;
116
117 QPopupMenu* _contextmenu;
118
119 int _iconstyle;
120 int _treestyle;
121
122 private slots:
123
124 void contextMenuRequested( QListViewItem*, const QPoint&, int );
125 void contextMenuRequested( QIconViewItem*, const QPoint& );
126
127 // type converting signal forwarders
128
129 void selectionChanged( QListViewItem * );
130 void currentChanged( QListViewItem * );
131 void clicked( QListViewItem * );
132 void pressed( QListViewItem * );
133 void doubleClicked( QListViewItem * );
134 void returnPressed( QListViewItem * );
135 void onItem( QListViewItem * );
136
137 void selectionChanged( QIconViewItem * );
138 void currentChanged( QIconViewItem * );
139 void clicked( QIconViewItem * );
140 void pressed( QIconViewItem * );
141 void doubleClicked( QIconViewItem * );
142 void returnPressed( QIconViewItem * );
143 void onItem( QIconViewItem * );
144
145 void expanded( QListViewItem * item ); // QListView
146 void collapsed( QListViewItem * item ); // QListView
147
148 signals:
149
150 void contextMenuRequested( Opie::Ui::OVersatileViewItem * item, const QPoint& pos, int col );
151
152 /*#ifndef QT_NO_DRAGANDDROP
153 void dropped( QDropEvent *e, const QValueList<QIconDragItem> &lst ); // QIconView
154 #endif
155 void itemRenamed( OVersatileViewItem *item, const QString & ); // QIconView
156 void itemRenamed( OVersatileViewItem *item ); // QIconView
157 */
158
159 //==============================================================================================//
160 // "Derived" API - Case 1: Methods existing either only in QListView or only in QIconView
161 //==============================================================================================//
162
163public:
164
165 /*
166 enum Arrangement { // QIconView
167 LeftToRight = 0,
168 TopToBottom
169 };
170 enum ResizeMode { // QIconView
171 Fixed = 0,
172 Adjust
173 };
174 enum ItemTextPos { // QIconView
175 Bottom = 0,
176 Right
177 };
178 */
179
180 //
181 // only in QListView
182 //
183
184 int treeStepSize() const; // QListView
185 virtual void setTreeStepSize( int ); // QListView
186
187 QHeader * header() const; // QListView
188
189 virtual int addColumn( const QString &label, int size = -1); // QListView
190 virtual int addColumn( const QIconSet& iconset, const QString &label, int size = -1); // QListView
191 void removeColumn( int index ); // #### make virtual in next major release! // QListView
192 virtual void setColumnText( int column, const QString &label ); // QListView
193 virtual void setColumnText( int column, const QIconSet& iconset, const QString &label ); // QListView
194 QString columnText( int column ) const; // QListView
195 virtual void setColumnWidth( int column, int width ); // QListView
196 int columnWidth( int column ) const; // QListView
197 enum WidthMode { Manual, Maximum }; // QListView
198 virtual void setColumnWidthMode( int column, WidthMode ); // QListView
199 WidthMode columnWidthMode( int column ) const; // QListView
200 int columns() const; // QListView
201
202 virtual void setColumnAlignment( int, int ); // QListView
203 int columnAlignment( int ) const; // QListView
204
205 OVersatileViewItem * itemAt( const QPoint & screenPos ) const; // QListView
206 QRect itemRect( const OVersatileViewItem * ) const; // QListView
207 int itemPos( const OVersatileViewItem * ); // QListView
208
209 bool isSelected( const OVersatileViewItem * ) const; // QListView // also in QIconViewItem but not in QIconView *shrug*
210
211 virtual void setMultiSelection( bool enable ); // QListView
212 bool isMultiSelection() const; // QListView
213
214 OVersatileViewItem * selectedItem() const; // QListView
215 virtual void setOpen( OVersatileViewItem *, bool ); // QListView
216 bool isOpen( const OVersatileViewItem * ) const; // QListView
217
218 OVersatileViewItem * firstChild() const; // QListView
219 int childCount() const; // QListView
220
221 virtual void setAllColumnsShowFocus( bool ); // QListView
222 bool allColumnsShowFocus() const; // QListView
223
224 virtual void setItemMargin( int ); // QListView
225 int itemMargin() const; // QListView
226
227 virtual void setRootIsDecorated( bool ); // QListView
228 bool rootIsDecorated() const; // QListView
229
230 void setShowSortIndicator( bool show ); // QListView
231 bool showSortIndicator() const; // QListView
232
233 int index( const OVersatileViewItem *item ) const; // QIconView
234
235 public slots:
236 void triggerUpdate(); // QListView
237
238 signals:
239 void expanded( Opie::Ui::OVersatileViewItem *item ); // QListView
240 void collapsed( Opie::Ui::OVersatileViewItem *item ); // QListView
241
242 //
243 // only in QIconView
244 //
245
246 public:
247 uint count() const; // QIconView
248
249 OVersatileViewItem *firstItem() const; // QIconView
250 OVersatileViewItem *lastItem() const; // QIconView
251
252 OVersatileViewItem *findItem( const QPoint &pos ) const; // QIconView
253 OVersatileViewItem *findItem( const QString &text ) const; // QIconView
254
255 OVersatileViewItem* findFirstVisibleItem( const QRect &r ) const; // QIconView
256 OVersatileViewItem* findLastVisibleItem( const QRect &r ) const; // QIconView
257
258 virtual void setGridX( int rx ); // QIconView
259 virtual void setGridY( int ry ); // QIconView
260 int gridX() const; // QIconView
261 int gridY() const; // QIconView
262 virtual void setSpacing( int sp ); // QIconView
263 int spacing() const; // QIconView
264 virtual void setItemTextPos( QIconView::ItemTextPos pos ); // QIconView
265 QIconView::ItemTextPos itemTextPos() const; // QIconView
266 virtual void setItemTextBackground( const QBrush &b ); // QIconView
267 QBrush itemTextBackground() const; // QIconView
268 virtual void setArrangement( QIconView::Arrangement am ); // QIconView
269 QIconView::Arrangement arrangement() const; // QIconView
270 virtual void setResizeMode( QIconView::ResizeMode am ); // QIconView
271 QIconView::ResizeMode resizeMode() const; // QIconView
272 virtual void setMaxItemWidth( int w ); // QIconView
273 int maxItemWidth() const; // QIconView
274 virtual void setMaxItemTextLength( int w ); // QIconView
275 int maxItemTextLength() const; // QIconView
276 virtual void setAutoArrange( bool b ); // QIconView
277 bool autoArrange() const; // QIconView
278 virtual void setShowToolTips( bool b ); // QIconView
279 bool showToolTips() const; // QIconView
280
281 bool sorting() const; // QIconView
282 bool sortDirection() const; // QIconView
283
284 virtual void setItemsMovable( bool b ); // QIconView
285 bool itemsMovable() const; // QIconView
286 virtual void setWordWrapIconText( bool b ); // QIconView
287 bool wordWrapIconText() const; // QIconView
288
289 public slots:
290 virtual void arrangeItemsInGrid( const QSize &grid, bool update = TRUE ); // QIconView
291 virtual void arrangeItemsInGrid( bool update = TRUE ); // QIconView
292 virtual void updateContents(); // QIconView
293
294 signals:
295 /*#ifndef QT_NO_DRAGANDDROP
296 void dropped( QDropEvent *e, const QValueList<QIconDragItem> &lst ); // QIconView
297 #endif
298 */
299 void moved(); // QIconView
300 void itemRenamed( Opie::Ui::OVersatileViewItem *item, const QString & ); // QIconView
301 void itemRenamed( Opie::Ui::OVersatileViewItem *item ); // QIconView
302
303 //==============================================================================================//
304 // "Derived" API - Case 2: Methods existing in QListView and QIconView with the same signatures
305 //==============================================================================================//
306
307 public:
308 enum SelectionMode {
309 Single = 0,
310 Multi,
311 Extended,
312 NoSelection
313 };
314
315 virtual void clear();
316
317 virtual void setFont( const QFont & );
318 virtual void setPalette( const QPalette & );
319
320 virtual void takeItem( OVersatileViewItem * );
321
322 void setSelectionMode( SelectionMode mode );
323 SelectionMode selectionMode() const;
324
325 virtual void selectAll( bool select );
326 virtual void clearSelection();
327 virtual void invertSelection();
328
329 void ensureItemVisible( const OVersatileViewItem * );
330 virtual void repaintItem( const OVersatileViewItem * ) const;
331
332 virtual void setCurrentItem( OVersatileViewItem * );
333 OVersatileViewItem * currentItem() const;
334
335 // bool eventFilter( QObject * o, QEvent * ); // use QWidgetStack implementation
336
337 // QSize minimumSizeHint() const; // use QWidgetStack implementation
338 // QSizePolicy sizePolicy() const; // use QWidgetStack implementation
339 // QSize sizeHint() const; // use QWidgetStack implementation
340
341 signals:
342 void selectionChanged();
343 void selectionChanged( Opie::Ui::OVersatileViewItem * );
344 void currentChanged( Opie::Ui::OVersatileViewItem * );
345 void clicked( Opie::Ui::OVersatileViewItem * );
346 void pressed( Opie::Ui::OVersatileViewItem * );
347
348 void doubleClicked( Opie::Ui::OVersatileViewItem * );
349 void returnPressed( Opie::Ui::OVersatileViewItem * );
350
351 void onItem( Opie::Ui::OVersatileViewItem * );
352 void onViewport();
353
354 //==============================================================================================//
355 // "Derived" API - Case 2: Methods existing in QListView and QIconView with differing signatures
356 //==============================================================================================//
357
358 /*
359
360 public:
361 virtual void insertItem( OVersatileViewItem * ); // QListView
362 virtual void insertItem( OVersatileViewItem *item, OVersatileViewItem *after = 0L ); // QIconView
363
364 virtual void setSelected( OVersatileViewItem *, bool ); // QListView
365 virtual void setSelected( OVersatileViewItem *item, bool s, bool cb = FALSE ); // QIconView
366
367 virtual void setSorting( int column, bool increasing = TRUE ); // QListView
368 void setSorting( bool sort, bool ascending = TRUE ); // QIconView
369
370 void sort(); // #### make virtual in next major release // QListView
371 virtual void sort( bool ascending = TRUE ); // QIconView
372
373 */
374
375 signals:
376 void clicked( Opie::Ui::OVersatileViewItem *, const QPoint &, int ); // QListView
377 void clicked( Opie::Ui::OVersatileViewItem *, const QPoint & ); // QIconView
378
379 void pressed( Opie::Ui::OVersatileViewItem *, const QPoint &, int ); // QListView
380 void pressed( Opie::Ui::OVersatileViewItem *, const QPoint & ); // QIconView
381
382 void rightButtonClicked( Opie::Ui::OVersatileViewItem* item, const QPoint& pos ); // QIconView
383 void rightButtonClicked( Opie::Ui::OVersatileViewItem *, const QPoint&, int ); // QListView
384
385 void rightButtonPressed( Opie::Ui::OVersatileViewItem* item, const QPoint& pos ); // QIconView
386 void rightButtonPressed( Opie::Ui::OVersatileViewItem *, const QPoint&, int ); // QListView
387
388 void mouseButtonPressed( int, Opie::Ui::OVersatileViewItem *, const QPoint& , int ); // QListView
389 void mouseButtonPressed( int button, Opie::Ui::OVersatileViewItem* item, const QPoint& pos ); // QIconView
390
391 void mouseButtonClicked( int, Opie::Ui::OVersatileViewItem *, const QPoint&, int ); // QListView
392 void mouseButtonClicked( int button, Opie::Ui::OVersatileViewItem* item, const QPoint& pos ); // QIconView
393
394};
395
396}
397}
398#endif
399
diff --git a/libopie2/opieui/oversatileviewitem.cpp b/libopie2/opieui/oversatileviewitem.cpp
deleted file mode 100644
index 03c6738..0000000
--- a/libopie2/opieui/oversatileviewitem.cpp
+++ b/dev/null
@@ -1,134 +0,0 @@
1/*
2                 This file is part of the Opie Project
3
4 =. (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de>
5 .=l.
6           .>+-=
7 _;:,     .>    :=|. This program is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This program is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.=       =       ; Library General Public License for more
20++=   -.     .`     .: details.
21 :     =  ...= . :.=-
22 -.   .:....=;==+<; You should have received a copy of the GNU
23  -_. . .   )=.  = Library General Public License along with
24    --        :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA.
28
29*/
30
31#include <opie2/oversatileviewitem.h>
32#include <opie2/oversatileview.h>
33
34using namespace Opie::Ui;
35
36OVersatileViewItem::OVersatileViewItem( OVersatileView * parent )
37 :OListViewItem( parent->_listview ), QIconViewItem( parent->_iconview ),
38 _versatileview( parent )
39{
40 init();
41}
42
43OVersatileViewItem::OVersatileViewItem( OVersatileView * parent, OVersatileViewItem * after )
44 :OListViewItem( parent->_listview, after ), QIconViewItem( parent->_iconview, after ),
45 _versatileview( parent )
46{
47 init();
48}
49
50OVersatileViewItem::OVersatileViewItem( OVersatileView * parent,
51 QString a, QString b, QString c, QString d,
52 QString e, QString f, QString g, QString h )
53 :OListViewItem( parent->_listview, a, b, c, d, e, f, g, h ),
54 QIconViewItem( parent->_iconview, a ),
55 _versatileview( parent )
56{
57 init();
58}
59
60OVersatileViewItem::OVersatileViewItem( OVersatileView * parent, OVersatileViewItem* after,
61 QString a, QString b, QString c, QString d,
62 QString e, QString f, QString g, QString h )
63 :OListViewItem( parent->_listview, after, a, b, c, d, e, f, g, h ),
64 QIconViewItem( parent->_iconview, after, a ),
65 _versatileview( parent )
66{
67 init();
68}
69
70OVersatileViewItem::OVersatileViewItem( OVersatileViewItem * parent,
71 QString a, QString b, QString c, QString d,
72 QString e, QString f, QString g, QString h )
73 :OListViewItem( parent, a, b, c, d, e, f, g, h ),
74 QIconViewItem( parent->_versatileview->_iconview, a ),
75 _versatileview( parent->_versatileview )
76{
77 init();
78}
79
80OVersatileViewItem::OVersatileViewItem( OVersatileViewItem * parent, OVersatileViewItem* after,
81 QString a, QString b, QString c, QString d,
82 QString e, QString f, QString g, QString h )
83 :OListViewItem( parent, after, a, b, c, d, e, f, g, h ),
84 QIconViewItem( parent->_versatileview->_iconview, after, a ),
85 _versatileview( parent->_versatileview )
86{
87 init();
88}
89
90OVersatileViewItem::~OVersatileViewItem()
91{
92}
93
94OVersatileView* OVersatileViewItem::versatileView() const
95{
96 return _versatileview;
97}
98
99void OVersatileViewItem::init()
100{
101 if ( !firstChild() )
102 {
103 // I'm a sweet yellow and browne autumn leaf
104
105 OListViewItem::setPixmap( 0, _versatileview->_treeleaf );
106 QIconViewItem::setPixmap( _versatileview->_iconleaf );
107 }
108 else
109 {
110 // I'm a node and I have a little baby child
111
112 if ( isOpen() )
113 {
114 OListViewItem::setPixmap( 0, _versatileview->_treeopened );
115 QIconViewItem::setPixmap( _versatileview->_iconopened );
116 }
117 else
118 {
119 OListViewItem::setPixmap( 0, _versatileview->_treeclosed );
120 QIconViewItem::setPixmap( _versatileview->_iconclosed );
121 }
122 }
123
124}
125
126void OVersatileViewItem::setRenameEnabled( bool allow )
127{
128 #if (QT_VERSION >= 0x030000)
129 OListViewItem::setRenameEnabled( 0, allow ); // TODO: Backport to Qt-Embedded 2.x?
130 #endif
131 QIconViewItem::setRenameEnabled( allow );
132}
133
134
diff --git a/libopie2/opieui/oversatileviewitem.h b/libopie2/opieui/oversatileviewitem.h
deleted file mode 100644
index c4977af..0000000
--- a/libopie2/opieui/oversatileviewitem.h
+++ b/dev/null
@@ -1,105 +0,0 @@
1/*
2                 This file is part of the Opie Project
3
4              Copyright (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de>
5 =.
6 .=l.
7           .>+-=
8 _;:,     .>    :=|. This program is free software; you can
9.> <`_,   >  .   <= redistribute it and/or modify it under
10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11.="- .-=="i,     .._ License as published by the Free Software
12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13     ._= =}       : or (at your option) any later version.
14    .%`+i>       _;_.
15    .i_,=:_.      -<s. This program is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17    : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details.
22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA.
29
30*/
31
32#ifndef OVERSATILEVIEWITEM_H
33#define OVERSATILEVIEWITEM_H
34
35/* QT */
36
37#include <qiconview.h>
38
39/* OPIE */
40
41#include <opie2/olistview.h>
42
43namespace Opie {
44namespace Ui {
45
46class OVersatileView;
47
48class OVersatileViewItem : public OListViewItem, public QIconViewItem
49{
50 public:
51 OVersatileViewItem( OVersatileView * parent );
52
53 OVersatileViewItem( OVersatileView * parent, OVersatileViewItem * after );
54
55 OVersatileViewItem( OVersatileViewItem * parent, OVersatileViewItem * after );
56
57 OVersatileViewItem( OVersatileView * parent, QString,
58 QString = QString::null, QString = QString::null,
59 QString = QString::null, QString = QString::null,
60 QString = QString::null, QString = QString::null,
61 QString = QString::null );
62
63 OVersatileViewItem( OVersatileViewItem * parent, QString,
64 QString = QString::null, QString = QString::null,
65 QString = QString::null, QString = QString::null,
66 QString = QString::null, QString = QString::null,
67 QString = QString::null );
68
69 OVersatileViewItem( OVersatileView * parent, OVersatileViewItem * after, QString,
70 QString = QString::null, QString = QString::null,
71 QString = QString::null, QString = QString::null,
72 QString = QString::null, QString = QString::null,
73 QString = QString::null );
74
75 OVersatileViewItem( OVersatileViewItem * parent, OVersatileViewItem * after, QString,
76 QString = QString::null, QString = QString::null,
77 QString = QString::null, QString = QString::null,
78 QString = QString::null, QString = QString::null,
79 QString = QString::null );
80
81 virtual ~OVersatileViewItem();
82
83 OVersatileView* versatileView() const;
84
85 // TODO: Implement the remaining constructors from QIconView
86
87 /* OIconViewItem( QIconView *parent, const QString &text, const QPixmap &icon );
88 OIconViewItem( QIconView *parent, QIconViewItem *after, const QString &text, const QPixmap &icon );
89 */
90
91 virtual void setRenameEnabled( bool );
92
93 // TODO: Implement the remaining method multiplexers
94
95 private:
96 OVersatileView* _versatileview;
97
98 private:
99 void init();
100
101};
102
103}
104}
105#endif