karbon
vcanvas.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __VCANVAS_H__
00021 #define __VCANVAS_H__
00022
00023
00024 #include <qscrollview.h>
00025 #include <koffice_export.h>
00026 class KarbonPart;
00027 class KarbonView;
00028 class KoRect;
00029 class KoPoint;
00030 class VPainter;
00031
00032
00033
00034 class KARBONCOMMON_EXPORT VCanvas : public QScrollView
00035 {
00036 Q_OBJECT
00037 public:
00038 VCanvas( QWidget *parent, KarbonView* view, KarbonPart* part );
00039 virtual ~VCanvas();
00040
00041 void repaintAll( const KoRect & );
00042 void repaintAll( bool drawVObjects = true );
00043
00044 QPixmap *pixmap() { return m_pixmap; }
00045
00049 void setPos( const KoPoint& p );
00050
00051 KoPoint toViewport( const KoPoint & ) const;
00052 KoPoint toContents( const KoPoint & ) const;
00053 KoRect boundingBox() const;
00054
00061 void setViewport( double centerX, double centerY );
00062
00067 void setViewportRect( const KoRect &rect );
00068
00069 int pageOffsetX() const;
00070 int pageOffsetY() const;
00071
00072 KoPoint snapToGrid( const KoPoint & );
00073
00074 protected:
00075 virtual void dragEnterEvent( QDragEnterEvent * );
00076 virtual void dropEvent( QDropEvent * );
00077 virtual void focusInEvent( QFocusEvent * );
00078 virtual void viewportPaintEvent( QPaintEvent* );
00079 virtual void drawContents( QPainter* painter, int clipx, int clipy,
00080 int clipw, int cliph );
00081 void drawDocument( QPainter* painter, const KoRect& rect, bool drawVObjects = true );
00082
00083 virtual void resizeEvent( QResizeEvent* event );
00084
00085 virtual bool eventFilter( QObject* object, QEvent* event );
00086
00087 void setYMirroring( VPainter * );
00088
00089 private slots:
00090 void slotContentsMoving( int , int );
00091
00092 signals:
00093 void viewportChanged();
00094
00095 private:
00096 QPixmap *m_pixmap;
00097 KarbonPart* m_part;
00098 KarbonView* m_view;
00099 };
00100
00101 #endif
|