1
/* This file is part of the KDE project
2
Copyright (C) 2001, 2002, 2003 The Karbon Developers
4
This library is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Library General Public
6
License as published by the Free Software Foundation; either
7
version 2 of the License, or (at your option) any later version.
9
This library is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
Library General Public License for more details.
14
You should have received a copy of the GNU Library General Public License
15
along with this library; see the file COPYING.LIB. If not, write to
16
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17
Boston, MA 02111-1307, USA.
24
#include <qscrollview.h>
32
// The canvas is a QScrollView.
34
class VCanvas : public QScrollView
38
VCanvas( QWidget *parent, KarbonViewBase* view, KarbonPartBase* part );
41
void repaintAll( const KoRect & );
42
void repaintAll( bool drawVObjects = true );
44
QPixmap *pixmap() { return m_pixmap; }
47
* Sets mouse position to point p.
49
void setPos( const KoPoint& p );
51
KoPoint toViewport( const KoPoint & ) const;
52
KoPoint toContents( const KoPoint & ) const;
53
KoRect boundingBox() const;
56
* Adjusts the viewport top-left position. This doesn't change the zoom level.
57
* Note that centerX and centerY is a value between 0.0 and 1.0, indicating a
58
* percentage of the total width/height. Thus centerX/centerY indicates the
59
* center of the viewport.
61
void setViewport( double centerX, double centerY );
64
* Sets the canvas viewport rectangle to rect. The zoom level is adjusted for this, if
67
void setViewportRect( const KoRect &rect );
69
int pageOffsetX() const;
70
int pageOffsetY() const;
73
virtual void dragEnterEvent( QDragEnterEvent * );
74
virtual void dropEvent( QDropEvent * );
75
virtual void focusInEvent( QFocusEvent * );
76
virtual void viewportPaintEvent( QPaintEvent* );
77
virtual void drawContents( QPainter* painter, int clipx, int clipy,
78
int clipw, int cliph );
79
void drawDocument( QPainter* painter, const KoRect& rect, bool drawVObjects = true );
81
virtual void resizeEvent( QResizeEvent* event );
83
virtual bool eventFilter( QObject* object, QEvent* event );
85
void setYMirroring( VPainter * );
88
void slotContentsMoving( int , int );
91
void viewportChanged();
95
KarbonPartBase* m_part;
96
KarbonViewBase* m_view;