summaryrefslogtreecommitdiffabout
path: root/microkde/kdeui/klistview.h
Unidiff
Diffstat (limited to 'microkde/kdeui/klistview.h') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdeui/klistview.h121
1 files changed, 66 insertions, 55 deletions
diff --git a/microkde/kdeui/klistview.h b/microkde/kdeui/klistview.h
index 9f0d9fd..2176525 100644
--- a/microkde/kdeui/klistview.h
+++ b/microkde/kdeui/klistview.h
@@ -20,9 +20,20 @@
20#ifndef KLISTVIEW_H 20#ifndef KLISTVIEW_H
21#define KLISTVIEW_H 21#define KLISTVIEW_H
22 22
23#include <qlistview.h> 23#include <q3listview.h>
24 24
25#include <qptrlist.h> 25#include <q3ptrlist.h>
26//Added by qt3to4:
27#include <QDragMoveEvent>
28#include <QDropEvent>
29#include <QDragLeaveEvent>
30#include <QPaintEvent>
31#include <QResizeEvent>
32#include <QFocusEvent>
33#include <QMouseEvent>
34#include <QKeyEvent>
35#include <QEvent>
36#include <QDragEnterEvent>
26 37
27//US 38//US
28class QDropEvent; 39class QDropEvent;
@@ -30,7 +41,7 @@ class QDragLeaveEvent;
30class QDragMoveEvent; 41class QDragMoveEvent;
31class QDragEnterEvent; 42class QDragEnterEvent;
32 43
33class QDragObject; 44class Q3DragObject;
34class KConfig; 45class KConfig;
35class KLineEdit; 46class KLineEdit;
36/** 47/**
@@ -57,7 +68,7 @@ class KLineEdit;
57 * 68 *
58 * @version $Id$ 69 * @version $Id$
59 */ 70 */
60class KListView : public QListView 71class KListView : public Q3ListView
61{ 72{
62 Q_OBJECT 73 Q_OBJECT
63 Q_ENUMS( SelectionModeExt ) 74 Q_ENUMS( SelectionModeExt )
@@ -106,15 +117,15 @@ public:
106 * This way e.g. SHIFT+up/PgUp then SHIFT+down/PgDn leaves no item selected 117 * This way e.g. SHIFT+up/PgUp then SHIFT+down/PgDn leaves no item selected
107 */ 118 */
108 enum SelectionModeExt { 119 enum SelectionModeExt {
109 Single = QListView::Single, 120 Single = Q3ListView::Single,
110 Multi = QListView::Multi, 121 Multi = Q3ListView::Multi,
111 Extended = QListView::Extended, 122 Extended = Q3ListView::Extended,
112 NoSelection = QListView::NoSelection, 123 NoSelection = Q3ListView::NoSelection,
113 FileManager 124 FileManager
114 }; 125 };
115 void repaintContents( bool erase = true ) 126 void repaintContents( bool erase = true )
116 { 127 {
117 QScrollView::repaintContents( contentsX(), contentsY(), 128 Q3ScrollView::repaintContents( contentsX(), contentsY(),
118 visibleWidth(), visibleHeight(), erase ); 129 visibleWidth(), visibleHeight(), erase );
119 }; 130 };
120 /** 131 /**
@@ -161,26 +172,26 @@ public:
161 /** 172 /**
162 * @return a list containing the currently selected items. 173 * @return a list containing the currently selected items.
163 */ 174 */
164 QPtrList<QListViewItem> selectedItems() const; // ### BIC: KDE 4: use an implicitly shared class! (QValueList?) 175 Q3PtrList<Q3ListViewItem> selectedItems() const; // ### BIC: KDE 4: use an implicitly shared class! (QValueList?)
165 176
166 /** 177 /**
167 * Arbitrarily move @p item to @p parent, positioned immediately after item @p after. 178 * Arbitrarily move @p item to @p parent, positioned immediately after item @p after.
168 */ 179 */
169 void moveItem(QListViewItem *item, QListViewItem *parent, QListViewItem *after); 180 void moveItem(Q3ListViewItem *item, Q3ListViewItem *parent, Q3ListViewItem *after);
170 181
171 /** 182 /**
172 * @return the last item (not child!) of this listview. 183 * @return the last item (not child!) of this listview.
173 * 184 *
174 * @see lastChild() 185 * @see lastChild()
175 */ 186 */
176 QListViewItem *lastItem() const; 187 Q3ListViewItem *lastItem() const;
177 188
178 /** 189 /**
179 * @return the last child of this listview. 190 * @return the last child of this listview.
180 * 191 *
181 * @see lastItem() 192 * @see lastItem()
182 */ 193 */
183 QListViewItem* lastChild () const; 194 Q3ListViewItem* lastChild () const;
184 195
185 /** 196 /**
186 * @return the lineedit used for inline renaming. 197 * @return the lineedit used for inline renaming.
@@ -276,14 +287,14 @@ public:
276 * @p item doesn't exist in this list view. This function takes 287 * @p item doesn't exist in this list view. This function takes
277 * all items into account not only the visible ones. 288 * all items into account not only the visible ones.
278 */ 289 */
279 int itemIndex( const QListViewItem *item ) const; 290 int itemIndex( const Q3ListViewItem *item ) const;
280 291
281 /** 292 /**
282 * Returns the item of @p index within the item tree or 0 if 293 * Returns the item of @p index within the item tree or 0 if
283 * @p index doesn't exist in this list view. This function takes 294 * @p index doesn't exist in this list view. This function takes
284 * all items into account not only the visible ones. 295 * all items into account not only the visible ones.
285 */ 296 */
286 QListViewItem* itemAtIndex(int index); 297 Q3ListViewItem* itemAtIndex(int index);
287 298
288 /** 299 /**
289 * @deprecated 300 * @deprecated
@@ -314,7 +325,7 @@ public:
314 /** 325 /**
315 * Reimplemented for full width support 326 * Reimplemented for full width support
316 */ 327 */
317 virtual int addColumn(const QIconSet& iconset, const QString& label, int width = -1); 328 virtual int addColumn(const QIcon& iconset, const QString& label, int width = -1);
318 /** 329 /**
319 * Reimplemented for full width support 330 * Reimplemented for full width support
320 * 331 *
@@ -388,7 +399,7 @@ signals:
388 * Note that you may not delete any @ref QListViewItem objects in slots 399 * Note that you may not delete any @ref QListViewItem objects in slots
389 * connected to this signal. 400 * connected to this signal.
390 */ 401 */
391 void executed( QListViewItem *item ); 402 void executed( Q3ListViewItem *item );
392 403
393 /** 404 /**
394 * This signal is emitted whenever the user executes an listview item. 405 * This signal is emitted whenever the user executes an listview item.
@@ -401,7 +412,7 @@ signals:
401 * Note that you may not delete any @ref QListViewItem objects in slots 412 * Note that you may not delete any @ref QListViewItem objects in slots
402 * connected to this signal. 413 * connected to this signal.
403 */ 414 */
404 void executed( QListViewItem *item, const QPoint &pos, int c ); 415 void executed( Q3ListViewItem *item, const QPoint &pos, int c );
405 416
406 /** 417 /**
407 * This signal gets emitted whenever the user double clicks into the 418 * This signal gets emitted whenever the user double clicks into the
@@ -417,8 +428,8 @@ signals:
417 * You should normally not need to use this. In most cases its better 428 * You should normally not need to use this. In most cases its better
418 * to use @ref #executed() instead. 429 * to use @ref #executed() instead.
419 */ 430 */
420 void doubleClicked( QListViewItem *item, const QPoint &pos, int c ); 431 void doubleClicked( Q3ListViewItem *item, const QPoint &pos, int c );
421 void contextRequest( QListViewItem *item, const QPoint &pos, int c ); 432 void contextRequest( Q3ListViewItem *item, const QPoint &pos, int c );
422 433
423 /** 434 /**
424 * This signal gets emitted whenever something acceptable is 435 * This signal gets emitted whenever something acceptable is
@@ -430,7 +441,7 @@ signals:
430 * 441 *
431 * @see #acceptDrop() 442 * @see #acceptDrop()
432 */ 443 */
433 void dropped (QDropEvent * e, QListViewItem *after); 444 void dropped (QDropEvent * e, Q3ListViewItem *after);
434 445
435 /** 446 /**
436 * This signal gets emitted whenever something acceptable is 447 * This signal gets emitted whenever something acceptable is
@@ -444,7 +455,7 @@ signals:
444 * @param after is the item after which the drop occured (or 0L, if 455 * @param after is the item after which the drop occured (or 0L, if
445 * the drop was above all items 456 * the drop was above all items
446 */ 457 */
447 void dropped (KListView* list, QDropEvent* e, QListViewItem* after); 458 void dropped (KListView* list, QDropEvent* e, Q3ListViewItem* after);
448 459
449 /** 460 /**
450 * This signal gets emitted whenever something acceptable is 461 * This signal gets emitted whenever something acceptable is
@@ -458,7 +469,7 @@ signals:
458 * @param after is the item after which the drop occured (or 0L, if 469 * @param after is the item after which the drop occured (or 0L, if
459 * the drop was above all items 470 * the drop was above all items
460 */ 471 */
461 void dropped (KListView* list, QDropEvent* e, QListViewItem* parent, QListViewItem* after); 472 void dropped (KListView* list, QDropEvent* e, Q3ListViewItem* parent, Q3ListViewItem* after);
462 473
463 /** 474 /**
464 * This signal gets emitted whenever something acceptable is 475 * This signal gets emitted whenever something acceptable is
@@ -471,7 +482,7 @@ signals:
471 * @param after is the item after which the drop occured (or 0L, if 482 * @param after is the item after which the drop occured (or 0L, if
472 * the drop was above all items 483 * the drop was above all items
473 */ 484 */
474 void dropped (QDropEvent* e, QListViewItem* parent, QListViewItem* after); 485 void dropped (QDropEvent* e, Q3ListViewItem* parent, Q3ListViewItem* after);
475 486
476 /** 487 /**
477 * This signal is emitted when ever the user moves an item in the list via 488 * This signal is emitted when ever the user moves an item in the list via
@@ -502,7 +513,7 @@ signals:
502 * @param afterFirst the item that parameter item was in before the move, in the list 513 * @param afterFirst the item that parameter item was in before the move, in the list
503 * @param afterNow the item it's currently after. 514 * @param afterNow the item it's currently after.
504 */ 515 */
505 void moved (QListViewItem *item, QListViewItem *afterFirst, QListViewItem *afterNow); 516 void moved (Q3ListViewItem *item, Q3ListViewItem *afterFirst, Q3ListViewItem *afterNow);
506 517
507 518
508 /** 519 /**
@@ -510,7 +521,7 @@ signals:
510 * each and every item moved, in order. The first element in @p items associates 521 * each and every item moved, in order. The first element in @p items associates
511 * with the first of afterFirst and afterNow. 522 * with the first of afterFirst and afterNow.
512 */ 523 */
513 void moved(QPtrList<QListViewItem> &items, QPtrList<QListViewItem> &afterFirst, QPtrList<QListViewItem> &afterNow); 524 void moved(Q3PtrList<Q3ListViewItem> &items, Q3PtrList<Q3ListViewItem> &afterFirst, Q3PtrList<Q3ListViewItem> &afterNow);
514 525
515 /** 526 /**
516 * This signal gets emitted when an item is renamed via in-place renaming. 527 * This signal gets emitted when an item is renamed via in-place renaming.
@@ -519,12 +530,12 @@ signals:
519 * @param str is the new value of column @p col. 530 * @param str is the new value of column @p col.
520 * @param col is the renamed column. 531 * @param col is the renamed column.
521 */ 532 */
522 void itemRenamed(QListViewItem* item, const QString &str, int col); 533 void itemRenamed(Q3ListViewItem* item, const QString &str, int col);
523 534
524 /** 535 /**
525 * Same as above, but without the extra information. 536 * Same as above, but without the extra information.
526 */ 537 */
527 void itemRenamed(QListViewItem* item); 538 void itemRenamed(Q3ListViewItem* item);
528 void signalDelete(); 539 void signalDelete();
529 540
530 /** 541 /**
@@ -537,7 +548,7 @@ signals:
537 * @param list is this listview. 548 * @param list is this listview.
538 * @param item is the @ref currentItem() at the time the key was pressed. May be 0L. 549 * @param item is the @ref currentItem() at the time the key was pressed. May be 0L.
539 */ 550 */
540 void menuShortCutPressed (KListView* list, QListViewItem* item); 551 void menuShortCutPressed (KListView* list, Q3ListViewItem* item);
541 552
542 /** 553 /**
543 * This signal is emitted whenever a context-menu should be shown for item @p i. 554 * This signal is emitted whenever a context-menu should be shown for item @p i.
@@ -547,13 +558,13 @@ signals:
547 * @param i is the item for which the menu should be shown. May be 0L. 558 * @param i is the item for which the menu should be shown. May be 0L.
548 * @param p is the point at which the menu should be shown. 559 * @param p is the point at which the menu should be shown.
549 */ 560 */
550 void contextMenu (KListView* l, QListViewItem* i, const QPoint& p); 561 void contextMenu (KListView* l, Q3ListViewItem* i, const QPoint& p);
551 562
552public slots: 563public slots:
553 /** 564 /**
554 * Rename column @p c of @p item. 565 * Rename column @p c of @p item.
555 */ 566 */
556 virtual void rename(QListViewItem *item, int c); 567 virtual void rename(Q3ListViewItem *item, int c);
557 568
558 /** 569 /**
559 * By default, if you called setItemsRenameable(true), 570 * By default, if you called setItemsRenameable(true),
@@ -673,7 +684,7 @@ protected:
673 * @param p is translated from contents coordinates to viewport coordinates 684 * @param p is translated from contents coordinates to viewport coordinates
674 * before being passed to the above function. 685 * before being passed to the above function.
675 */ 686 */
676 inline bool below (QListViewItem* i, const QPoint& p) 687 inline bool below (Q3ListViewItem* i, const QPoint& p)
677 { 688 {
678 return below (itemRect(i), contentsToViewport(p)); 689 return below (itemRect(i), contentsToViewport(p));
679 } 690 }
@@ -689,7 +700,7 @@ protected:
689 * @internal 700 * @internal
690 */ 701 */
691 //US I added buttonstate to pass the current keyboard status 702 //US I added buttonstate to pass the current keyboard status
692 void emitExecute( int buttonstate, QListViewItem *item, const QPoint &pos, int c); 703 void emitExecute( int buttonstate, Q3ListViewItem *item, const QPoint &pos, int c);
693 704
694 /** 705 /**
695 * Reimplemented for internal reasons. 706 * Reimplemented for internal reasons.
@@ -721,12 +732,12 @@ protected:
721 /** 732 /**
722 * @return the tooltip for @p column of @p item. 733 * @return the tooltip for @p column of @p item.
723 */ 734 */
724 virtual QString tooltip(QListViewItem* item, int column) const; 735 virtual QString tooltip(Q3ListViewItem* item, int column) const;
725 736
726 /** 737 /**
727 * @return whether the tooltip for @p column of @p item shall be shown at point @p pos. 738 * @return whether the tooltip for @p column of @p item shall be shown at point @p pos.
728 */ 739 */
729 virtual bool showTooltip(QListViewItem *item, const QPoint &pos, int column) const; 740 virtual bool showTooltip(Q3ListViewItem *item, const QPoint &pos, int column) const;
730 741
731 /** 742 /**
732 * Reimplemented for internal reasons. 743 * Reimplemented for internal reasons.
@@ -805,7 +816,7 @@ protected:
805 * 816 *
806 * @see setDragEnabled() 817 * @see setDragEnabled()
807 */ 818 */
808 virtual QDragObject *dragObject(); 819 virtual Q3DragObject *dragObject();
809 820
810 /** 821 /**
811 * @return true if the @p event provides some acceptable 822 * @return true if the @p event provides some acceptable
@@ -821,7 +832,7 @@ protected:
821 * 832 *
822 * @return the rectangle that you painted to. 833 * @return the rectangle that you painted to.
823 */ 834 */
824 virtual QRect drawDropVisualizer (QPainter *p, QListViewItem *parent, QListViewItem *after); 835 virtual QRect drawDropVisualizer (QPainter *p, Q3ListViewItem *parent, Q3ListViewItem *after);
825 836
826 /** 837 /**
827 * Paint the drag rectangle. If painter is null, don't try to :) 838 * Paint the drag rectangle. If painter is null, don't try to :)
@@ -829,7 +840,7 @@ protected:
829 * 840 *
830 * @return the rectangle that you painted to. 841 * @return the rectangle that you painted to.
831 */ 842 */
832 virtual QRect drawItemHighlighter(QPainter *painter, QListViewItem *item); 843 virtual QRect drawItemHighlighter(QPainter *painter, Q3ListViewItem *item);
833 844
834 /** 845 /**
835 * This method calls @ref dragObject() and starts the drag. 846 * This method calls @ref dragObject() and starts the drag.
@@ -886,8 +897,8 @@ protected slots:
886 */ 897 */
887 void slotSettingsChanged(int); 898 void slotSettingsChanged(int);
888 899
889 void slotMouseButtonClicked( int btn, QListViewItem *item, const QPoint &pos, int c ); 900 void slotMouseButtonClicked( int btn, Q3ListViewItem *item, const QPoint &pos, int c );
890 void doneEditing(QListViewItem *item, int row); 901 void doneEditing(Q3ListViewItem *item, int row);
891 902
892 /** 903 /**
893 * Repaint the rect where I was drawing the drop line. 904 * Repaint the rect where I was drawing the drop line.
@@ -902,18 +913,18 @@ protected slots:
902 /** 913 /**
903 * Emit the @ref contextMenu signal. This slot is for mouse actions. 914 * Emit the @ref contextMenu signal. This slot is for mouse actions.
904 */ 915 */
905 void emitContextMenu (QListViewItem*, const QPoint&, int); 916 void emitContextMenu (Q3ListViewItem*, const QPoint&, int);
906 917
907 /** 918 /**
908 * Emit the @ref #contextMenu signal. This slot is for key presses. 919 * Emit the @ref #contextMenu signal. This slot is for key presses.
909 */ 920 */
910 void emitContextMenu (KListView*, QListViewItem*); 921 void emitContextMenu (KListView*, Q3ListViewItem*);
911 922
912 /** 923 /**
913 * Accessory slot for AutoSelect 924 * Accessory slot for AutoSelect
914 * @internal 925 * @internal
915 */ 926 */
916 void slotOnItem( QListViewItem *item ); 927 void slotOnItem( Q3ListViewItem *item );
917 928
918 /** 929 /**
919 * Accessory slot for AutoSelect/ChangeCursorOverItem 930 * Accessory slot for AutoSelect/ChangeCursorOverItem
@@ -939,7 +950,7 @@ protected:
939 /** 950 /**
940 * Handle dropEvent when itemsMovable() is set to true. 951 * Handle dropEvent when itemsMovable() is set to true.
941 */ 952 */
942 virtual void movableDropEvent (QListViewItem* parent, QListViewItem* afterme); 953 virtual void movableDropEvent (Q3ListViewItem* parent, Q3ListViewItem* afterme);
943 954
944 /** 955 /**
945 * Where is the nearest QListViewItem that I'm going to drop? 956 * Where is the nearest QListViewItem that I'm going to drop?
@@ -947,7 +958,7 @@ protected:
947 * FIXME KDE 4.0: Make this method const so it can be called from an 958 * FIXME KDE 4.0: Make this method const so it can be called from an
948 * acceptDrag method without ugly casts 959 * acceptDrag method without ugly casts
949 */ 960 */
950 virtual void findDrop(const QPoint &pos, QListViewItem *&parent, QListViewItem *&after); 961 virtual void findDrop(const QPoint &pos, Q3ListViewItem *&parent, Q3ListViewItem *&after);
951 962
952 /** 963 /**
953 * A special keyPressEvent (for FileManager selection mode). 964 * A special keyPressEvent (for FileManager selection mode).
@@ -974,7 +985,7 @@ private:
974 * 985 *
975 * @short listview item with alternate background colour support 986 * @short listview item with alternate background colour support
976 */ 987 */
977class KListViewItem : public QListViewItem 988class KListViewItem : public Q3ListViewItem
978{ 989{
979public: 990public:
980 /** 991 /**
@@ -983,30 +994,30 @@ public:
983 * don't mix KListViewItem (or subclasses) with QListViewItem 994 * don't mix KListViewItem (or subclasses) with QListViewItem
984 * (or subclasses). 995 * (or subclasses).
985 */ 996 */
986 KListViewItem(QListView *parent); 997 KListViewItem(Q3ListView *parent);
987 KListViewItem(QListViewItem *parent); 998 KListViewItem(Q3ListViewItem *parent);
988 KListViewItem(QListView *parent, QListViewItem *after); 999 KListViewItem(Q3ListView *parent, Q3ListViewItem *after);
989 KListViewItem(QListViewItem *parent, QListViewItem *after); 1000 KListViewItem(Q3ListViewItem *parent, Q3ListViewItem *after);
990 1001
991 KListViewItem(QListView *parent, 1002 KListViewItem(Q3ListView *parent,
992 QString, QString = QString::null, 1003 QString, QString = QString::null,
993 QString = QString::null, QString = QString::null, 1004 QString = QString::null, QString = QString::null,
994 QString = QString::null, QString = QString::null, 1005 QString = QString::null, QString = QString::null,
995 QString = QString::null, QString = QString::null); 1006 QString = QString::null, QString = QString::null);
996 1007
997 KListViewItem(QListViewItem *parent, 1008 KListViewItem(Q3ListViewItem *parent,
998 QString, QString = QString::null, 1009 QString, QString = QString::null,
999 QString = QString::null, QString = QString::null, 1010 QString = QString::null, QString = QString::null,
1000 QString = QString::null, QString = QString::null, 1011 QString = QString::null, QString = QString::null,
1001 QString = QString::null, QString = QString::null); 1012 QString = QString::null, QString = QString::null);
1002 1013
1003 KListViewItem(QListView *parent, QListViewItem *after, 1014 KListViewItem(Q3ListView *parent, Q3ListViewItem *after,
1004 QString, QString = QString::null, 1015 QString, QString = QString::null,
1005 QString = QString::null, QString = QString::null, 1016 QString = QString::null, QString = QString::null,
1006 QString = QString::null, QString = QString::null, 1017 QString = QString::null, QString = QString::null,
1007 QString = QString::null, QString = QString::null); 1018 QString = QString::null, QString = QString::null);
1008 1019
1009 KListViewItem(QListViewItem *parent, QListViewItem *after, 1020 KListViewItem(Q3ListViewItem *parent, Q3ListViewItem *after,
1010 QString, QString = QString::null, 1021 QString, QString = QString::null,
1011 QString = QString::null, QString = QString::null, 1022 QString = QString::null, QString = QString::null,
1012 QString = QString::null, QString = QString::null, 1023 QString = QString::null, QString = QString::null,