1 /*---------------------------------------------------------------------\
3 | __ __ ____ _____ ____ |
4 | \ \ / /_ _/ ___|_ _|___ \ |
5 | \ V / _` \___ \ | | __) | |
6 | | | (_| |___) || | / __/ |
7 | |_|\__,_|____/ |_| |_____| |
11 \----------------------------------------------------------------------/
15 Author: Stefan Hundhammer <sh@suse.de>
23 #include <ycp/YCPString.h>
32 class YQTable : public QFrame, public YTable
41 YQTable( YWidget * parent, YTableHeader * header );
49 * Switch between sorting by item insertion order (keepSorting: true) or
50 * allowing the user to sort by an arbitrary column (by clicking on the
53 * Reimplemented from YTable.
55 virtual void setKeepSorting( bool keepSorting );
60 * Reimplemented from YSelectionWidget.
62 virtual void addItem( YItem * item );
65 * Select or deselect an item.
67 * Reimplemented from YSelectionWidget.
69 virtual void selectItem( YItem * item, bool selected = true );
74 * Reimplemented from YSelectionWidget.
76 virtual void deselectAllItems();
81 * Reimplemented from YSelectionWidget.
83 virtual void deleteAllItems();
86 * Notification that a cell (its text and/or its icon) was changed from the
87 * outside. Applications are required to call this whenever a table cell is
88 * changed after adding the corresponding table item (the row) to the table
91 * Reimplemented from YTable.
93 virtual void cellChanged( const YTableCell * cell );
96 * Set enabled/disabled state.
98 * Reimplemented from YWidget.
100 virtual void setEnabled( bool enabled );
103 * Preferred width of the widget.
105 * Reimplemented from YWidget.
107 virtual int preferredWidth();
110 * Preferred height of the widget.
112 * Reimplemented from YWidget.
114 virtual int preferredHeight();
117 * Set the new size of the widget.
119 * Reimplemented from YWidget.
121 virtual void setSize( int newWidth, int newHeight );
124 * Accept the keyboard focus.
126 * Reimplemented from YWidget.
128 virtual bool setKeyboardFocus();
134 * Notification that an item is selected (single click or keyboard).
136 void slotSelected( Q3ListViewItem * );
139 * Notification that an item is activated (double click or keyboard).
141 void slotActivated( Q3ListViewItem * );
147 * Select the original item (the YTableItem) that corresponds to the
148 * specified listViewItem.
150 void selectOrigItem( Q3ListViewItem * listViewItem );
156 QY2ListView * _qt_listView;
162 * Visual representation of a YTableItem.
164 class YQTableListViewItem: public QY2ListViewItem
171 YQTableListViewItem( YQTable * table,
172 QY2ListView * parent,
173 YTableItem * origItem );
176 * Return the parent table widget.
178 YQTable * table() const { return _table; }
181 * Return the corresponding YTableItem.
183 YTableItem * origItem() const { return _origItem; }
186 * Update this item's display with the content of 'cell'.
188 void updateCell( const YTableCell * cell );
193 YTableItem * _origItem;