2
Gwenview - A simple image viewer for KDE
3
Copyright (C) 2000-2002 Aur�lien G�teau
5
This program is free software; you can redistribute it and/or
6
modify it under the terms of the GNU General Public License
7
as published by the Free Software Foundation; either version 2
8
of the License, or (at your option) any later version.
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
15
You should have received a copy of the GNU General Public License
16
along with this program; if not, write to the Free Software
17
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
#ifndef SCROLLPIXMAPVIEW_H
23
#define SCROLLPIXMAPVIEW_H
27
#include <qscrollview.h>
41
class ScrollPixmapView : public QScrollView {
44
ScrollPixmapView(QWidget* parent,GVPixmap*,bool);
45
void enableView(bool);
46
void plugActionsToAccel(KAccel*);
47
void readConfig(KConfig* config, const QString& group);
48
void writeConfig(KConfig* config, const QString& group) const;
49
void installRBPopup(QPopupMenu*);
52
double zoom() const { return mZoom; }
53
void setZoom(double zoom);
54
double zoomStep() const { return mZoomStep; }
55
void setZoomStep(double zoom);
57
KToggleAction* autoZoom() const { return mAutoZoom; }
58
KAction* zoomIn() const { return mZoomIn; }
59
KAction* zoomOut() const { return mZoomOut; }
60
KAction* resetZoom() const { return mResetZoom; }
72
void selectPrevious();
74
void zoomChanged(double);
79
QPopupMenu* mPopupMenu;
81
// Offset to center images
82
int mXOffset,mYOffset;
86
double mOldZoom; // Zoom value before switch to auto zoom
90
bool mDragStarted; // Indicates that the user is scrolling the image by dragging it
91
int mScrollStartX,mScrollStartY;
94
KToggleAction* mAutoZoom;
99
void updateZoomActions();
100
void updateImageOffset();
101
void updateContentSize();
102
double computeAutoZoomValue() const;
105
// Overloaded methods
106
void viewportMousePressEvent(QMouseEvent*);
107
void viewportMouseMoveEvent(QMouseEvent*);
108
void wheelEvent(QWheelEvent*);
109
void viewportMouseReleaseEvent(QMouseEvent*);
110
void resizeEvent(QResizeEvent* event);
111
void drawContents(QPainter* p,int clipx,int clipy,int clipw,int cliph);