]> Shamusworld >> Repos - architektonas/blob - src/widgets/qg_graphicview.h
In the middle of chasing down MDI not activating bug, renaming of Graphic to
[architektonas] / src / widgets / qg_graphicview.h
1 #ifndef QG_GRAPHICVIEW_H
2 #define QG_GRAPHICVIEW_H
3
4 #include <QtGui>
5 #include "graphicview.h"
6
7 class Document;
8 class PaintInterface;
9 class Preview;
10
11 /**
12  * This is the Qt implementation of a widget which can view a drawing.
13  */
14 class QG_GraphicView: public QWidget, public GraphicView
15 {
16         Q_OBJECT
17
18         public:
19                 QG_GraphicView(QWidget * parent = 0, const char * name = 0, Qt::WindowFlags f = 0);
20                 QG_GraphicView(Document * doc, QWidget * parent = 0);
21                 virtual ~QG_GraphicView();
22
23                 virtual int getWidth();
24                 virtual int getHeight();
25                 virtual void redraw();
26                 virtual void adjustOffsetControls();
27                 virtual void adjustZoomControls();
28                 virtual void setBackground(const Color & bg);
29                 virtual void setMouseCursor(RS2::CursorType c);
30                 virtual void updateGridStatusWidget(const QString & text);
31
32 // This is just crap. Why have a klunky listener interface when we have slots/signals???
33 // That's what I thought!!!
34                 // Methods from LayerListListener Interface:
35 //              virtual void layerEdited(Layer *);
36 //              virtual void layerRemoved(Layer *);
37 //              virtual void layerToggled(Layer *);
38
39         protected:
40                 virtual void emulateMouseMoveEvent();
41                 virtual void mousePressEvent(QMouseEvent * e);
42                 virtual void mouseReleaseEvent(QMouseEvent * e);
43                 virtual void mouseMoveEvent(QMouseEvent * e);
44                 virtual void tabletEvent(QTabletEvent * e);
45                 virtual void leaveEvent(QEvent *);
46                 virtual void enterEvent(QEvent *);
47                 virtual void focusInEvent(QFocusEvent *);
48                 virtual void focusOutEvent(QFocusEvent *);
49                 virtual void wheelEvent(QWheelEvent * e);
50                 virtual void keyPressEvent(QKeyEvent * e);
51                 virtual void keyReleaseEvent(QKeyEvent * e);
52
53                 void paintEvent(QPaintEvent *);
54                 virtual void resizeEvent(QResizeEvent * e);
55
56 #warning "!!! File preview needs porting to Qt4 !!!"
57 //              void previewUrl(const Q3Url &u);
58
59         private:
60                 void CommonInitialization(void);
61
62         private slots:
63                 void slotHScrolled(int value);
64                 void slotVScrolled(int value);
65
66 //      private:
67 //#warning "!!! Double buffering is not necessary anymore !!!"
68 //              //! Buffer for double-buffering
69 //              QPixmap * buffer;
70 //              int refCount;
71
72 #if 0
73         protected:
74                 int lastWidth;
75                 int lastHeight;
76                 //! Horizontal scrollbar.
77                 QScrollBar * hScrollBar;
78                 //! Vertical scrollbar.
79                 QScrollBar * vScrollBar;
80                 //! Layout used to fit in the view and the scrollbars.
81                 QGridLayout * layout;
82                 //! Label for grid spacing.
83                 QLabel * gridStatus;
84                 //! CAD mouse cursor
85                 QCursor * curCad;
86                 //! Delete mouse cursor
87                 QCursor * curDel;
88                 //! Select mouse cursor
89                 QCursor * curSelect;
90                 //! Magnifying glass mouse cursor
91                 QCursor * curMagnifier;
92                 //! Hand mouse cursor
93                 QCursor * curHand;
94 #endif
95 };
96
97 #endif