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 | 65 |
1 files changed, 41 insertions, 24 deletions
diff --git a/noncore/graphics/opie-eye/gui/imagescrollview.h b/noncore/graphics/opie-eye/gui/imagescrollview.h index f6e187d..3d2ea38 100644 --- a/noncore/graphics/opie-eye/gui/imagescrollview.h +++ b/noncore/graphics/opie-eye/gui/imagescrollview.h @@ -2,6 +2,4 @@ #define _IMAGE_SCROLL_VIEW_H -#include <lib/oimagezoomer.h> - #include <qscrollview.h> #include <qimage.h> @@ -9,20 +7,30 @@ #include <qstring.h> #include <qdialog.h> - +#include <qbitarray.h> class QPainter; -class ImageScrollView:public QScrollView +namespace Opie { namespace MM { + + class OImageZoomer; + +class OImageScrollView:public QScrollView { Q_OBJECT public: - ImageScrollView( QWidget* parent, const char* name = 0, WFlags fl = 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(); + enum Rotation { + Rotate0, + Rotate90, + Rotate180, + Rotate270 + }; + + OImageScrollView( QWidget* parent, const char* name = 0, WFlags fl = 0 ); + OImageScrollView (const QImage&, QWidget * parent=0, const char * name=0, WFlags f=0,bool always_scale=false,bool rfit=false ); + OImageScrollView (const QString&, QWidget * parent=0, const char * name=0, WFlags f=0,bool always_scale=false,bool rfit=false ); + virtual ~OImageScrollView(); + - virtual void setImage(const QImage&); - virtual void setImage( const QString& path ); virtual void setDestructiveClose(); @@ -31,13 +39,14 @@ public: virtual void setShowZoomer(bool); - enum Rotation { - Rotate0, - Rotate90, - Rotate180, - Rotate270 - }; + virtual bool AutoRotate()const; + virtual bool AutoScale()const; + virtual bool ShowZoomer()const; + +public slots: + virtual void setImage(const QImage&); + virtual void setImage( const QString& path ); + signals: - void sig_return(); void imageSizeChanged( const QSize& ); void viewportSizeChanged( const QSize& ); @@ -54,11 +63,7 @@ protected: int _mouseStartPosX,_mouseStartPosY; - bool scale_to_fit; - bool rotate_to_fit; - bool show_zoomer; - bool first_resize_done; - bool image_is_jpeg; - bool image_scaled_loaded; - Rotation last_rot; + QBitArray m_states; + + Rotation m_last_rot; QString m_lastName; virtual void rescaleImage(int w, int h); @@ -70,4 +75,12 @@ protected: void check_zoomer(); + /* internal bitset manipulation */ + virtual bool ImageIsJpeg()const; + virtual void setImageIsJpeg(bool how); + virtual bool ImageScaledLoaded()const; + virtual void setImageScaledLoaded(bool how); + virtual bool FirstResizeDone()const; + virtual void setFirstResizeDone(bool how); + protected slots: virtual void viewportMouseMoveEvent(QMouseEvent* e); @@ -76,3 +89,7 @@ protected slots: virtual void keyPressEvent(QKeyEvent * e); }; + +} +} + #endif |