kspread_cluster.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056 #ifndef kspread_cluster_h
00057 #define kspread_cluster_h
00058
00059 class KSpreadCell;
00060 class ColumnFormat;
00061 class RowFormat;
00062
00063 #include "kspread_value.h"
00064
00065 class QPoint;
00066
00067 #define KSPREAD_CLUSTER_LEVEL1 128
00068 #define KSPREAD_CLUSTER_LEVEL2 256
00069 #define KSPREAD_CLUSTER_MAX (128*256)
00070
00071 class KSpreadCluster
00072 {
00073 public:
00074 KSpreadCluster();
00075 ~KSpreadCluster();
00076
00077 KSpreadCell* lookup( int x, int y ) const;
00078
00083 void clear();
00084
00089 void insert( KSpreadCell* cell, int x, int y );
00093 void remove( int x, int y );
00094
00095 void setAutoDelete( bool );
00096 bool autoDelete() const;
00097
00098 KSpreadCell* firstCell() const;
00099
00100 bool shiftRow( const QPoint& marker );
00108 bool shiftColumn( const QPoint& marker );
00109
00114 void unshiftColumn( const QPoint& marker );
00115 void unshiftRow( const QPoint& marker );
00116
00124 bool insertColumn( int col );
00125 bool insertRow( int row );
00126
00134 void removeColumn( int col );
00135 void removeRow( int row );
00136
00141 void clearColumn( int col );
00142 void clearRow( int row );
00143
00148 KSpreadValue valueRange (int col1, int row1, int col2, int row2) const;
00149
00159 KSpreadCell* getFirstCellColumn(int col) const;
00160
00170 KSpreadCell* getLastCellColumn(int col) const;
00171
00181 KSpreadCell* getFirstCellRow(int row) const;
00182
00192 KSpreadCell* getLastCellRow(int row) const;
00193
00203 KSpreadCell* getNextCellUp(int col, int row) const;
00204
00214 KSpreadCell* getNextCellDown(int col, int row) const;
00215
00226 KSpreadCell* getNextCellRight(int col, int row) const;
00227
00238 KSpreadCell* getNextCellLeft(int col, int row) const;
00239
00240 private:
00245 bool shiftRow( const QPoint& marker, bool& work );
00246 bool shiftColumn( const QPoint& marker, bool& work );
00247
00248 void unshiftColumn( const QPoint& marker, bool& work );
00249 void unshiftRow( const QPoint& marker, bool& work );
00250
00252 KSpreadValue makeArray (int col1, int row1, int col2, int row2) const;
00253
00254 KSpreadCell*** m_cluster;
00255 KSpreadCell* m_first;
00256 bool m_autoDelete;
00257 unsigned int m_biggestX, m_biggestY;
00258 };
00259
00260 class KSpreadColumnCluster
00261 {
00262 public:
00263 KSpreadColumnCluster();
00264 ~KSpreadColumnCluster();
00265
00266 const ColumnFormat* lookup( int col ) const;
00267 ColumnFormat* lookup( int col );
00268
00269 void clear();
00270
00271 void insertElement( ColumnFormat*, int col );
00272 void removeElement( int col );
00273
00274 bool insertColumn( int col );
00275 bool removeColumn( int col );
00276
00277 void setAutoDelete( bool );
00278 bool autoDelete() const;
00279
00280 ColumnFormat* first()const { return m_first; }
00281
00282 private:
00283 ColumnFormat*** m_cluster;
00284 ColumnFormat* m_first;
00285 bool m_autoDelete;
00286 };
00287
00288 class KSpreadRowCluster
00289 {
00290 public:
00291 KSpreadRowCluster();
00292 ~KSpreadRowCluster();
00293
00294 const RowFormat* lookup( int col ) const;
00295 RowFormat* lookup( int col );
00296
00297 void clear();
00298
00299 void insertElement( RowFormat*, int row );
00300 void removeElement( int row );
00301
00302 bool insertRow( int row );
00303 bool removeRow( int row );
00304
00305 void setAutoDelete( bool );
00306 bool autoDelete() const;
00307
00308 RowFormat* first()const { return m_first; }
00309
00310 private:
00311 RowFormat*** m_cluster;
00312 RowFormat* m_first;
00313 bool m_autoDelete;
00314 };
00315
00316 #endif
This file is part of the documentation for kspread Library Version 1.4.2.