summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/GraphicWin.h
Unidiff
Diffstat (limited to 'noncore/apps/opie-reader/GraphicWin.h') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-reader/GraphicWin.h29
1 files changed, 10 insertions, 19 deletions
diff --git a/noncore/apps/opie-reader/GraphicWin.h b/noncore/apps/opie-reader/GraphicWin.h
index 31811d2..70d5f7e 100644
--- a/noncore/apps/opie-reader/GraphicWin.h
+++ b/noncore/apps/opie-reader/GraphicWin.h
@@ -1,13 +1,15 @@
1#ifndef __GRAPHICWIN_H 1#ifndef __GRAPHICWIN_H
2#define __GRAPHICWIN_H 2#define __GRAPHICWIN_H
3 3
4#include <qscrollview.h> 4#include <qscrollview.h>
5#include <qpixmap.h> 5#include <qpixmap.h>
6#include <qimage.h>
6#include <qpushbutton.h> 7#include <qpushbutton.h>
7#include <qlayout.h> 8#include <qlayout.h>
9#include <qwmatrix.h>
8 10
9class GraphicScroll : public QScrollView 11class GraphicScroll : public QScrollView
10{ 12{
11 Q_OBJECT 13 Q_OBJECT
12 QWidget* m_picture; 14 QWidget* m_picture;
13 protected: 15 protected:
@@ -24,42 +26,31 @@ class GraphicScroll : public QScrollView
24 } 26 }
25 void setPixmap(QPixmap& pm) 27 void setPixmap(QPixmap& pm)
26 { 28 {
27 m_picture->setFixedSize(pm.size()); 29 m_picture->setFixedSize(pm.size());
28 m_picture->setBackgroundPixmap(pm); 30 m_picture->setBackgroundPixmap(pm);
29 } 31 }
30/*
31 private slots:
32 void graphicClose() { emit Close(); }
33 signals:
34 void Close();
35*/
36
37}; 32};
38 33
39 34
40class GraphicWin : public QWidget 35class GraphicWin : public QWidget
41{ 36{
42 Q_OBJECT 37 Q_OBJECT
43 38
44 GraphicScroll* m_scroll; 39 GraphicScroll* m_scroll;
40 QImage m_im;
41 QImage resizeimage(int w, int h);
42 void resetpm();
43 bool m_isFitted, m_isRotated;
45 signals: 44 signals:
46 void Closed(); 45 void Closed();
47 private slots: 46 private slots:
48 void slotClosed() { emit Closed(); } 47 void slotClosed() { emit Closed(); }
49 48 void slotFit();
49 void slotRotate();
50 public: 50 public:
51
52 void setPixmap(QPixmap& pm) { m_scroll->setPixmap(pm); } 51 void setPixmap(QPixmap& pm) { m_scroll->setPixmap(pm); }
53 GraphicWin( QWidget *parent=0, const char *name=0, WFlags f = 0) 52 void setImage(QImage& im);
54 : QWidget(parent, name, f) 53 GraphicWin( QWidget *parent=0, const char *name=0, WFlags f = 0);
55 {
56 QVBoxLayout* grid = new QVBoxLayout(this);
57 m_scroll = new GraphicScroll(this);
58 QPushButton* exitButton = new QPushButton("Close", this);
59 connect(exitButton, SIGNAL( released() ), this, SLOT( slotClosed() ) );
60 grid->addWidget(m_scroll,1);
61 grid->addWidget(exitButton);
62 }
63}; 54};
64 55
65#endif 56#endif