1 // Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #include "QDS_Datum.h"
27 #include <qptrvector.h>
29 class QDS_EXPORT QDS_Table : public QtxTable
35 Q_PROPERTY( bool KeepEditors READ isKeepEditors WRITE setKeepEditors )
38 QDS_Table( QWidget* = 0, const char* = 0 );
39 QDS_Table( int, int, QWidget* = 0, const char* = 0 );
42 QDS_Datum* verticalHeaderEditor() const;
43 QDS_Datum* horizontalHeaderEditor() const;
44 QDS_Datum* headerEditor( const Orientation ) const;
46 void setVerticalHeaderEditor( QDS_Datum* );
47 void setHorizontalHeaderEditor( QDS_Datum* );
49 void setHeaderEditor( QDS_Datum* );
50 virtual void setHeaderEditor( const Orientation, QDS_Datum* );
52 QDS_Datum* tableEditor() const;
53 virtual void setTableEditor( QDS_Datum* );
55 QDS_Datum* rowEditor( const int ) const;
56 QDS_Datum* columnEditor( const int ) const;
58 virtual void setRowEditor( const int, QDS_Datum* );
59 virtual void setColumnEditor( const int, QDS_Datum* );
61 QDS_Datum* cellEditor( const int, const int ) const;
62 virtual void setCellEditor( const int, const int, QDS_Datum* );
64 QDS_Datum* actualCellEditor( const int, const int ) const;
66 virtual void setNumRows( int );
67 virtual void setNumCols( int );
68 virtual void clearCellWidget( int, int );
70 bool isKeepEditors() const;
71 void setKeepEditors( const bool );
74 virtual QWidget* createHeaderEditor( QHeader*, const int, const bool = true );
75 virtual QWidget* createEditor( int, int, bool ) const;
76 virtual void endEdit( int, int, bool, bool );
77 virtual void setCellContentFromEditor( int, int );
78 virtual void setHeaderContentFromEditor( QHeader*, const int, QWidget* );
81 void initEditor( QDS_Datum* );
82 QDS_Datum* datum( const QWidget* ) const;
85 typedef QPtrVector<QDS_Datum> DatumVector;
86 typedef QMap<int, QDS_Datum*> DatumMap;
87 typedef QMap<int, DatumMap> CellMap;
92 DatumVector myRowEdit;
93 DatumVector myColEdit;
95 QDS_Datum* myTableEdit;