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
@@ -17,23 +17,34 @@
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
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;
29class QDragLeaveEvent; 40class 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/**
37 * This Widget extends the functionality of QListView to honor the system 48 * This Widget extends the functionality of QListView to honor the system
38 * wide settings for Single Click/Double Click mode, AutoSelection and 49 * wide settings for Single Click/Double Click mode, AutoSelection and
39 * ChangeCursorOverLink (TM). 50 * ChangeCursorOverLink (TM).
@@ -54,13 +65,13 @@ class KLineEdit;
54 * KListView is drag-enabled, too: to benefit from that you've got derive from it. 65 * KListView is drag-enabled, too: to benefit from that you've got derive from it.
55 * Reimplement @ref dragObject() and (possibly) @ref startDrag(), 66 * Reimplement @ref dragObject() and (possibly) @ref startDrag(),
56 * and @ref setDragEnabled(true). 67 * and @ref setDragEnabled(true).
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 )
64 Q_PROPERTY( bool fullWidth READ fullWidth WRITE setFullWidth ) 75 Q_PROPERTY( bool fullWidth READ fullWidth WRITE setFullWidth )
65 Q_PROPERTY( bool itemsMovable READ itemsMovable WRITE setItemsMovable ) 76 Q_PROPERTY( bool itemsMovable READ itemsMovable WRITE setItemsMovable )
66 Q_PROPERTY( bool itemsRenameable READ itemsRenameable WRITE setItemsRenameable ) 77 Q_PROPERTY( bool itemsRenameable READ itemsRenameable WRITE setItemsRenameable )
@@ -103,21 +114,21 @@ public:
103 * Additionally the current item is always selected automatically when 114 * Additionally the current item is always selected automatically when
104 * navigating using the keyboard, except other items were selected explicitely. 115 * navigating using the keyboard, except other items were selected explicitely.
105 * 116 *
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 /**
121 * Constructor. 132 * Constructor.
122 * 133 *
123 * The parameters @p parent and @p name are handled by 134 * The parameters @p parent and @p name are handled by
@@ -158,32 +169,32 @@ public:
158 */ 169 */
159 bool isExecuteArea( int x ); 170 bool isExecuteArea( int x );
160 171
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.
187 * Use that to setup a @ref KCompletion or @ref QValidator for the lineedit 198 * Use that to setup a @ref KCompletion or @ref QValidator for the lineedit
188 * 199 *
189 * @since 3.2 200 * @since 3.2
@@ -273,20 +284,20 @@ public:
273 284
274 /** 285 /**
275 * Returns the index of @p item within the item tree or -1 if 286 * Returns the index of @p item within the item tree or -1 if
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
290 * @see #setFullWidth() 301 * @see #setFullWidth()
291 */ 302 */
292 void setFullWidth(); 303 void setFullWidth();
@@ -311,13 +322,13 @@ public:
311 * @see #removeColumn() 322 * @see #removeColumn()
312 */ 323 */
313 virtual int addColumn(const QString& label, int width = -1); 324 virtual int addColumn(const QString& label, int width = -1);
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 *
321 * @see #addColumn() 332 * @see #addColumn()
322 */ 333 */
323 virtual void removeColumn(int index); 334 virtual void removeColumn(int index);
@@ -385,26 +396,26 @@ signals:
385 * setting the user clicked or double clicked on that item. 396 * setting the user clicked or double clicked on that item.
386 * @param item is the pointer to the executed listview item. 397 * @param item is the pointer to the executed listview item.
387 * 398 *
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.
395 * That means depending on the KDE wide Single Click/Double Click 406 * That means depending on the KDE wide Single Click/Double Click
396 * setting the user clicked or double clicked on that item. 407 * setting the user clicked or double clicked on that item.
397 * @param item is the pointer to the executed listview item. 408 * @param item is the pointer to the executed listview item.
398 * @param pos is the position where the user has clicked 409 * @param pos is the position where the user has clicked
399 * @param c is the column into which the user clicked. 410 * @param c is the column into which the user clicked.
400 * 411 *
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
408 * listview. 419 * listview.
409 * @param item is the pointer to the clicked listview item. 420 * @param item is the pointer to the clicked listview item.
410 * @param pos is the position where the user has clicked, and 421 * @param pos is the position where the user has clicked, and
@@ -414,26 +425,26 @@ signals:
414 * connected to this signal. 425 * connected to this signal.
415 * 426 *
416 * This signal is more or less here for the sake of completeness. 427 * This signal is more or less here for the sake of completeness.
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
425 * dropped onto the listview. 436 * dropped onto the listview.
426 * 437 *
427 * @param e is the drop event itself (it has already been accepted) 438 * @param e is the drop event itself (it has already been accepted)
428 * @param after is the item after which the drop occured (or 0L, if 439 * @param after is the item after which the drop occured (or 0L, if
429 * the drop was above all items) 440 * the drop was above all items)
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
437 * dropped onto the listview. 448 * dropped onto the listview.
438 * 449 *
439 * This is an overloaded version of the above (provided to simplify 450 * This is an overloaded version of the above (provided to simplify
@@ -441,13 +452,13 @@ signals:
441 * 452 *
442 * @param list is the listview 453 * @param list is the listview
443 * @param e is the drop event itself (it has already been accepted) 454 * @param e is the drop event itself (it has already been accepted)
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
451 * dropped onto the listview. 462 * dropped onto the listview.
452 * 463 *
453 * This function also provides a parent, in the event that your listview 464 * This function also provides a parent, in the event that your listview
@@ -455,26 +466,26 @@ signals:
455 * @param list is the listview 466 * @param list is the listview
456 * @param e is the drop event itself (it has already been accepted) 467 * @param e is the drop event itself (it has already been accepted)
457 * @param parent the item that is to be the parent of the new item 468 * @param parent the item that is to be the parent of the new item
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
465 * dropped onto the listview. 476 * dropped onto the listview.
466 * 477 *
467 * This function also provides a parent, in the event that your listview 478 * This function also provides a parent, in the event that your listview
468 * is a tree 479 * is a tree
469 * @param e is the drop event itself (it has already been accepted) 480 * @param e is the drop event itself (it has already been accepted)
470 * @param parent the item that is to be the parent of the new item 481 * @param parent the item that is to be the parent of the new item
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
478 * DnD. 489 * DnD.
479 * If more than one item is moved at the same time, this signal is only emitted 490 * If more than one item is moved at the same time, this signal is only emitted
480 * once. 491 * once.
@@ -499,64 +510,64 @@ signals:
499 * This differs from @ref moved(), so be careful. All the items will have been 510 * This differs from @ref moved(), so be careful. All the items will have been
500 * moved before @ref moved() is emitted, which is not true in this method. // FIXME 511 * moved before @ref moved() is emitted, which is not true in this method. // FIXME
501 * @param item the item that was moved 512 * @param item the item that was moved
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 /**
509 * This signal is emitted after all the items have been moved. It reports info for 520 * This signal is emitted after all the items have been moved. It reports info for
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.
517 * 528 *
518 * @param item is the renamed item. 529 * @param item is the renamed item.
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 /**
531 * This signal is emitted when the shortcut key for popup-menus is pressed. 542 * This signal is emitted when the shortcut key for popup-menus is pressed.
532 * 543 *
533 * Normally you should not use this, just connect a slot to signal 544 * Normally you should not use this, just connect a slot to signal
534 * @ref contextMenu (KListView*, QListViewItem*, const QPoint&) to correctly 545 * @ref contextMenu (KListView*, QListViewItem*, const QPoint&) to correctly
535 * handle showing context menus regardless of settings. 546 * handle showing context menus regardless of settings.
536 * 547 *
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.
544 * It automatically adjusts for all settings involved (Menu key, showMenuOnPress/Click). 555 * It automatically adjusts for all settings involved (Menu key, showMenuOnPress/Click).
545 * 556 *
546 * @param l is this listview. 557 * @param l is this listview.
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),
560 * only the first column is renameable. 571 * only the first column is renameable.
561 * Use this function to enable the feature on other columns. 572 * Use this function to enable the feature on other columns.
562 * 573 *
@@ -670,13 +681,13 @@ protected:
670 * It differs from the above only in what arguments it takes. 681 * It differs from the above only in what arguments it takes.
671 * 682 *
672 * @param i the item whose rect() is passed to the above function. 683 * @param i the item whose rect() is passed to the above function.
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 }
680 691
681 /** 692 /**
682 * Reimplemented to reload the alternate background in palette changes. 693 * Reimplemented to reload the alternate background in palette changes.
@@ -686,13 +697,13 @@ protected:
686 697
687 /** 698 /**
688 * Emit signal @ref #executed. 699 * Emit signal @ref #executed.
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.
696 * Further reimplementations should call this function or else 707 * Further reimplementations should call this function or else
697 * some features may not work correctly. 708 * some features may not work correctly.
698 * 709 *
@@ -718,18 +729,18 @@ protected:
718 */ 729 */
719 virtual void leaveEvent( QEvent *e ); 730 virtual void leaveEvent( QEvent *e );
720 731
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.
733 * Further reimplementations should call this function or else 744 * Further reimplementations should call this function or else
734 * some features may not work correctly. 745 * some features may not work correctly.
735 * 746 *
@@ -802,13 +813,13 @@ protected:
802 813
803 /** 814 /**
804 * @return a dragobject encoding the current selection. 815 * @return a dragobject encoding the current selection.
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
812 * format. 823 * format.
813 * A common mistake is to forget the "const" in your reimplementation 824 * A common mistake is to forget the "const" in your reimplementation
814 */ 825 */
@@ -818,21 +829,21 @@ protected:
818 * Paint the drag line. If painter is null, don't try to :) 829 * Paint the drag line. If painter is null, don't try to :)
819 * 830 *
820 * If after == 0 then the marker should be drawn at the top. 831 * If after == 0 then the marker should be drawn at the top.
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 :)
828 * 839 *
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.
836 * 847 *
837 * Reimplement it to do fancy stuff like setting a pixmap or 848 * Reimplement it to do fancy stuff like setting a pixmap or
838 * using a non-default DragMode 849 * using a non-default DragMode
@@ -883,14 +894,14 @@ protected slots:
883 /** 894 /**
884 * Update internal settings whenever the global ones change. 895 * Update internal settings whenever the global ones change.
885 * @internal 896 * @internal
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.
894 */ 905 */
895 void cleanDropVisualizer(); 906 void cleanDropVisualizer();
896 907
@@ -899,24 +910,24 @@ protected slots:
899 */ 910 */
900 void cleanItemHighlighter(); 911 void cleanItemHighlighter();
901 912
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
920 * @internal 931 * @internal
921 */ 932 */
922 void slotOnViewport(); 933 void slotOnViewport();
@@ -936,21 +947,21 @@ protected slots:
936 void slotHeaderChanged(); 947 void slotHeaderChanged();
937 948
938protected: 949protected:
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?
946 * 957 *
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).
954 */ 965 */
955 void fileManagerKeyPressEvent (QKeyEvent*); 966 void fileManagerKeyPressEvent (QKeyEvent*);
956 967
@@ -971,45 +982,45 @@ private:
971/** 982/**
972 * A listview item with support for alternate background colours. It is 983 * A listview item with support for alternate background colours. It is
973 * a drop-in replacement for @ref QListViewItem 984 * a drop-in replacement for @ref QListViewItem
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 /**
981 * constructors. The semantics remain as in @ref QListViewItem. 992 * constructors. The semantics remain as in @ref QListViewItem.
982 * Although they accept a @ref QListViewItem as parent, please 993 * Although they accept a @ref QListViewItem as parent, please
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,
1013 QString = QString::null, QString = QString::null); 1024 QString = QString::null, QString = QString::null);
1014 1025
1015 virtual ~KListViewItem(); 1026 virtual ~KListViewItem();