1 // Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
26 #include "QDS_Datum.h"
33 class QDS_EXPORT QDS_Table : public QtxTable
39 Q_PROPERTY( bool KeepEditors READ isKeepEditors WRITE setKeepEditors )
42 QDS_Table( QWidget* = 0, const char* = 0 );
43 QDS_Table( int, int, QWidget* = 0, const char* = 0 );
46 QDS_Datum* verticalHeaderEditor() const;
47 QDS_Datum* horizontalHeaderEditor() const;
48 QDS_Datum* headerEditor( const Orientation ) const;
50 void setVerticalHeaderEditor( QDS_Datum* );
51 void setHorizontalHeaderEditor( QDS_Datum* );
53 void setHeaderEditor( QDS_Datum* );
54 virtual void setHeaderEditor( const Orientation, QDS_Datum* );
56 QDS_Datum* tableEditor() const;
57 virtual void setTableEditor( QDS_Datum* );
59 QDS_Datum* rowEditor( const int ) const;
60 QDS_Datum* columnEditor( const int ) const;
62 virtual void setRowEditor( const int, QDS_Datum* );
63 virtual void setColumnEditor( const int, QDS_Datum* );
65 QDS_Datum* cellEditor( const int, const int ) const;
66 virtual void setCellEditor( const int, const int, QDS_Datum* );
68 QDS_Datum* actualCellEditor( const int, const int ) const;
70 virtual void setNumRows( int );
71 virtual void setNumCols( int );
72 virtual void clearCellWidget( int, int );
74 bool isKeepEditors() const;
75 void setKeepEditors( const bool );
78 virtual QWidget* createHeaderEditor( QHeader*, const int, const bool = true );
79 virtual QWidget* createEditor( int, int, bool ) const;
80 virtual void endEdit( int, int, bool, bool );
81 virtual void setCellContentFromEditor( int, int );
82 virtual void setHeaderContentFromEditor( QHeader*, const int, QWidget* );
85 void initEditor( QDS_Datum* );
86 QDS_Datum* datum( const QWidget* ) const;
89 typedef QVector<QDS_Datum*> DatumVector;
90 typedef QMap<int, QDS_Datum*> DatumMap;
91 typedef QMap<int, DatumMap> CellMap;
96 DatumVector myRowEdit;
97 DatumVector myColEdit;
99 QDS_Datum* myTableEdit;