• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeui
 

tdeui

  • tdeui
tdelistview.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 2000 Reginald Stadlbauer <reggie@kde.org>
3  Copyright (C) 2000 Charles Samuels <charles@kde.org>
4  Copyright (C) 2000 Peter Putzer <putzer@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License version 2 as published by the Free Software Foundation.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 #ifndef KLISTVIEW_H
21 #define KLISTVIEW_H
22 
23 #include <tqheader.h>
24 #include <tqlistview.h>
25 
26 #include <tqptrlist.h>
27 #include <tdelibs_export.h>
28 
29 class TQDragObject;
30 class TDEConfig;
31 class KLineEdit;
54 class TDEUI_EXPORT TDEListView : public TQListView
55 {
56  friend class TDEListViewItem;
57 
58  Q_OBJECT
59 
60  TQ_ENUMS( SelectionModeExt )
61  TQ_PROPERTY( bool fullWidth READ fullWidth WRITE setFullWidth )
62  TQ_PROPERTY( bool itemsMovable READ itemsMovable WRITE setItemsMovable )
63  TQ_PROPERTY( bool itemsRenameable READ itemsRenameable WRITE setItemsRenameable )
64  TQ_PROPERTY( bool dragEnabled READ dragEnabled WRITE setDragEnabled )
65  TQ_PROPERTY( bool autoOpen READ autoOpen WRITE setAutoOpen )
66  TQ_PROPERTY( bool dropVisualizer READ dropVisualizer WRITE setDropVisualizer )
67  TQ_PROPERTY( int tooltipColumn READ tooltipColumn WRITE setTooltipColumn )
68  TQ_PROPERTY( int dropVisualizerWidth READ dropVisualizerWidth WRITE setDropVisualizerWidth )
69  TQ_PROPERTY( TQColor alternateBackground READ alternateBackground WRITE setAlternateBackground )
70  TQ_PROPERTY( bool shadeSortColumn READ shadeSortColumn WRITE setShadeSortColumn )
71 
72  TQ_OVERRIDE( SelectionModeExt selectionMode READ selectionModeExt WRITE setSelectionModeExt )
73 
74 public:
106  enum SelectionModeExt {
107  Single = TQListView::Single,
108  Multi = TQListView::Multi,
109  Extended = TQListView::Extended,
110  NoSelection = TQListView::NoSelection,
111  FileManager
112  };
113 
120  TDEListView (TQWidget *parent = 0, const char *name = 0);
121 
125  virtual ~TDEListView();
126 
134  virtual void setAcceptDrops (bool);
135 
145  virtual bool isExecuteArea( const TQPoint& point );
146 
152  bool isExecuteArea( int x );
153 
159  TQPtrList<TQListViewItem> selectedItems() const;
160 
171  TQPtrList<TQListViewItem> selectedItems(bool includeHiddenItems) const; // ### BIC: KDE 4: use an implicitly shared class! (QValutList?) and merge with above, default to true
172 
179  void moveItem(TQListViewItem *item, TQListViewItem *parent, TQListViewItem *after);
180 
186  TQListViewItem *lastItem() const;
187 
193  TQListViewItem* lastChild () const;
194 
201  KLineEdit* renameLineEdit() const;
202 
209  bool itemsMovable() const;
210 
216  bool itemsRenameable() const;
217 
223  bool dragEnabled() const;
224 
230  bool autoOpen() const;
231 
237  bool isRenameable (int column) const;
238 
244  bool dropVisualizer() const;
245 
251  int tooltipColumn() const;
252 
259  bool createChildren() const KDE_DEPRECATED;
260 
266  bool dropHighlighter() const;
267 
274  int dropVisualizerWidth () const;
275 
282  SelectionModeExt selectionModeExt () const;
283 
289  int itemIndex( const TQListViewItem *item ) const;
290 
296  TQListViewItem* itemAtIndex(int index);
297 
302  void setFullWidth() KDE_DEPRECATED;
303 
309  void setFullWidth(bool fullWidth);
310 
316  bool fullWidth() const;
317 
323  virtual int addColumn(const TQString& label, int width = -1);
327  virtual int addColumn(const TQIconSet& iconset, const TQString& label, int width = -1);
333  virtual void removeColumn(int index);
334 
344  void setAlternateBackground(const TQColor &c);
350  const TQColor &alternateBackground() const;
351 
359  void saveLayout(TDEConfig *config, const TQString &group) const;
367  void restoreLayout(TDEConfig *config, const TQString &group);
374  virtual void setSorting(int column, bool ascending = true);
375 
379  int columnSorted(void) const;
380 
384  bool ascendingSort(void) const;
385 
389  virtual void takeItem(TQListViewItem *i);
390 
397  void setShadeSortColumn(bool shadeSortColumn);
398 
405  bool shadeSortColumn(void) const;
406 signals:
407 
417  void executed( TQListViewItem *item );
418 
430  void executed( TQListViewItem *item, const TQPoint &pos, int c );
431 
442  void dropped (TQDropEvent * e, TQListViewItem *after);
443 
456  void dropped (TDEListView* list, TQDropEvent* e, TQListViewItem* after);
457 
470  void dropped (TDEListView* list, TQDropEvent* e, TQListViewItem* parent, TQListViewItem* after);
471 
483  void dropped (TQDropEvent* e, TQListViewItem* parent, TQListViewItem* after);
484 
491  void moved();
492 
501  void aboutToMove();
502 
514  void moved (TQListViewItem *item, TQListViewItem *afterFirst, TQListViewItem *afterNow);
515 
516 
522  void moved(TQPtrList<TQListViewItem> &items, TQPtrList<TQListViewItem> &afterFirst, TQPtrList<TQListViewItem> &afterNow);
523 
531  void itemRenamed(TQListViewItem* item, const TQString &str, int col);
532 
536  void itemRenamed(TQListViewItem* item);
537 
548  void menuShortCutPressed (TDEListView* list, TQListViewItem* item);
549 
558  void contextMenu (TDEListView* l, TQListViewItem* i, const TQPoint& p);
559 
560  void itemAdded(TQListViewItem *item);
561  void itemRemoved(TQListViewItem *item);
562 
563 public slots:
567  virtual void rename(TQListViewItem *item, int c);
568 
579  void setRenameable (int column, bool yesno=true);
580 
587  virtual void setItemsMovable(bool b);
588 
596  virtual void setItemsRenameable(bool b);
597 
602  virtual void setDragEnabled(bool b);
603 
607  virtual void setAutoOpen(bool b);
608 
614  virtual void setDropVisualizer(bool b);
615 
620  void setDropVisualizerWidth (int w);
621 
628  virtual void setTooltipColumn(int column);
629 
635  virtual void setDropHighlighter(bool b);
636 
643  virtual void setCreateChildren(bool b) KDE_DEPRECATED;
644 
650  void setSelectionModeExt (SelectionModeExt mode);
651 
656  void setTabOrderedRenaming(bool b);
657 
662  bool tabOrderedRenaming() const;
663 
670  virtual void selectAll( bool select );
671 
672 protected:
681  inline bool below (const TQRect& rect, const TQPoint& p)
682  {
683  return (p.y() > (rect.top() + (rect.bottom() - rect.top())/2));
684  }
685 
695  inline bool below (TQListViewItem* i, const TQPoint& p)
696  {
697  return below (itemRect(i), contentsToViewport(p));
698  }
699 
704  virtual bool event( TQEvent * );
705 
710  void emitExecute( TQListViewItem *item, const TQPoint &pos, int c );
711 
719  virtual void focusInEvent(TQFocusEvent* fe);
720 
728  virtual void focusOutEvent( TQFocusEvent *fe );
729 
737  virtual void leaveEvent( TQEvent *e );
738 
742  virtual TQString tooltip(TQListViewItem* item, int column) const;
743 
747  virtual bool showTooltip(TQListViewItem *item, const TQPoint &pos, int column) const;
748 
756  virtual void contentsDragMoveEvent (TQDragMoveEvent *event);
757 
765  virtual void contentsMousePressEvent( TQMouseEvent *e );
766 
774  virtual void contentsMouseMoveEvent( TQMouseEvent *e );
775 
783  virtual void contentsMouseDoubleClickEvent ( TQMouseEvent *e );
784 
792  virtual void contentsDragLeaveEvent (TQDragLeaveEvent *event);
793 
801  virtual void contentsMouseReleaseEvent (TQMouseEvent*);
802 
810  virtual void contentsDropEvent (TQDropEvent*);
811 
819  virtual void contentsDragEnterEvent (TQDragEnterEvent *);
820 
826  virtual TQDragObject *dragObject();
827 
833  virtual bool acceptDrag (TQDropEvent* event) const;
834 
842  virtual TQRect drawDropVisualizer (TQPainter *p, TQListViewItem *parent, TQListViewItem *after);
843 
850  virtual TQRect drawItemHighlighter(TQPainter *painter, TQListViewItem *item);
851 
858  virtual void startDrag();
859 
867  virtual void keyPressEvent (TQKeyEvent*);
868 
876  virtual void viewportPaintEvent(TQPaintEvent*);
877 
882  void activateAutomaticSelection();
887  void deactivateAutomaticSelection();
893  bool automaticSelection() const;
894 
898  virtual void viewportResizeEvent(TQResizeEvent* e);
899 
907  void disableAutoSelection();
908 
914  void resetAutoSelection();
915 
920  // KDE 4: remove
921  void doubleClicked( TQListViewItem *item, const TQPoint &pos, int c );
922 
923 protected slots:
928  void slotSettingsChanged(int);
929 
930  void slotMouseButtonClicked( int btn, TQListViewItem *item, const TQPoint &pos, int c );
931  void doneEditing(TQListViewItem *item, int row);
932 
936  void cleanDropVisualizer();
937 
941  void cleanItemHighlighter();
942 
946  void emitContextMenu (TQListViewItem*, const TQPoint&, int);
947 
951  void emitContextMenu (TDEListView*, TQListViewItem*);
952 
957  void slotOnItem( TQListViewItem *item );
958 
963  void slotOnViewport();
964 
969  void slotAutoSelect();
970 
971  void slotDragExpand();
972 
977  void slotHeaderChanged();
978 
979 protected:
983  virtual void movableDropEvent (TQListViewItem* parent, TQListViewItem* afterme);
984 
991  virtual void findDrop(const TQPoint &pos, TQListViewItem *&parent, TQListViewItem *&after);
992 
996  void fileManagerKeyPressEvent (TQKeyEvent*);
997 
1001  int depthToPixels( int depth );
1002 
1003 private:
1004  class Tooltip;
1005 protected:
1006  virtual void virtual_hook( int id, void* data );
1007 private:
1008  class TDEListViewPrivate;
1009  TDEListViewPrivate* const d;
1010  bool isExecuteArea( int x, TQListViewItem* item );
1011 };
1012 
1019 class TDEUI_EXPORT TDEListViewItem : public TQListViewItem
1020 {
1021  friend class TDEListView;
1022 public:
1029  TDEListViewItem(TQListView *parent);
1030  TDEListViewItem(TQListViewItem *parent);
1031  TDEListViewItem(TQListView *parent, TQListViewItem *after);
1032  TDEListViewItem(TQListViewItem *parent, TQListViewItem *after);
1033 
1034  TDEListViewItem(TQListView *parent,
1035  TQString, TQString = TQString::null,
1036  TQString = TQString::null, TQString = TQString::null,
1037  TQString = TQString::null, TQString = TQString::null,
1038  TQString = TQString::null, TQString = TQString::null);
1039 
1040  TDEListViewItem(TQListViewItem *parent,
1041  TQString, TQString = TQString::null,
1042  TQString = TQString::null, TQString = TQString::null,
1043  TQString = TQString::null, TQString = TQString::null,
1044  TQString = TQString::null, TQString = TQString::null);
1045 
1046  TDEListViewItem(TQListView *parent, TQListViewItem *after,
1047  TQString, TQString = TQString::null,
1048  TQString = TQString::null, TQString = TQString::null,
1049  TQString = TQString::null, TQString = TQString::null,
1050  TQString = TQString::null, TQString = TQString::null);
1051 
1052  TDEListViewItem(TQListViewItem *parent, TQListViewItem *after,
1053  TQString, TQString = TQString::null,
1054  TQString = TQString::null, TQString = TQString::null,
1055  TQString = TQString::null, TQString = TQString::null,
1056  TQString = TQString::null, TQString = TQString::null);
1057 
1058  virtual ~TDEListViewItem();
1059 
1060  virtual void insertItem(TQListViewItem *item);
1061  virtual void takeItem(TQListViewItem *item);
1065  bool isAlternate();
1069  const TQColor &backgroundColor() KDE_DEPRECATED; // #### should be removed in 4.0; use below instead
1070 
1079  TQColor backgroundColor(int column);
1080 
1081  virtual void paintCell(TQPainter *p, const TQColorGroup &cg,
1082  int column, int width, int alignment);
1083 
1084 private:
1085  void init();
1086 
1087 private:
1088  uint m_odd : 1;
1089  uint m_known : 1;
1090  uint m_unused : 30;
1091 };
1092 
1093 #endif
1094 
1095 // vim: ts=2 sw=2 et

tdeui

Skip menu "tdeui"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeui

Skip menu "tdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • knewstuff
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.8.3.1
This website is maintained by Timothy Pearson.