summaryrefslogtreecommitdiff
path: root/noncore/graphics/opie-eye/gui/imagescrollview.h
Unidiff
Diffstat (limited to 'noncore/graphics/opie-eye/gui/imagescrollview.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/imagescrollview.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/noncore/graphics/opie-eye/gui/imagescrollview.h b/noncore/graphics/opie-eye/gui/imagescrollview.h
index edea235..e25f955 100644
--- a/noncore/graphics/opie-eye/gui/imagescrollview.h
+++ b/noncore/graphics/opie-eye/gui/imagescrollview.h
@@ -12,23 +12,42 @@ class ImageScrollView:public QScrollView
12{ 12{
13 Q_OBJECT 13 Q_OBJECT
14public: 14public:
15 ImageScrollView (const QImage&, QWidget * parent=0, const char * name=0, WFlags f=0 ); 15 ImageScrollView (const QImage&, QWidget * parent=0, const char * name=0, WFlags f=0,bool always_scale=false,bool rfit=false );
16 ImageScrollView (const QString&, QWidget * parent=0, const char * name=0, WFlags f=0 ); 16 ImageScrollView (const QString&, QWidget * parent=0, const char * name=0, WFlags f=0,bool always_scale=false,bool rfit=false );
17 virtual ~ImageScrollView(); 17 virtual ~ImageScrollView();
18 18
19 void setImage(const QImage&); 19 void setImage(const QImage&);
20
21 enum Rotation {
22 Rotate0,
23 Rotate90,
24 Rotate180,
25 Rotate270
26 };
27
20protected: 28protected:
21 virtual void drawContents ( QPainter * p, int clipx, int clipy, int clipw, int cliph ); 29 virtual void drawContents ( QPainter * p, int clipx, int clipy, int clipw, int cliph );
22 void init(); 30 void init();
23 31
24 QImage _image_data; 32 QImage _image_data;
33 QImage _original_data;
25 34
26 int _mouseStartPosX,_mouseStartPosY; 35 int _mouseStartPosX,_mouseStartPosY;
27 36
37 bool scale_to_fit;
38 bool rotate_to_fit;
39 bool first_resize_done;
40 Rotation last_rot;
41
42 void rescaleImage(int w, int h);
43
44 void rotate_into_data(Rotation r);
45
28protected slots: 46protected slots:
29 virtual void viewportMouseMoveEvent(QMouseEvent* e); 47 virtual void viewportMouseMoveEvent(QMouseEvent* e);
30 virtual void contentsMousePressEvent ( QMouseEvent * e); 48 virtual void contentsMousePressEvent ( QMouseEvent * e);
31 virtual void contentsMouseReleaseEvent ( QMouseEvent * e); 49 virtual void contentsMouseReleaseEvent ( QMouseEvent * e);
50 virtual void resizeEvent(QResizeEvent * e);
32}; 51};
33 52
34/* for testing */ 53/* for testing */