Version: 6.3.1

src/QDS/QDS_Table.h

Go to the documentation of this file.
00001 // Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 #ifndef QDS_TABLE_H
00024 #define QDS_TABLE_H
00025 
00026 #include "QDS_Datum.h"
00027 
00028 #include <QtxTable.h>
00029 
00030 #include <QMap>
00031 #include <QVector>
00032 
00033 class QDS_EXPORT QDS_Table : public QtxTable
00034 {
00035   class DeleteFilter;
00036 
00037   Q_OBJECT
00038 
00039   Q_PROPERTY( bool KeepEditors READ isKeepEditors WRITE setKeepEditors )
00040 
00041 public:
00042   QDS_Table( QWidget* = 0, const char* = 0 );
00043   QDS_Table( int, int, QWidget* = 0, const char* = 0 );
00044   virtual ~QDS_Table();
00045 
00046   QDS_Datum*       verticalHeaderEditor() const;
00047   QDS_Datum*       horizontalHeaderEditor() const;
00048   QDS_Datum*       headerEditor( const Orientation ) const;
00049 
00050   void             setVerticalHeaderEditor( QDS_Datum* );
00051   void             setHorizontalHeaderEditor( QDS_Datum* );
00052 
00053   void             setHeaderEditor( QDS_Datum* );
00054   virtual void     setHeaderEditor( const Orientation, QDS_Datum* );
00055 
00056   QDS_Datum*       tableEditor() const;
00057   virtual void     setTableEditor( QDS_Datum* );
00058 
00059   QDS_Datum*       rowEditor( const int ) const;
00060   QDS_Datum*       columnEditor( const int ) const;
00061 
00062   virtual void     setRowEditor( const int, QDS_Datum* );
00063   virtual void     setColumnEditor( const int, QDS_Datum* );
00064 
00065   QDS_Datum*       cellEditor( const int, const int ) const;
00066   virtual void     setCellEditor( const int, const int, QDS_Datum* );
00067 
00068   QDS_Datum*       actualCellEditor( const int, const int ) const;
00069 
00070   virtual void     setNumRows( int );
00071   virtual void     setNumCols( int );
00072   virtual void     clearCellWidget( int, int );
00073 
00074   bool             isKeepEditors() const;
00075   void             setKeepEditors( const bool );
00076 
00077 protected:
00078   virtual QWidget* createHeaderEditor( QHeader*, const int, const bool = true );
00079   virtual QWidget* createEditor( int, int, bool ) const;
00080   virtual void     endEdit( int, int, bool, bool );
00081   virtual void     setCellContentFromEditor( int, int );
00082   virtual void     setHeaderContentFromEditor( QHeader*, const int, QWidget* );
00083 
00084 private:
00085   void             initEditor( QDS_Datum* );
00086   QDS_Datum*       datum( const QWidget* ) const;
00087 
00088 private:
00089   typedef QVector<QDS_Datum*>         DatumVector;
00090   typedef QMap<int, QDS_Datum*>       DatumMap;
00091   typedef QMap<int, DatumMap>         CellMap;
00092 
00093 private:
00094   QDS_Datum*       myHorEdit;
00095   QDS_Datum*       myVerEdit;
00096   DatumVector      myRowEdit;
00097   DatumVector      myColEdit;
00098   CellMap          myCellEdit;
00099   QDS_Datum*       myTableEdit;
00100   bool             myKeepEdits;
00101 };
00102 
00103 #endif 
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS