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.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/noncore/graphics/opie-eye/gui/imagescrollview.h b/noncore/graphics/opie-eye/gui/imagescrollview.h index 864a015..dcf54ce 100644 --- a/noncore/graphics/opie-eye/gui/imagescrollview.h +++ b/noncore/graphics/opie-eye/gui/imagescrollview.h | |||
@@ -12,24 +12,27 @@ class ImageScrollView:public QScrollView | |||
12 | { | 12 | { |
13 | Q_OBJECT | 13 | Q_OBJECT |
14 | public: | 14 | public: |
15 | ImageScrollView( QWidget* parent, const char* name = 0, WFlags fl = 0 ); | 15 | ImageScrollView( QWidget* parent, const char* name = 0, WFlags fl = 0 ); |
16 | ImageScrollView (const QImage&, QWidget * parent=0, const char * name=0, WFlags f=0,bool always_scale=false,bool rfit=false ); | 16 | ImageScrollView (const QImage&, QWidget * parent=0, const char * name=0, WFlags f=0,bool always_scale=false,bool rfit=false ); |
17 | ImageScrollView (const QString&, QWidget * parent=0, const char * name=0, WFlags f=0,bool always_scale=false,bool rfit=false ); | 17 | ImageScrollView (const QString&, QWidget * parent=0, const char * name=0, WFlags f=0,bool always_scale=false,bool rfit=false ); |
18 | virtual ~ImageScrollView(); | 18 | virtual ~ImageScrollView(); |
19 | 19 | ||
20 | void setImage(const QImage&); | 20 | void setImage(const QImage&); |
21 | void setImage( const QString& path ); | 21 | void setImage( const QString& path ); |
22 | void setDestructiveClose(); | 22 | void setDestructiveClose(); |
23 | 23 | ||
24 | void setAutoRotate(bool); | ||
25 | void setAutoScale(bool); | ||
26 | |||
24 | enum Rotation { | 27 | enum Rotation { |
25 | Rotate0, | 28 | Rotate0, |
26 | Rotate90, | 29 | Rotate90, |
27 | Rotate180, | 30 | Rotate180, |
28 | Rotate270 | 31 | Rotate270 |
29 | }; | 32 | }; |
30 | 33 | ||
31 | signals: | 34 | signals: |
32 | void sig_return(); | 35 | void sig_return(); |
33 | 36 | ||
34 | protected: | 37 | protected: |
35 | virtual void drawContents ( QPainter * p, int clipx, int clipy, int clipw, int cliph ); | 38 | virtual void drawContents ( QPainter * p, int clipx, int clipy, int clipw, int cliph ); |
@@ -39,24 +42,25 @@ protected: | |||
39 | QImage _original_data; | 42 | QImage _original_data; |
40 | 43 | ||
41 | int _mouseStartPosX,_mouseStartPosY; | 44 | int _mouseStartPosX,_mouseStartPosY; |
42 | 45 | ||
43 | bool scale_to_fit; | 46 | bool scale_to_fit; |
44 | bool rotate_to_fit; | 47 | bool rotate_to_fit; |
45 | bool first_resize_done; | 48 | bool first_resize_done; |
46 | Rotation last_rot; | 49 | Rotation last_rot; |
47 | 50 | ||
48 | void rescaleImage(int w, int h); | 51 | void rescaleImage(int w, int h); |
49 | 52 | ||
50 | void rotate_into_data(Rotation r); | 53 | void rotate_into_data(Rotation r); |
54 | void generateImage(); | ||
51 | 55 | ||
52 | protected slots: | 56 | protected slots: |
53 | virtual void viewportMouseMoveEvent(QMouseEvent* e); | 57 | virtual void viewportMouseMoveEvent(QMouseEvent* e); |
54 | virtual void contentsMousePressEvent ( QMouseEvent * e); | 58 | virtual void contentsMousePressEvent ( QMouseEvent * e); |
55 | virtual void contentsMouseReleaseEvent ( QMouseEvent * e); | 59 | virtual void contentsMouseReleaseEvent ( QMouseEvent * e); |
56 | virtual void resizeEvent(QResizeEvent * e); | 60 | virtual void resizeEvent(QResizeEvent * e); |
57 | }; | 61 | }; |
58 | 62 | ||
59 | /* for testing */ | 63 | /* for testing */ |
60 | class ImageDlg:public QDialog | 64 | class ImageDlg:public QDialog |
61 | { | 65 | { |
62 | Q_OBJECT | 66 | Q_OBJECT |