Diffstat (limited to 'noncore/apps/opie-reader/GraphicWin.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/GraphicWin.h | 79 |
1 files changed, 35 insertions, 44 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,65 +1,56 @@ | |||
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 | ||
9 | class GraphicScroll : public QScrollView | 11 | class GraphicScroll : public QScrollView |
10 | { | 12 | { |
11 | Q_OBJECT | 13 | Q_OBJECT |
12 | QWidget* m_picture; | 14 | QWidget* m_picture; |
13 | protected: | 15 | protected: |
14 | void hideEvent( QHideEvent * p) | 16 | void hideEvent( QHideEvent * p) |
15 | { | 17 | { |
16 | m_picture->setFixedSize(1,1); | 18 | m_picture->setFixedSize(1,1); |
17 | } | 19 | } |
18 | public: | 20 | public: |
19 | GraphicScroll( QWidget *parent=0, const char *name=0, WFlags f = 0) | 21 | GraphicScroll( QWidget *parent=0, const char *name=0, WFlags f = 0) |
20 | : QScrollView(parent, name, f) | 22 | : QScrollView(parent, name, f) |
21 | { | 23 | { |
22 | m_picture = new QWidget(viewport()); | 24 | m_picture = new QWidget(viewport()); |
23 | addChild(m_picture); | 25 | addChild(m_picture); |
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 | ||
40 | class GraphicWin : public QWidget | 35 | class GraphicWin : public QWidget |
41 | { | 36 | { |
42 | Q_OBJECT | 37 | Q_OBJECT |
43 | 38 | ||
44 | GraphicScroll* m_scroll; | 39 | GraphicScroll* m_scroll; |
45 | signals: | 40 | QImage m_im; |
46 | void Closed(); | 41 | QImage resizeimage(int w, int h); |
47 | private slots: | 42 | void resetpm(); |
48 | void slotClosed() { emit Closed(); } | 43 | bool m_isFitted, m_isRotated; |
49 | 44 | signals: | |
50 | public: | 45 | void Closed(); |
51 | 46 | private slots: | |
52 | void setPixmap(QPixmap& pm) { m_scroll->setPixmap(pm); } | 47 | void slotClosed() { emit Closed(); } |
53 | GraphicWin( QWidget *parent=0, const char *name=0, WFlags f = 0) | 48 | void slotFit(); |
54 | : QWidget(parent, name, f) | 49 | void slotRotate(); |
55 | { | 50 | public: |
56 | QVBoxLayout* grid = new QVBoxLayout(this); | 51 | void setPixmap(QPixmap& pm) { m_scroll->setPixmap(pm); } |
57 | m_scroll = new GraphicScroll(this); | 52 | void setImage(QImage& im); |
58 | QPushButton* exitButton = new QPushButton("Close", this); | 53 | GraphicWin( QWidget *parent=0, const char *name=0, WFlags f = 0); |
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 |