ICS

QicsTable Documentation Set

QicsCellCommon.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 _QICSCELLCOMMON_H
00011 #define _QICSCELLCOMMON_H
00012 
00013 #include <QObject>
00014 #include <QPointer>
00015 #include <QPen>
00016 #include <QFont>
00017 #include <QPalette>
00018 #include <QCursor>
00019 #include <QPixmap>
00020 
00021 #include <QicsGridInfo.h>
00022 #include <QicsCellStyle.h>
00023 
00024 class QValidator;
00025 class QicsPasteValidator;
00026 class QicsDataItemFormatter;
00027 class QicsCellDisplay;
00028 class QicsGridInfo;
00029 
00031 
00032 
00045 
00046 
00049 
00050 
00051 class QICS_EXPORT QicsCellCommon: public QObject, public Qics 
00052 {
00053 Q_OBJECT
00054 
00055 public:
00056 
00063     QString label;
00070     bool enabled;
00076     bool readOnly;
00082     bool selected;
00089     QFont font;
00096     QPalette palette;
00119     QColor foregroundColor;
00141     QColor backgroundColor;
00164     QColor selectedForegroundColor;
00186     QColor selectedBackgroundColor;
00197     QPixmap pixmap;
00204     int pixmapSpacing;
00212     QCursor cursor;
00220     int alignment;
00228     int textFlags;
00234     int maxLength;
00244     int margin;
00250     int borderWidth;
00256     QPen topBorderPen;
00262     QPen leftBorderPen;
00268     QPen rightBorderPen;
00274     QPen bottomBorderPen;
00275     // END REMOVE THIS if building with Qt 3.0.x 
00283     QString toolTipText;
00284 
00292     QColor editForegroundColor;
00300     QColor editBackgroundColor;
00306     bool autoRecognition;
00307             
00313     Q_PROPERTY(QicsPasteValidator* pasteValidator READ pasteValidator WRITE
00314         setPasteValidator)
00319     Q_PROPERTY(QValidator* validator READ validator WRITE
00320         setValidator)
00325      bool canAcceptDrops;
00327 
00328 public:
00329 
00334     QicsCellCommon(QObject *parent = 0);
00335 
00341     bool autoRecognition( void );
00342 
00348     QicsCellCommon(QicsGridInfo *info, QObject *parent = 0);
00349 
00353     inline virtual void setInfo(QicsGridInfo *info) { myInfo = info; }
00354 
00355 
00359     inline QicsDataModel *dataModel(void) const
00360     { return (myInfo?myInfo->dataModel():0); }
00361 
00367     int margin(void) const;
00368 
00374     bool readOnly(void) const;
00375     
00381     QFont font(void) const;
00382 
00388     QFont selectedFont(void) const;
00389 
00395     QPalette palette(void) const;
00396 
00403     QColor foregroundColor(void) const;
00404 
00411     QColor backgroundColor(void) const;
00412 
00419     QColor selectedForegroundColor(void) const;
00420 
00427     QColor selectedBackgroundColor(void) const;
00428 
00435     QColor editForegroundColor(void) const;
00436 
00443     QColor editBackgroundColor(void) const;
00444 
00452     QColor highlightForegroundColor(void) const;
00453 
00461     QColor highlightBackgroundColor(void) const;
00462 
00468     QPixmap pixmap(void) const;
00469 
00475     int pixmapSpacing(void) const;
00476 
00483     QicsCellDisplay *displayer(void) const;
00484 
00492     QicsDataItemFormatter *formatter(void) const;
00493 
00500     int alignment(void) const;
00501 
00507     bool enabled(void) const;
00508 
00513     virtual bool selected(void) const;
00514 
00521     int textFlags(void) const;
00522 
00530     QValidator *validator(void) const;
00531     
00538     QicsPasteValidator *pasteValidator(void) const;
00539 
00546     QString label(void) const;
00547 
00553     int maxLength(void) const;
00554 
00561     const QCursor &cursor(void) const;
00562 
00568     int borderWidth(void) const;
00569 
00575     QPen topBorderPen(void) const;
00576 
00582     QPen leftBorderPen(void) const;
00583 
00589     QPen rightBorderPen(void) const;
00590 
00596     QPen bottomBorderPen(void) const;
00597 
00601     void *userData(void) const;
00602 
00609     QString toolTipText(void) const;
00610 
00611 public slots:
00617     void setMargin(int margin);
00618 
00624     void setReadOnly(bool b);
00625     
00631     void setFont(const QFont &font);
00632 
00638     void setSelectedFont(const QFont &font);
00639 
00645     void setPalette(const QPalette &pal);
00646 
00653     void setForegroundColor(const QColor &p);
00654 
00661     void setBackgroundColor(const QColor &p);
00662 
00669     void setSelectedForegroundColor(const QColor &p);
00670 
00677     void setSelectedBackgroundColor(const QColor &p);
00678 
00685     void setEditForegroundColor(const QColor &p);
00686 
00693     void setEditBackgroundColor(const QColor &p);
00694 
00702     void setHighlightForegroundColor(const QColor &p);
00703 
00711     void setHighlightBackgroundColor(const QColor &p);
00712 
00718     void setPixmap(const QPixmap &p);
00719     
00725     void setPixmap(const QString &file_name);
00726 
00732     void setPixmapSpacing(int sp);
00733 
00741     void setDisplayer(QicsCellDisplay *d);
00742 
00750     void setFormatter(QicsDataItemFormatter *d);
00751 
00758     void setAlignment(int flags);
00759 
00765     void setEnabled(bool b);
00766 
00773     void setTextFlags(int flags);
00774 
00782     void setValidator(QValidator *v);
00783     
00791     void setPasteValidator(QicsPasteValidator *v);
00792 
00799     void setLabel(const QString &label);
00800 
00806     void setMaxLength(int len);
00807 
00814     void setCursor(const QCursor &c);
00821     void unsetCursor(void);
00822 
00828     void setBorderWidth(int bw);
00829 
00835     void setTopBorderPen(const QPen &pen);
00836 
00842     void setLeftBorderPen(const QPen &pen);
00843 
00849     void setRightBorderPen(const QPen &pen);
00850 
00856     void setBottomBorderPen(const QPen &pen);
00857 
00862     void setUserData(void *data);
00863 
00870     void setToolTipText(const QString &txt);
00876     void setAutoRecognition(const bool flag);
00877     
00883     bool canAcceptDrops(void) const;
00884     
00892     void setCanAcceptDrops(const bool); 
00893     
00894     QicsGridInfo& gridInfo(){return *myInfo;}
00895 
00896 protected:
00901     virtual void setAttr(QicsCellStyle::QicsCellStyleProperty attr,
00902              const void *val) = 0;
00907     virtual void *getAttr(QicsCellStyle::QicsCellStyleProperty attr) const = 0;
00912     virtual void clearAttr(QicsCellStyle::QicsCellStyleProperty attr) = 0;
00913 
00918     virtual void setDMMargin(int margin) = 0;
00923     virtual void setDMFont(const QFont &font) = 0;
00928     virtual void setDMBorderWidth(int bw) = 0;
00934     virtual void setDMFitSize(int /*w*/, int /*h*/) {};
00935 
00939     inline QicsStyleManager &styleManager(void) const
00940     { return (*(myInfo->styleManager())); }
00941 
00945     inline QicsDimensionManager &dimensionManager(void) const
00946     { return (*(myInfo->dimensionManager())); }
00947 
00951     QPointer<QicsGridInfo> myInfo;
00952 
00954     bool myFollowModel;
00955     
00956 
00957 private:
00958 #ifdef Q_DISABLE_COPY
00959     QicsCellCommon(const QicsCellCommon &cc);
00960     QicsCellCommon &operator=(const QicsCellCommon &cc);
00961 #endif
00962     friend class QicsHTMLExport;
00963 };
00964 
00965 #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.