Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages   Examples  

qdbtcellmatrix.h

00001 #ifndef _QDBTCELLMATRIX_H
00002 #define _QDBTCELLMATRIX_H
00003 
00004 #include <qvector.h>
00005 
00006 #include <qdbt/qdbtglobal.h>
00007 #include <qdbt/qdbttabcell.h>
00008 
00009 
00010 // This class represents a 2D array (matrix) where the cells of the table
00011 // are stored. It is implemented as a QVector of cells rows.
00012 // Each cell row is a QVector of cells (one for each column).
00013 // I have chosen this order, because I assume the number of rows changes
00014 // more frequently than the number of columns.
00015 
00016 class QdbtPImpl;
00017 
00018 class QdbtCellMatrix
00019 {
00020   typedef QVector<QdbtBaseCell> Row;
00021   typedef QVector<Row> Matrix;
00022 
00023 public:
00024   QdbtCellMatrix( QdbtPImpl *, int r = 0, int c = 0 );
00025   ~QdbtCellMatrix();
00026   void resize( int r, int c );
00027   void insertCol( int c );
00028   void insertRow( int r );
00029   void removeCol( int c );
00030   void removeRow( int r );
00031   QdbtBaseCell *at( int r, int c ) const;
00032   QdbtBaseCell *&operator()( int r, int c );
00033   void exchangeCols( int col1, int col2 );
00034   
00035 private:
00036   Matrix      m;
00037   QdbtPImpl * _pimpl;
00038 };
00039 
00040 #endif

Generated on Mon Apr 22 12:21:53 2002 for QdbtTabular by doxygen1.2.15-20020421