libyui
YTable.h
1 /*
2  Copyright (C) 2000-2012 Novell, Inc
3  This library is free software; you can redistribute it and/or modify
4  it under the terms of the GNU Lesser General Public License as
5  published by the Free Software Foundation; either version 2.1 of the
6  License, or (at your option) version 3.0 of the License. This library
7  is distributed in the hope that it will be useful, but WITHOUT ANY
8  WARRANTY; without even the implied warranty of MERCHANTABILITY or
9  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10  License for more details. You should have received a copy of the GNU
11  Lesser General Public License along with this library; if not, write
12  to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
13  Floor, Boston, MA 02110-1301 USA
14 */
15 
16 
17 /*-/
18 
19  File: YTable.h
20 
21  Author: Stefan Hundhammer <shundhammer@suse.de>
22 
23 /-*/
24 
25 #ifndef YTable_h
26 #define YTable_h
27 
28 #include "YTypes.h"
29 #include "YSelectionWidget.h"
30 #include "YTableItem.h"
31 #include "YTableHeader.h"
32 
33 class YTablePrivate;
34 
35 
36 
59 class YTable : public YSelectionWidget
60 {
61 protected:
74  YTable( YWidget * parent, YTableHeader * header, bool multiSelection );
75 
76 public:
77 
81  virtual ~YTable();
82 
87  virtual const char * widgetClass() const { return "YTable"; }
88 
92  int columns() const;
93 
98  bool hasColumn( int column ) const;
99 
103  std::string header( int column ) const;
104 
108  YAlignmentType alignment( int column ) const;
109 
120  bool immediateMode() const;
121 
125  void setImmediateMode( bool immediateMode = true );
126 
132  bool keepSorting() const;
133 
142  virtual void setKeepSorting( bool keepSorting );
143 
148  bool hasMultiSelection() const;
149 
156  YItem * findItem( const std::string & wantedItemLabel, int column ) const;
157 
158  YItem * findItem( const std::string & wantedItemLabel,
159  int column,
161  YItemConstIterator end ) const;
162 
175  virtual void cellChanged( const YTableCell * cell ) = 0;
176 
187  virtual bool setProperty( const std::string & propertyName,
188  const YPropertyValue & val );
189 
196  virtual YPropertyValue getProperty( const std::string & propertyName );
197 
204  virtual const YPropertySet & propertySet();
205 
206 
211  const char * userInputProperty() { return YUIProperty_CurrentItem; }
212 
213 
214 protected:
215 
223  void setTableHeader( YTableHeader * newHeader );
224 
225 private:
226 
228 };
229 
230 
231 #endif // YTable_h
int columns() const
Definition: YTable.cc:87
YAlignmentType alignment(int column) const
Definition: YTable.cc:108
YTable(YWidget *parent, YTableHeader *header, bool multiSelection)
Definition: YTable.cc:52
virtual const char * widgetClass() const
Definition: YTable.h:87
virtual void cellChanged(const YTableCell *cell)=0
Definition: YProperty.h:104
YWidgetListIterator end()
Definition: YWidget.h:245
bool hasMultiSelection() const
Definition: YTable.cc:146
Definition: YSelectionWidget.h:45
Definition: YTableHeader.h:43
Definition: YTable.cc:35
Definition: YProperty.h:197
void setImmediateMode(bool immediateMode=true)
Definition: YTable.cc:122
YWidget * parent() const
Definition: YWidget.cc:271
virtual YPropertyValue getProperty(const std::string &propertyName)
Definition: YTable.cc:241
Definition: YTableItem.h:271
Definition: YTable.h:59
virtual const YPropertySet & propertySet()
Definition: YTable.cc:179
virtual ~YTable()
Definition: YTable.cc:66
std::string header(int column) const
Definition: YTable.cc:101
virtual bool setProperty(const std::string &propertyName, const YPropertyValue &val)
Definition: YTable.cc:220
bool immediateMode() const
Definition: YTable.cc:115
Definition: YItem.h:55
YItemCollection::const_iterator YItemConstIterator
Const iterator over YItemCollection.
Definition: YItem.h:45
void setTableHeader(YTableHeader *newHeader)
Definition: YTable.cc:74
const char * userInputProperty()
Definition: YTable.h:211
YWidgetListIterator begin()
Definition: YWidget.h:238
virtual void setKeepSorting(bool keepSorting)
Definition: YTable.cc:139
bool keepSorting() const
Definition: YTable.cc:132
bool hasColumn(int column) const
Definition: YTable.cc:94
Definition: YWidget.h:54
YItem * findItem(const std::string &wantedItemLabel, int column) const