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 <QicsGridInfo.h>
00014 #include <QicsCellStyle.h>
00015 #include <QicsCellDisplay.h>
00016 #include <QicsDataItemFormatter.h>
00017 
00018 #include <qobject.h>
00019 #include <qfont.h>
00020 #include <qvalidator.h>
00021 
00023 
00024 
00037 class QICS_EXPORT QicsCellCommon: public QObject, public Qics {
00038 Q_OBJECT
00039 public:
00040 
00051     QString label;
00058     bool enabled;
00064     bool readOnly;
00070     bool selected;
00077     QFont font;
00084     QPalette palette;
00107     QColor foregroundColor;
00129     QColor backgroundColor;
00152     QColor selectedForegroundColor;
00174     QColor selectedBackgroundColor;
00185     QPixmap pixmap;
00192     int pixmapSpacing;
00200     QCursor cursor;
00208     int alignment;
00216     int textFlags;
00222     int maxLength;
00232     int margin;
00238     int borderWidth;
00245     QicsLineStyle borderStyle;
00246     // REMOVE THIS if building with Qt 3.0.x 
00252     QPen borderPen;
00253     // END REMOVE THIS if building with Qt 3.0.x 
00261     QString toolTipText;
00262 
00270     QColor editForegroundColor;
00278     QColor editBackgroundColor;
00279     
00280     bool canAcceptDrops;
00281 
00282 
00284 
00285 public:
00286 
00291     QicsCellCommon(QObject *parent = 0);
00292 
00298     QicsCellCommon(QicsGridInfo *info, QObject *parent = 0);
00299 
00303     inline virtual void setInfo(QicsGridInfo *info) { myInfo = info; }
00304 
00305 
00309     inline QicsDataModel *dataModel(void) const
00310     { return (myInfo?myInfo->dataModel():0); }
00311 
00317     int margin(void) const;
00318 
00324     bool readOnly(void) const;
00325     
00331     QFont font(void) const;
00332 
00338     QPalette palette(void) const;
00339 
00346     QColor foregroundColor(void) const;
00347 
00354     QColor backgroundColor(void) const;
00355 
00362     QColor selectedForegroundColor(void) const;
00363 
00370     QColor selectedBackgroundColor(void) const;
00371 
00378     QColor editForegroundColor(void) const;
00379 
00386     QColor editBackgroundColor(void) const;
00387 
00393     QPixmap pixmap(void) const;
00394 
00400     int pixmapSpacing(void) const;
00401 
00408     QicsCellDisplay *displayer(void) const;
00409 
00417     QicsDataItemFormatter *formatter(void) const;
00418 
00425     int alignment(void) const;
00426 
00432     bool enabled(void) const;
00433 
00438     bool selected(void) const;
00439 
00446     int textFlags(void) const;
00447 
00453     QValidator *validator(void) const;
00454 
00461     QString label(void) const;
00462 
00468     int maxLength(void) const;
00469 
00476     const QCursor &cursor(void) const;
00477 
00483     int borderWidth(void) const;
00484 
00490     QicsLineStyle borderStyle(void) const;
00491 
00497     QPen borderPen(void) const;
00498 
00502     void *userData(void) const;
00503 
00510     QString toolTipText(void) const;
00511     
00512     bool canAcceptDrops(void) const;
00513     
00514     void setCanAcceptDrops(const bool);
00515     
00516 public slots:
00522     void setMargin(int margin);
00523 
00529     void setReadOnly(bool b);
00530     
00536     void setFont(const QFont &font);
00537 
00543     void setPalette(const QPalette &pal);
00544 
00551     void setForegroundColor(const QColor &p);
00552 
00559     void setBackgroundColor(const QColor &p);
00560 
00567     void setSelectedForegroundColor(const QColor &p);
00568 
00575     void setSelectedBackgroundColor(const QColor &p);
00576 
00583     void setEditForegroundColor(const QColor &p);
00584 
00591     void setEditBackgroundColor(const QColor &p);
00592 
00598     void setPixmap(const QPixmap &p);
00599 
00605     void setPixmapSpacing(int sp);
00606 
00614     void setDisplayer(QicsCellDisplay *d);
00615 
00623     void setFormatter(QicsDataItemFormatter *d);
00624 
00631     void setAlignment(int flags);
00632 
00638     void setEnabled(bool b);
00639 
00646     void setTextFlags(int flags);
00647 
00653     void setValidator(QValidator *v);
00654 
00661     void setLabel(const QString &label);
00662 
00668     void setMaxLength(int len);
00669 
00676     void setCursor(const QCursor &c);
00683     void unsetCursor(void);
00684 
00690     void setBorderWidth(int bw);
00691 
00697     void setBorderStyle(QicsLineStyle bs);
00698 
00704     void setBorderPen(const QPen &pen);
00705 
00710     void setUserData(void *data);
00711 
00718     void setToolTipText(const QString &txt);
00719 
00720 protected:
00725     virtual void setAttr(QicsCellStyle::QicsCellStyleProperty attr,
00726              const void *val) = 0;
00731     virtual void *getAttr(QicsCellStyle::QicsCellStyleProperty attr) const = 0;
00736     virtual void clearAttr(QicsCellStyle::QicsCellStyleProperty attr) = 0;
00737 
00742     virtual void setDMMargin(int margin) = 0;
00747     virtual void setDMFont(const QFont &font) = 0;
00752     virtual void setDMBorderWidth(int bw) = 0;
00753 
00757     inline QicsStyleManager &styleManager(void) const
00758     { return (*(myInfo->styleManager())); }
00759 
00763     inline QicsDimensionManager &dimensionManager(void) const
00764     { return (*(myInfo->dimensionManager())); }
00765 
00769     QicsGridInfo *myInfo;
00770 
00772     bool myFollowModel;
00773 
00774 private:
00775 #ifdef Q_DISABLE_COPY
00776     QicsCellCommon(const QicsCellCommon &cc);
00777     QicsCellCommon &operator=(const QicsCellCommon &cc);
00778 #endif
00779 };
00780 
00781 #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.