1 #ifndef QG_GRAPHICVIEW_H
2 #define QG_GRAPHICVIEW_H
5 #include "graphicview.h"
6 #include "rs_layerlistlistener.h"
7 #include "rs_blocklistlistener.h"
8 #include "qg_scrollbar.h"
15 * This is the Qt implementation of a widget which can view a
18 * Instances of this class can be linked to layer lists using
19 * addLayerListListener().
21 class QG_GraphicView: public QWidget, public GraphicView//, //public Q3FilePreview,
22 // public RS_LayerListListener, public RS_BlockListListener
27 QG_GraphicView(QWidget * parent = 0, const char * name = 0, Qt::WindowFlags f = 0);
28 QG_GraphicView(RS_Document * doc, QWidget * parent = 0);
29 virtual ~QG_GraphicView();
31 virtual int getWidth();
32 virtual int getHeight();
33 virtual void redraw();
34 virtual void adjustOffsetControls();
35 virtual void adjustZoomControls();
36 virtual void setBackground(const RS_Color & bg);
37 virtual void setMouseCursor(RS2::CursorType c);
38 virtual void updateGridStatusWidget(const QString & text);
40 // This is just crap. Why have a klunky listener interface when we have slots/signals???
41 // That's what I thought!!!
42 // Methods from RS_LayerListListener Interface:
43 // virtual void layerEdited(RS_Layer *);
44 // virtual void layerRemoved(RS_Layer *);
45 // virtual void layerToggled(RS_Layer *);
48 virtual void emulateMouseMoveEvent();
49 virtual void mousePressEvent(QMouseEvent * e);
50 virtual void mouseReleaseEvent(QMouseEvent * e);
51 virtual void mouseMoveEvent(QMouseEvent * e);
52 virtual void tabletEvent(QTabletEvent * e);
53 virtual void leaveEvent(QEvent *);
54 virtual void enterEvent(QEvent *);
55 virtual void focusInEvent(QFocusEvent *);
56 virtual void focusOutEvent(QFocusEvent *);
57 virtual void wheelEvent(QWheelEvent * e);
58 virtual void keyPressEvent(QKeyEvent * e);
59 virtual void keyReleaseEvent(QKeyEvent * e);
61 void paintEvent(QPaintEvent *);
62 virtual void resizeEvent(QResizeEvent * e);
64 #warning "!!! File preview needs porting to Qt4 !!!"
65 // void previewUrl(const Q3Url &u);
68 void CommonInitialization(void);
71 void slotHScrolled(int value);
72 void slotVScrolled(int value);
75 #warning "!!! Double buffering is not necessary anymore !!!"
76 //! Buffer for double-buffering
83 //! Horizontal scrollbar.
84 // QG_ScrollBar * hScrollBar;
85 QScrollBar * hScrollBar;
86 //! Vertical scrollbar.
87 // QG_ScrollBar * vScrollBar;
88 QScrollBar * vScrollBar;
89 //! Layout used to fit in the view and the scrollbars.
91 //! Label for grid spacing.
95 //! Delete mouse cursor
97 //! Select mouse cursor
99 //! Magnifying glass mouse cursor
100 QCursor * curMagnifier;
101 //! Hand mouse cursor