ICS

QicsTable Documentation Set

QicsStyleManager.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 _QICSSTYLEMANAGER_H
00011 #define _QICSSTYLEMANAGER_H
00012 
00013 #include <QObject>
00014 
00015 #include <QicsNamespace.h>
00016 #include <QicsCellStyle.h>
00017 #include <QicsRepeatingCellStyle.h>
00018 #include <QicsGridStyle.h>
00019 #include <QicsRegion.h>
00020 #include <QicsSpan.h>
00021 
00022 //#include <QicsTable.h>
00023 class QicsTable;
00024 #include <QDomElement>
00025 
00026 
00027 class QString;
00028 class QicsSpanManager;
00029 class QicsGridInfo;
00030 
00053 
00054 
00057 
00058 class QicsStyleManager : public QObject, public Qics
00059 {
00060     Q_OBJECT
00061 public:
00067     QicsStyleManager(QicsGridType type, QicsGridInfo *grid_info,
00068              QWidget *template_widget);
00069 
00078     QicsStyleManager(QicsStyleManager *base_sm, QicsGridInfo *grid_info);
00079 
00083     ~QicsStyleManager();
00084 
00085     inline QicsGridType type(void) const
00086     { return myType; }
00087 
00110     void *getCellProperty(int row, int col,
00111               QicsCellStyle::QicsCellStyleProperty name,
00112               int visual_row = -1, int visual_col = -1) const;
00113 
00129     void *getRowProperty(int row,
00130              QicsCellStyle::QicsCellStyleProperty name,
00131              int visual_row = -1) const;
00132 
00148     void *getColumnProperty(int col,
00149                 QicsCellStyle::QicsCellStyleProperty name,
00150                 int visual_col = -1) const;
00151 
00159     void *getRepeatingRowProperty(int row, unsigned int interval,
00160                   QicsCellStyle::QicsCellStyleProperty name) const;
00161 
00169     void *getRepeatingColumnProperty(int col, unsigned int interval,
00170                      QicsCellStyle::QicsCellStyleProperty name) const;
00171 
00176     void *getDefaultProperty(QicsCellStyle::QicsCellStyleProperty name) const;
00177 
00187     void setCellProperty(int row, int col,  bool visual_coords,
00188              QicsCellStyle::QicsCellStyleProperty name,
00189              const void *val);
00190 
00202     void setRowProperty(int row,  bool visual_coords,
00203             QicsCellStyle::QicsCellStyleProperty name,
00204             const void *val,
00205             bool override = true);
00206 
00218     void setColumnProperty(int col,  bool visual_coords,
00219                QicsCellStyle::QicsCellStyleProperty name,
00220                const void *val,
00221                bool override = true);
00222 
00228     void setRepeatingRowProperty(int row, unsigned int interval,
00229                  QicsCellStyle::QicsCellStyleProperty name,
00230                  const void *val);
00231 
00237     void setRepeatingColumnProperty(int col, unsigned int interval,
00238                     QicsCellStyle::QicsCellStyleProperty name,
00239                     const void *val);
00240 
00246     void setDefaultProperty(QicsCellStyle::QicsCellStyleProperty name,
00247                 const void *val);
00248 
00252     void clearRowProperty(int row, bool visual_coords,
00253               QicsCellStyle::QicsCellStyleProperty name);
00254 
00258     void clearColumnProperty(int col, bool visual_coords,
00259                  QicsCellStyle::QicsCellStyleProperty name);
00260 
00266     void clearRepeatingRowProperty(int row, unsigned int interval,
00267                    QicsCellStyle::QicsCellStyleProperty name);
00268 
00274     void clearRepeatingColumnProperty(int col, unsigned int interval,
00275                       QicsCellStyle::QicsCellStyleProperty name);
00276 
00280     void clearCellProperty(int row, int col, bool visual_coords,
00281                QicsCellStyle::QicsCellStyleProperty name);
00282 
00286     void setGridProperty(QicsGridStyle::QicsGridStyleProperty name,
00287              const void *val);
00291     void *getGridProperty(QicsGridStyle::QicsGridStyleProperty name) const;
00292 
00297     inline void setReportChanges(bool report) { myReportChanges = report; }
00302     inline bool isReportingChanges(void) const
00303     { return myReportChanges; }
00304 
00308     inline QicsSpanManager *spanManager(void) const
00309     { return mySpanManager; }
00310 
00311 public slots:
00315     void insertRows(int num, int start_position);
00319     void insertColumns(int num, int start_position);
00323     void deleteRows(int num, int start_position);
00327     void deleteColumns(int num, int start_position);
00331     QDomElement toDomXml(const QString& tag, QDomDocument* doc);
00335     void configureFromDomXml(const QDomElement&, QicsTable * table);
00336 
00337 protected:
00338 
00339 
00340    void setCellFromDomXml(const QDomElement&, QicsTable* table, bool visual_coords);
00341 
00342    void setRowFromDomXml(const QDomElement&, QicsTable* table, bool visual_coords);
00343 
00344    void setColumnFromDomXml(const QDomElement&, QicsTable* table, bool visual_coords);
00345 
00346    void setRepeatingRowFromDomXml(const QDomElement&, QicsTable* table);
00347 
00348    void setRepeatingColumnFromDomXml(const QDomElement&, QicsTable* table);
00349 
00350    void setGridFromDomXml(const QDomElement&, QicsTable* table);
00351    
00352    void setDefaultsFromDomXml(const QDomElement&, QicsTable* table);
00353 
00354 signals:
00359     void cellPropertyChanged(QicsRegion reg,
00360                  QicsCellStyle::QicsCellStyleProperty prop,
00361                  bool visual_coords);
00366     void gridPropertyChanged(QicsGridStyle::QicsGridStyleProperty prop);
00367 
00371     void spanChanged(QicsSpan reg);
00372 
00373 protected:
00382     void *cellProp(int row, int col,
00383            QicsCellStyle::QicsCellStyleProperty prop,
00384            const QicsCellStylePVPV &styles) const;
00385 
00393     void *rowProp(int row, QicsCellStyle::QicsCellStyleProperty prop,
00394           const QicsCellStylePV &styles) const;
00395 
00403     void *columnProp(int col, QicsCellStyle::QicsCellStyleProperty prop,
00404              const QicsCellStylePV &styles) const;
00405 
00414     void *repeatingRowProp(int start_row, unsigned int interval,
00415                QicsCellStyle::QicsCellStyleProperty prop,
00416                const QicsRepeatingCellStylePV &styles) const;
00417 
00426     void *repeatingRowProp(int row, QicsCellStyle::QicsCellStyleProperty prop,
00427                const QicsRepeatingCellStylePV &styles) const;
00428 
00437     void *repeatingColumnProp(int col, unsigned int interval,
00438                   QicsCellStyle::QicsCellStyleProperty prop,
00439                   const QicsRepeatingCellStylePV &styles) const;
00440 
00449     void *repeatingColumnProp(int col, QicsCellStyle::QicsCellStyleProperty prop,
00450                const QicsRepeatingCellStylePV &styles) const;
00451 
00457     void *defaultProp(QicsCellStyle::QicsCellStyleProperty prop) const;
00458 
00464     void clearStyleGivenVectorOfRows(QicsCellStylePV & row_vec, int row,
00465                                      QicsCellStyle::QicsCellStyleProperty name,
00466                                      bool save_space);
00467 
00471     QicsGridInfo *gridInfo(void) const
00472     { return myGridInfo; }
00473 
00475     QicsGridType       myType;
00476 
00478     QicsCellStyle      *myDefaultStyle;
00479 
00481     QicsGridStyle      *myGridStyle;
00482 
00484     QicsCellStylePV    myVectorOfModelRowStyles;
00485 
00487     QicsCellStylePV    myVectorOfModelColumnStyles;
00488 
00490     QicsCellStylePV    myVectorOfVisualRowStyles;
00491 
00493     QicsCellStylePV    myVectorOfVisualColumnStyles;
00494 
00496     QicsCellStylePVPV myVectorOfModelColumns;
00497 
00499     QicsCellStylePVPV myVectorOfVisualColumns;
00500 
00502     bool myReportChanges;
00503 
00505     QicsSpanManager *mySpanManager;
00506 
00508     QicsStyleManager *myBaseSM;
00509 
00511     QicsRepeatingCellStylePV myVectorOfRepeatingRowStyles;
00512 
00514     QicsRepeatingCellStylePV myVectorOfRepeatingColumnStyles;
00515 
00517     QicsGridInfo *myGridInfo;
00518 
00519 private:
00520 
00521     /* \internal
00522      * Deletes the contents of a vector of allocated cell style vectors.
00523      */
00524     void deleteCellStyleVectors(QicsCellStylePVPV &vcols);
00525 
00526     /* \internal
00527      * Deletes the contents of a vector of allocated cell styles.
00528      */
00529     void deleteCellStyles(QicsCellStylePV &csv);
00530 
00531     /* \internal
00532      * Deletes the contents of a vector of allocated repeating cell styles.
00533      */
00534     void deleteRepeatingCellStyles(QicsRepeatingCellStylePV &csv);
00535 
00536     friend class QicsHTMLExport;
00537 };
00538 
00539 #endif /* _QICSSTYLEMANAGER_H */

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