1 /*---------------------------------------------------------------------\
3 | __ __ ____ _____ ____ |
4 | \ \ / /_ _/ ___|_ _|___ \ |
5 | \ V / _` \___ \ | | __) | |
6 | | | (_| |___) || | / __/ |
7 | |_|\__,_|____/ |_| |_____| |
11 \----------------------------------------------------------------------/
15 Author: Stefan Hundhammer <sh@suse.de>
27 class QTreeWidgetItem;
30 class YQTable : public QFrame, public YTable
39 YQTable( YWidget * parent, YTableHeader * header );
47 * Switch between sorting by item insertion order (keepSorting: true) or
48 * allowing the user to sort by an arbitrary column (by clicking on the
51 * Reimplemented from YTable.
53 virtual void setKeepSorting( bool keepSorting );
58 * Reimplemented from YSelectionWidget.
60 virtual void addItem( YItem * item );
63 * Select or deselect an item.
65 * Reimplemented from YSelectionWidget.
67 virtual void selectItem( YItem * item, bool selected = true );
72 * Reimplemented from YSelectionWidget.
74 virtual void deselectAllItems();
79 * Reimplemented from YSelectionWidget.
81 virtual void deleteAllItems();
84 * Notification that a cell (its text and/or its icon) was changed from the
85 * outside. Applications are required to call this whenever a table cell is
86 * changed after adding the corresponding table item (the row) to the table
89 * Reimplemented from YTable.
91 virtual void cellChanged( const YTableCell * cell );
94 * Set enabled/disabled state.
96 * Reimplemented from YWidget.
98 virtual void setEnabled( bool enabled );
101 * Preferred width of the widget.
103 * Reimplemented from YWidget.
105 virtual int preferredWidth();
108 * Preferred height of the widget.
110 * Reimplemented from YWidget.
112 virtual int preferredHeight();
115 * Set the new size of the widget.
117 * Reimplemented from YWidget.
119 virtual void setSize( int newWidth, int newHeight );
122 * Accept the keyboard focus.
124 * Reimplemented from YWidget.
126 virtual bool setKeyboardFocus();
132 * Notification that an item is selected (single click or keyboard).
134 void slotSelected( QTreeWidgetItem * );
137 * Notification that an item is activated (double click or keyboard).
139 void slotActivated( QTreeWidgetItem * );
145 * Select the original item (the YTableItem) that corresponds to the
146 * specified listViewItem.
148 void selectOrigItem( QTreeWidgetItem * listViewItem );
154 QY2ListView * _qt_listView;
160 * Visual representation of a YTableItem.
162 class YQTableListViewItem: public QY2ListViewItem
169 YQTableListViewItem( YQTable * table,
170 QY2ListView * parent,
171 YTableItem * origItem );
174 * Return the parent table widget.
176 YQTable * table() const { return _table; }
179 * Return the corresponding YTableItem.
181 YTableItem * origItem() const { return _origItem; }
184 * Update this item's display with the content of 'cell'.
186 void updateCell( const YTableCell * cell );
191 YTableItem * _origItem;