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