ICS

QicsTable Documentation Set

QicsTableCommon.h

Go to the documentation of this file.
00001 /*********************************************************************
00002 **
00003 ** Copyright (C) 2002-2006 Integrated Computer Solutions, Inc
00004 ** All rights reserved.
00005 **
00006 ** This file is part of the QicsTable Product.
00007 **
00008 **********************************************************************/
00009 
00010 #ifndef _QicsTABLECOMMON_H
00011 #define _QicsTABLECOMMON_H
00012 
00013 #include <QicsGridCommon.h>
00014 #include <QicsHeader.h>
00015 #include <QicsRow.h>
00016 #include <QicsColumn.h>
00017 #include <QicsRepeatingRow.h>
00018 #include <QicsRepeatingColumn.h>
00019 #include <QicsMainGrid.h>
00020 #include <QicsRowHeader.h>
00021 #include <QicsColumnHeader.h>
00022 #include <QicsCell.h>
00023 
00024 #include <QVector>
00025 
00027 
00038 
00039 
00042 
00043 
00044 class QICS_EXPORT QicsTableCommon: public QicsGridCommon
00045 {
00046     Q_OBJECT
00047 
00048     friend class QicsTable;
00049 
00050     friend class QicsTablePrint;
00051 
00052 public:
00053 
00054     
00055 
00064     QicsTableDisplayOption topHeaderVisible;
00065 
00070     QicsTableDisplayOption bottomHeaderVisible;
00071 
00076     QicsTableDisplayOption leftHeaderVisible;
00077 
00082     QicsTableDisplayOption rightHeaderVisible;
00083 
00089     int tableMargin;
00090 
00098     int tableSpacing;
00099 
00107     int gridSpacing;
00108 
00117     bool columnHeaderUsesModel;
00118 
00127     bool rowHeaderUsesModel;
00128 
00138     bool ignoreModelSizeChanges;
00140 
00141 public:
00146     QicsTableCommon(QObject *parent = 0, bool forward_signals = false);
00147 
00152     virtual ~QicsTableCommon();
00153 
00155 
00160     QicsDataModel *dataModel(void) const;
00165     virtual void setDataModel(QicsDataModel *dm);
00166 
00168 
00174     QicsRow &rowRef(int rownum);
00180     const QicsRow &rowRef(int rownum) const;
00181 
00192     QicsRow *row(int rownum, bool follow_model = true);
00203     const QicsRow *row(int rownum, bool follow_model = true) const;
00204 
00210     QicsColumn &columnRef(int colnum);
00216     const QicsColumn &columnRef(int colnum) const;
00217 
00228     QicsColumn *column(int colnum, bool follow_model = true);
00239     const QicsColumn *column(int colnum, bool follow_model = true) const;
00240 
00247     QicsRepeatingRow &repeatingRowRef(int start_row, unsigned int interval);
00254     const QicsRepeatingRow &repeatingRowRef(int start_row,
00255                         unsigned int interval) const;
00256 
00263     QicsRepeatingRow *repeatingRow(int start_row, unsigned int interval);
00270     const QicsRepeatingRow *repeatingRow(int start_row,
00271                      unsigned int interval) const;
00272 
00279     QicsRepeatingColumn &repeatingColumnRef(int start_col,
00280                         unsigned int interval);
00287     const QicsRepeatingColumn &repeatingColumnRef(int start_col,
00288                           unsigned int interval) const;
00289 
00296     QicsRepeatingColumn *repeatingColumn(int start_col,
00297                      unsigned int interval);
00304     const QicsRepeatingColumn *repeatingColumn(int start_col,
00305                            unsigned int interval) const;
00306 
00312     QicsCell &cellRef(int rownum, int colnum);
00318     const QicsCell &cellRef(int rownum, int colnum) const;
00319 
00330     QicsCell *cell(int rownum, int colnum, bool follow_model = true);
00341     const QicsCell *cell(int rownum, int colnum, bool follow_model = true) const;
00342 
00347     QicsMainGrid &mainGridRef(void);
00352     const QicsMainGrid &mainGridRef(void) const;
00353 
00358     QicsMainGrid *mainGrid(void);
00363     const QicsMainGrid *mainGrid(void) const;
00364 
00369     QicsRowHeader &rowHeaderRef(void);
00374     const QicsRowHeader &rowHeaderRef(void) const;
00375 
00380     QicsRowHeader *rowHeader(void);
00385     const QicsRowHeader *rowHeader(void) const;
00386 
00391     QicsColumnHeader &columnHeaderRef(void);
00396     const QicsColumnHeader &columnHeaderRef(void) const;
00397 
00402     QicsColumnHeader *columnHeader(void);
00407     const QicsColumnHeader *columnHeader(void) const;
00408 
00410 
00417     inline QicsTableDisplayOption topHeaderVisible(void) const
00418     { return myTopHeaderVisible; }
00419 
00426     inline QicsTableDisplayOption bottomHeaderVisible(void) const
00427     { return myBottomHeaderVisible; }
00428 
00435     inline QicsTableDisplayOption leftHeaderVisible(void) const
00436     { return myLeftHeaderVisible; }
00437 
00444     inline QicsTableDisplayOption rightHeaderVisible(void) const
00445     { return myRightHeaderVisible; }
00446 
00452     inline int tableMargin(void) const
00453     { return myTableMargin; }
00454 
00460     inline int tableSpacing(void) const
00461     { return myTableSpacing; }
00462 
00468     inline int gridSpacing(void) const
00469     { return myGridSpacing; }
00470 
00478     inline bool columnHeaderUsesModel(void) const
00479     { return myColumnHeaderUsesModel; } ;
00480 
00488     inline bool rowHeaderUsesModel(void) const
00489     { return myRowHeaderUsesModel; } ;
00490 
00498     bool ignoreModelSizeChanges(void) const;
00499 
00514     void sortRows(QVector<int> columns,
00515           QicsSortOrder order = Qics::Ascending,
00516           int from = 0, int to = -1,
00517           DataItemComparator func = 0);
00518 
00533     void sortColumns(QVector<int> rows,
00534              QicsSortOrder order = Qics::Ascending,
00535              int from = 0, int to = -1,
00536              DataItemComparator func = 0);
00537 
00544     void moveRows(int target_row, const QVector<int> &rows);
00545 
00552     void moveColumns(int target_col, const QVector<int> &cols);
00561     bool setMouseButton( Qt::MouseButton, Qt::Modifier, Qt::MouseButton );
00562 
00563 public slots:
00570     void setTopHeaderVisible(QicsTableDisplayOption);
00571 
00579     void setBottomHeaderVisible(QicsTableDisplayOption);
00580 
00587     void setLeftHeaderVisible(QicsTableDisplayOption);
00588 
00596     void setRightHeaderVisible(QicsTableDisplayOption);
00597 
00603     void setTableMargin(int margin);
00604 
00610     void setTableSpacing(int spacing);
00611 
00617     void setGridSpacing(int spacing);
00618 
00626     void setRowHeaderUsesModel(bool b);
00627 
00635      void setColumnHeaderUsesModel(bool b);
00636 
00644     void setIgnoreModelSizeChanges(bool b);
00645 
00649     void deleteColumn(int column);
00653     void addColumns(int howMany);
00657     void insertColumn(int column);
00661     void deleteRow(int row);
00665     void addRows(int rows);
00669     void insertRow(int row);
00670 
00675     void setDefaultRowHeightInPixels(int height);
00680     void setDefaultRowHeightInChars(int height);
00681 
00686     void setDefaultColumnWidthInPixels(int width);
00691     void setDefaultColumnWidthInChars(int width);
00692 
00693 protected:
00694     void registerMetaTypes();
00695     virtual void setAttr(QicsCellStyle::QicsCellStyleProperty attr, const void *val);
00696     virtual void setGridAttr(QicsGridStyle::QicsGridStyleProperty attr,
00697                  const void *val);
00698     virtual void clearGridAttr(QicsGridStyle::QicsGridStyleProperty attr);
00699 
00700     const QicsGridInfo &gridInfo(void) const { return myMainGridInfo; }
00701     const QicsGridInfo &rhGridInfo(void) const { return myRowHeaderGridInfo; }
00702     const QicsGridInfo &chGridInfo(void) const { return myColumnHeaderGridInfo; }
00703 
00704     QicsGridInfo &gridInfo(void)  { return myMainGridInfo; }
00705     QicsGridInfo &rhGridInfo(void)  { return myRowHeaderGridInfo; }
00706     QicsGridInfo &chGridInfo(void)  { return myColumnHeaderGridInfo; }
00707 
00712     QicsGridInfo myMainGridInfo;
00717     QicsGridInfo myRowHeaderGridInfo;
00722     QicsGridInfo myColumnHeaderGridInfo;
00723 
00728     QicsDataModel *myRHDataModel;
00729 
00734     QicsDataModel *myCHDataModel;
00735 
00736     QicsCell *myCell;
00737     QicsRow *myRow;
00738     QicsColumn *myColumn;
00739     QicsRepeatingRow *myRepeatingRow;
00740     QicsRepeatingColumn *myRepeatingColumn;
00741     QicsMainGrid *myMainGrid;
00742     QicsRowHeader *myRowHeader;
00743     QicsColumnHeader *myColumnHeader;
00744 
00749     QicsTableDisplayOption myTopHeaderVisible;
00754     QicsTableDisplayOption myBottomHeaderVisible;
00759     QicsTableDisplayOption myLeftHeaderVisible;
00764     QicsTableDisplayOption myRightHeaderVisible;
00765 
00770     int myTableMargin;
00775     int myTableSpacing;
00780     int myGridSpacing;
00781 
00786     bool myRowHeaderUsesModel;
00791     bool myColumnHeaderUsesModel;
00792 };
00793 
00794 #endif /* _QICSTABLECOMMON_H */

All trademarks and copyrights on this page are properties of their respective owners.
The rest is copyright 1999-2006 Integrated Computer Solutions, Inc.