summaryrefslogtreecommitdiff
path: root/noncore/graphics/opie-eye/gui/imagescrollview.h
Side-by-side diff
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
@@ -9,29 +9,48 @@
class QPainter;
class ImageScrollView:public QScrollView
{
Q_OBJECT
public:
- ImageScrollView (const QImage&, QWidget * parent=0, const char * name=0, WFlags f=0 );
- ImageScrollView (const QString&, QWidget * parent=0, const char * name=0, WFlags f=0 );
+ ImageScrollView (const QImage&, QWidget * parent=0, const char * name=0, WFlags f=0,bool always_scale=false,bool rfit=false );
+ ImageScrollView (const QString&, QWidget * parent=0, const char * name=0, WFlags f=0,bool always_scale=false,bool rfit=false );
virtual ~ImageScrollView();
void setImage(const QImage&);
+
+ enum Rotation {
+ Rotate0,
+ Rotate90,
+ Rotate180,
+ Rotate270
+ };
+
protected:
virtual void drawContents ( QPainter * p, int clipx, int clipy, int clipw, int cliph );
void init();
QImage _image_data;
+ QImage _original_data;
int _mouseStartPosX,_mouseStartPosY;
+ bool scale_to_fit;
+ bool rotate_to_fit;
+ bool first_resize_done;
+ Rotation last_rot;
+
+ void rescaleImage(int w, int h);
+
+ void rotate_into_data(Rotation r);
+
protected slots:
virtual void viewportMouseMoveEvent(QMouseEvent* e);
virtual void contentsMousePressEvent ( QMouseEvent * e);
virtual void contentsMouseReleaseEvent ( QMouseEvent * e);
+ virtual void resizeEvent(QResizeEvent * e);
};
/* for testing */
class ImageDlg:public QDialog
{
Q_OBJECT