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 // Methods from RS_LayerListListener Interface:
41 virtual void layerEdited(RS_Layer *);
42 virtual void layerRemoved(RS_Layer *);
43 virtual void layerToggled(RS_Layer *);
46 virtual void emulateMouseMoveEvent();
47 virtual void mousePressEvent(QMouseEvent * e);
48 virtual void mouseReleaseEvent(QMouseEvent * e);
49 virtual void mouseMoveEvent(QMouseEvent * e);
50 virtual void tabletEvent(QTabletEvent * e);
51 virtual void leaveEvent(QEvent *);
52 virtual void enterEvent(QEvent *);
53 virtual void focusInEvent(QFocusEvent *);
54 virtual void focusOutEvent(QFocusEvent *);
55 virtual void wheelEvent(QWheelEvent * e);
56 virtual void keyPressEvent(QKeyEvent * e);
57 virtual void keyReleaseEvent(QKeyEvent * e);
59 void paintEvent(QPaintEvent *);
60 virtual void resizeEvent(QResizeEvent * e);
62 #warning "!!! File preview needs porting to Qt4 !!!"
63 // void previewUrl(const Q3Url &u);
66 void CommonInitialization(void);
69 void slotHScrolled(int value);
70 void slotVScrolled(int value);
73 #warning "!!! Double buffering is not necessary anymore !!!"
74 //! Buffer for double-buffering
81 //! Horizontal scrollbar.
82 QG_ScrollBar * hScrollBar;
83 //! Vertical scrollbar.
84 QG_ScrollBar * vScrollBar;
85 //! Layout used to fit in the view and the scrollbars.
87 //! Label for grid spacing.
91 //! Delete mouse cursor
93 //! Select mouse cursor
95 //! Magnifying glass mouse cursor
96 QCursor * curMagnifier;