25 #include <tqlistview.h>
26 #include <tdeshortcut.h>
27 #include <tqptrlist.h>
28 #include <tdelibs_export.h>
35 class TDEListViewRenameSettings
38 bool m_useRenameSignals;
42 TDEListViewRenameSettings()
43 : m_useRenameSignals(false), m_SCNext(), m_SCPrev() {}
46 : m_useRenameSignals(useRenameSignals), m_SCNext(scNext), m_SCPrev(scPrev) {}
48 TDEListViewRenameSettings(
const TDEListViewRenameSettings &that)
49 : m_useRenameSignals(that.m_useRenameSignals), m_SCNext(that.m_SCNext), m_SCPrev(that.m_SCPrev) {}
51 TDEListViewRenameSettings& operator=(
const TDEListViewRenameSettings &that)
53 if (
this==&that)
return *
this;
54 m_useRenameSignals = that.m_useRenameSignals;
55 m_SCNext = that.m_SCNext;
56 m_SCPrev = that.m_SCPrev;
91 TQ_PROPERTY(
bool fullWidth READ fullWidth WRITE setFullWidth )
92 TQ_PROPERTY(
bool itemsMovable READ itemsMovable WRITE setItemsMovable )
93 TQ_PROPERTY(
bool itemsRenameable READ itemsRenameable WRITE setItemsRenameable )
94 TQ_PROPERTY(
bool dragEnabled READ dragEnabled WRITE setDragEnabled )
95 TQ_PROPERTY(
bool autoOpen READ autoOpen WRITE setAutoOpen )
96 TQ_PROPERTY(
bool dropVisualizer READ dropVisualizer WRITE setDropVisualizer )
97 TQ_PROPERTY(
int tooltipColumn READ tooltipColumn WRITE setTooltipColumn )
98 TQ_PROPERTY(
int dropVisualizerWidth READ dropVisualizerWidth WRITE setDropVisualizerWidth )
99 TQ_PROPERTY( TQColor alternateBackground READ alternateBackground WRITE setAlternateBackground )
100 TQ_PROPERTY(
bool shadeSortColumn READ shadeSortColumn WRITE setShadeSortColumn )
102 TQ_OVERRIDE(
SelectionModeExt selectionMode READ selectionModeExt WRITE setSelectionModeExt )
137 Single = TQListView::Single,
138 Multi = TQListView::Multi,
139 Extended = TQListView::Extended,
140 NoSelection = TQListView::NoSelection,
150 TDEListView (TQWidget *parent = 0,
const char *name = 0);
164 virtual void setAcceptDrops (
bool);
175 virtual bool isExecuteArea(
const TQPoint& point );
182 bool isExecuteArea(
int x );
189 TQPtrList<TQListViewItem> selectedItems()
const;
201 TQPtrList<TQListViewItem> selectedItems(
bool includeHiddenItems)
const;
209 void moveItem(TQListViewItem *item, TQListViewItem *parent, TQListViewItem *after);
216 TQListViewItem *lastItem()
const;
223 TQListViewItem* lastChild ()
const;
239 bool itemsMovable()
const;
246 bool itemsRenameable()
const;
253 bool dragEnabled()
const;
260 bool autoOpen()
const;
267 bool isRenameable (
int column)
const;
274 bool dropVisualizer()
const;
281 int tooltipColumn()
const;
289 bool createChildren() const TDE_DEPRECATED;
296 bool dropHighlighter() const;
304 int dropVisualizerWidth () const;
312 SelectionModeExt selectionModeExt () const;
319 int itemIndex( const TQListViewItem *item ) const;
326 TQListViewItem* itemAtIndex(
int index);
332 void setFullWidth() TDE_DEPRECATED;
339 void setFullWidth(
bool fullWidth);
346 bool fullWidth() const;
353 virtual
int addColumn(const TQString& label,
int width = -1);
357 virtual
int addColumn(const TQIconSet& iconset, const TQString& label,
int width = -1);
363 virtual
void removeColumn(
int index);
374 void setAlternateBackground(const TQColor &c);
380 const TQColor &alternateBackground() const;
389 void saveLayout(
TDEConfig *config, const TQString &group) const;
397 void restoreLayout(
TDEConfig *config, const TQString &group);
404 virtual
void setSorting(
int column,
bool ascending = true);
409 int columnSorted(
void) const;
414 bool ascendingSort(
void) const;
419 virtual
void takeItem(TQListViewItem *i);
427 void setShadeSortColumn(
bool shadeSortColumn);
435 bool shadeSortColumn(
void) const;
443 void setUseSmallExecuteArea(
bool enable);
450 bool useSmallExecuteArea() const;
460 void setRenameSettings(const TDEListViewRenameSettings &renSett);
474 void executed( TQListViewItem *item );
487 void executed( TQListViewItem *item, const TQPoint &pos,
int c );
499 void dropped (TQDropEvent * e, TQListViewItem *after);
513 void dropped (
TDEListView* list, TQDropEvent* e, TQListViewItem* after);
527 void dropped (
TDEListView* list, TQDropEvent* e, TQListViewItem* parent, TQListViewItem* after);
540 void dropped (TQDropEvent* e, TQListViewItem* parent, TQListViewItem* after);
571 void moved (TQListViewItem *item, TQListViewItem *afterFirst, TQListViewItem *afterNow);
579 void moved(TQPtrList<TQListViewItem> &items, TQPtrList<TQListViewItem> &afterFirst, TQPtrList<TQListViewItem> &afterNow);
588 void itemRenamed(TQListViewItem* item, const TQString &str,
int col);
593 void itemRenamed(TQListViewItem* item);
605 void menuShortCutPressed (
TDEListView* list, TQListViewItem* item);
615 void contextMenu(
TDEListView* l, TQListViewItem* i, const TQPoint& p);
617 void itemAdded(TQListViewItem *item);
618 void itemRemoved(TQListViewItem *item);
631 void renameNext(TQListViewItem* item,
int col);
644 void renamePrev(TQListViewItem* item,
int col);
650 virtual
void rename(TQListViewItem *item,
int c);
662 void setRenameable (
int column,
bool yesno=true);
670 virtual
void setItemsMovable(
bool b);
679 virtual
void setItemsRenameable(
bool b);
685 virtual
void setDragEnabled(
bool b);
690 virtual
void setAutoOpen(
bool b);
697 virtual
void setDropVisualizer(
bool b);
703 void setDropVisualizerWidth (
int w);
711 virtual
void setTooltipColumn(
int column);
718 virtual
void setDropHighlighter(
bool b);
726 virtual
void setCreateChildren(
bool b) TDE_DEPRECATED;
739 void setTabOrderedRenaming(
bool b);
745 bool tabOrderedRenaming() const;
753 virtual
void selectAll(
bool select );
764 inline
bool below (const TQRect& rect, const TQPoint& p)
766 return (p.y() > (rect.top() + (rect.bottom() - rect.top())/2));
778 inline bool below (TQListViewItem* i,
const TQPoint& p)
780 return below (itemRect(i), contentsToViewport(p));
787 virtual bool event( TQEvent * );
793 void emitExecute( TQListViewItem *item,
const TQPoint &pos,
int c );
802 virtual void focusInEvent(TQFocusEvent* fe);
811 virtual void focusOutEvent( TQFocusEvent *fe );
820 virtual void leaveEvent( TQEvent *e );
825 virtual TQString tooltip(TQListViewItem* item,
int column)
const;
830 virtual bool showTooltip(TQListViewItem *item,
const TQPoint &pos,
int column)
const;
839 virtual void contentsDragMoveEvent (TQDragMoveEvent *event);
848 virtual void contentsMousePressEvent( TQMouseEvent *e );
857 virtual void contentsMouseMoveEvent( TQMouseEvent *e );
866 virtual void contentsMouseDoubleClickEvent ( TQMouseEvent *e );
875 virtual void contentsDragLeaveEvent (TQDragLeaveEvent *event);
884 virtual void contentsMouseReleaseEvent (TQMouseEvent*);
893 virtual void contentsDropEvent (TQDropEvent*);
902 virtual void contentsDragEnterEvent (TQDragEnterEvent *);
909 virtual TQDragObject *dragObject();
916 virtual bool acceptDrag (TQDropEvent* event)
const;
925 virtual TQRect drawDropVisualizer (TQPainter *p, TQListViewItem *parent, TQListViewItem *after);
933 virtual TQRect drawItemHighlighter(TQPainter *painter, TQListViewItem *item);
941 virtual void startDrag();
950 virtual void keyPressEvent (TQKeyEvent*);
959 virtual void viewportPaintEvent(TQPaintEvent*);
965 void activateAutomaticSelection();
970 void deactivateAutomaticSelection();
976 bool automaticSelection()
const;
981 virtual void viewportResizeEvent(TQResizeEvent* e);
990 void disableAutoSelection();
997 void resetAutoSelection();
1004 void resetKeyboardSelectionOperation();
1012 void setActiveMultiSelectItem(TQListViewItem *item);
1019 void doubleClicked( TQListViewItem *item,
const TQPoint &pos,
int c );
1026 void slotSettingsChanged(
int);
1027 void slotMouseButtonClicked(
int btn, TQListViewItem *item,
const TQPoint &pos,
int c );
1028 void doneEditing(TQListViewItem *item,
int row);
1029 void renameNextProxy(TQListViewItem *item,
int col);
1030 void renamePrevProxy(TQListViewItem *item,
int col);
1035 void cleanDropVisualizer();
1040 void cleanItemHighlighter();
1045 void emitContextMenu (TQListViewItem*,
const TQPoint&,
int);
1050 void emitContextMenu (
TDEListView*, TQListViewItem*);
1056 void slotOnItem( TQListViewItem *item );
1062 void slotOnViewport();
1068 void slotAutoSelect();
1070 void slotDragExpand();
1076 void slotHeaderChanged();
1082 virtual void movableDropEvent (TQListViewItem* parent, TQListViewItem* afterme);
1090 virtual void findDrop(
const TQPoint &pos, TQListViewItem *&parent, TQListViewItem *&after);
1095 void fileManagerKeyPressEvent (TQKeyEvent*);
1100 int depthToPixels(
int depth );
1105 virtual void virtual_hook(
int id,
void* data );
1107 class TDEListViewPrivate;
1108 TDEListViewPrivate*
const d;
1109 bool isExecuteArea(
int x, TQListViewItem* item );
1134 TQString, TQString = TQString::null,
1135 TQString = TQString::null, TQString = TQString::null,
1136 TQString = TQString::null, TQString = TQString::null,
1137 TQString = TQString::null, TQString = TQString::null);
1140 TQString, TQString = TQString::null,
1141 TQString = TQString::null, TQString = TQString::null,
1142 TQString = TQString::null, TQString = TQString::null,
1143 TQString = TQString::null, TQString = TQString::null);
1146 TQString, TQString = TQString::null,
1147 TQString = TQString::null, TQString = TQString::null,
1148 TQString = TQString::null, TQString = TQString::null,
1149 TQString = TQString::null, TQString = TQString::null);
1152 TQString, TQString = TQString::null,
1153 TQString = TQString::null, TQString = TQString::null,
1154 TQString = TQString::null, TQString = TQString::null,
1155 TQString = TQString::null, TQString = TQString::null);
1159 virtual void insertItem(TQListViewItem *item);
1160 virtual void takeItem(TQListViewItem *item);
1168 const TQColor &backgroundColor() TDE_DEPRECATED;
1178 TQColor backgroundColor(
int column);
1180 virtual void paintCell(TQPainter *p,
const TQColorGroup &cg,
1181 int column,
int width,
int alignment);
An enhanced TQLineEdit widget for inputting text.
A listview item with support for alternate background colors.
This Widget extends the functionality of TQListView to honor the system wide settings for Single Clic...
virtual void takeItem(TQListViewItem *i)
Reimplemented for internal reasons.
SelectionModeExt
Possible selection modes.
bool below(TQListViewItem *i, const TQPoint &p)
An overloaded version of below(const TQRect&, const TQPoint&).