ICS

QicsTable Documentation Set

QicsCheckCellDisplay.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 _QICSCHECKCELLDISPLAY_H
00011 #define _QICSCHECKCELLDISPLAY_H
00012 
00013 #include <QicsCellDisplay.h>
00014 
00015 #include <QPixmap>
00016 #include <QCheckBox>
00017 #include <QFocusEvent>
00018 #include <QKeyEvent>
00019 #include <QMouseEvent>
00020 
00056 
00057 
00060 
00061 
00062 class QICS_EXPORT QicsCheckCellDisplay: public QCheckBox,
00063                     public QicsMovableEntryWidgetCellDisplay
00064 {
00065 Q_OBJECT
00066 
00067 public:
00068 
00072     QicsCheckCellDisplay( QWidget * parent = 0);
00073 
00077     QicsCheckCellDisplay( const QString & text, QWidget * = 0 );
00078 
00079     virtual ~QicsCheckCellDisplay();
00080     virtual void displayCell(QicsGrid *grid, int row, int col,
00081                  const QicsDataItem *itm, QRect &rect,
00082                  QPainter *painter);
00083     virtual void startEdit(QicsScreenGrid *, int row, int col,
00084                const QicsDataItem *itm);
00085     virtual void moveEdit(QicsScreenGrid *grid, int row, int col,
00086               const QRect &rect);
00087     inline virtual bool isEmpty(QicsGridInfo *, int, int,
00088                 const QicsDataItem *) const
00089     { return false; }
00090 
00091 #if !defined(__GNUC__) || (__GNUC__ >= 3)
00092     using QCheckBox::sizeHint;
00093 #endif
00094     virtual QSize sizeHint(QicsGrid *grid, int row, int col,
00095                const QicsDataItem *itm);
00096 
00097     bool handleMouseEvent(QicsScreenGrid *grid, int row, int col, QMouseEvent *me);
00098     
00099     static const QString CheckCellDisplayName;
00100     virtual QString cellDisplayName() const;
00101 
00102     virtual QDomElement toDomXml(QString tag, QDomDocument* doc);
00103     virtual void configureFromDomXml(const QDomElement& e);
00104 
00105 protected:
00106     virtual QWidget *newEntryWidget(QicsScreenGrid *grid);
00107     
00108     virtual void focusOutEvent(QFocusEvent* fe);
00109 
00110     virtual QRect entryWidgetRect(QicsGridInfo *ginfo, int row, int col,
00111                   QRect cell_rect);
00112 
00113     bool handleKeyEvent(QicsScreenGrid *, int, int, QKeyEvent *);
00114 
00140     virtual bool checkState(QicsGridInfo *info, int row, int col,
00141                 int model_row, int model_col,
00142                 const QicsDataItem *itm);
00143 
00162     virtual QString textToDisplay(QicsGridInfo *info, int row, int col,
00163                   int model_row, int model_col,
00164                   const QicsDataItem *itm);
00165 
00184     virtual QPixmap pixmapToDisplay(QicsGridInfo *info, int row, int col,
00185                     int model_row, int model_col,
00186                     const QicsDataItem *itm);
00187 
00210     virtual void valueChanged(QicsGridInfo *info, int row, int col,
00211                   int model_row, int model_col, bool set);
00212     
00213     virtual QWidget* widget(){return static_cast<QCheckBox*>(this);}
00214 
00215 protected slots:
00216 
00221     void checkStateChanged(int state);
00222 
00223 private:
00229     bool myRedirectEvent;
00230 };
00231 
00232 class QICS_EXPORT QicsCheckCellDisplayConfigurationWidget : public QicsCellDisplayConfigurationWidget
00233 {
00234     public:
00235     QicsCheckCellDisplayConfigurationWidget(QWidget* parent=0);
00236 
00237     virtual void readConfiguration(QicsCellDisplay* cellDisplay);
00238     virtual void writeConfiguration(QicsCellDisplay* cellDisplay);
00239 };
00240 
00241 class QICS_EXPORT QicsCheckCellDisplayFactory: public QicsCellDisplayFactory 
00242 {
00243     public:
00244     virtual QicsCellDisplay* createCellDisplay();
00245     virtual QicsCellDisplayConfigurationWidget* configurationWidget();
00246 };
00247 
00248 
00249 #endif /* _QICSCHECKCELLDISPLAY_H */

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