ICS

QicsTable Documentation Set

QicsHeaderGrid.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 _QICSHEADERGRID_H
00011 #define _QICSHEADERGRID_H
00012 
00013 #include <QicsScreenGrid.h>
00014 #include <QicsDataItem.h>
00015 #include <QicsICell.h>
00016 
00017 #include <QDragMoveEvent>
00018 #include <QKeyEvent>
00019 #include <QDropEvent>
00020 #include <QMouseEvent>
00021 
00022 
00039 
00040 
00043 
00044 class QICS_EXPORT QicsHeaderGrid: public QicsScreenGrid {
00045     Q_OBJECT
00046 
00047 public:
00056     QicsHeaderGrid(QWidget *w, QicsGridInfo &info, 
00057            QicsHeaderType type);
00058  
00062     virtual ~QicsHeaderGrid();
00063 
00067     inline QicsHeaderType type(void) const { return myType; }
00068 
00069     virtual QicsRegion currentViewport(void) const;
00070 
00075     inline int gripThreshold(void) const { return myGripThreshold; }
00080     inline void setGripThreshold(int gt) { myGripThreshold = gt; }
00081     
00087     inline void setIsFrozenHeader(bool flag){myIsFrozenHeader = flag;}
00088 
00096     typedef QicsHeaderGrid *(*Foundry)(QWidget *w, QicsGridInfo &info,
00097                        QicsHeaderType type);
00098 
00107     typedef QicsHeaderGrid *(*FoundryWithKey)(QWidget *w, QicsGridInfo &info,
00108                           QicsHeaderType type,
00109                           void *key);
00110 
00117     static QicsHeaderGrid *createGrid(QWidget *w, QicsGridInfo &info,
00118                       QicsHeaderType type);
00119 
00120 signals:
00128     void sizeChange(int idx, int old_size, int new_size, QicsHeaderType type);
00129 
00138     void resizeInProgress(int idx, int position, QicsHeaderType type);
00139 
00147     void gripDoubleClicked(int idx, int button, QicsHeaderType type);
00148 
00155     void headerResized(int size,QicsHeaderType type);
00156 
00160     void wideKeyPressed(int key);
00161 
00162 public slots:
00163     virtual void handleGridPropertyChange(QicsGridStyle::QicsGridStyleProperty prop);
00164 
00165 protected:
00166     virtual QSize sizeHint(void) const;
00167 
00168     virtual void handleMousePressEvent(const QicsICell &cell, QMouseEvent *m);
00169     virtual void handleMouseReleaseEvent(const QicsICell &cell, QMouseEvent *m);
00170     virtual void handleMouseMoveEvent(const QicsICell &cell, QMouseEvent *m);
00171     virtual void handleMouseDoubleClickEvent(const QicsICell &, QMouseEvent *m);
00172     virtual void emitMouseSignals(const QicsICell&,QMouseEvent*);
00173 
00174 
00175     virtual void keyPressEvent (QKeyEvent *ke);
00176 
00177     void dragMoveEvent(QDragMoveEvent *event);
00178     
00179     void dropEvent(QDropEvent *event);
00180     
00181     void dragEnterEvent(QDragEnterEvent *event);
00182 
00197     virtual bool canDropAt(QDragMoveEvent *event, const QicsICell &cell) const;
00198 
00199     virtual void dropAt(QDropEvent *event, const QicsICell &cell);
00200 
00205     bool isWithinResizeThreshold(int x, int y, int *in_cell, int *close_cell) const;
00206 
00211     bool setResizeCursor( QMouseEvent *m );
00212 
00216     void handleCellResize( QMouseEvent *m );
00220     void finishResize(void);
00221 
00222     virtual void selectCell(int row, int col);
00223 
00227     void beginSelection(int row, int col);
00231     void endSelection(int row, int col);
00235     void extendSelection(int row, int col);
00239     void addSelection(int row, int col);
00243     void clearSelection(void);
00247     void dragSelection( QMouseEvent *m );
00251     void reportSelection(int row, int col, QicsSelectionType stype);
00252 
00253     void startDrag(Qt::DropAction mode);
00254 
00255     void reset();
00256 
00261     QicsHeaderType myType;
00262 
00267     int myGripThreshold;
00268 
00273     bool myMouseInGrip;
00274 
00279     bool myDoingResize;
00280 
00285     bool myDoingSelectionFlag;
00286 
00292     int myExpandingCell;
00293 
00299     int myExpandingCellSize;
00300 
00306     int myExpandingCellStartPosition;
00307 
00313     int myExpandingCellCurrentPosition;
00314 
00319     int myAnchorIndex;
00320 
00325     int mySelectionIndex;
00326 
00333     bool myIsFrozenHeader;
00339     bool myIsHeaderBeganResize;
00340 
00345     int myStartResizingPos;
00346     
00351     bool myHaveIdropAfter;
00352     
00357     QicsICell myTraversalCell;
00358 };
00359 
00360 
00361 #endif /* _QICSHEADERGRID_H */

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