author | kergoth <kergoth> | 2002-01-25 22:14:26 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2002-01-25 22:14:26 (UTC) |
commit | 15318cad33835e4e2dc620d033e43cd930676cdd (patch) (unidiff) | |
tree | c2fa0399a2c47fda8e2cd0092c73a809d17f68eb /library/qpedecoration_qws.h | |
download | opie-15318cad33835e4e2dc620d033e43cd930676cdd.zip opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.gz opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.bz2 |
Initial revision
-rw-r--r-- | library/qpedecoration_qws.h | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/library/qpedecoration_qws.h b/library/qpedecoration_qws.h new file mode 100644 index 0000000..b8afd05 --- a/dev/null +++ b/library/qpedecoration_qws.h | |||
@@ -0,0 +1,101 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qtopia Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | #ifndef QPE_DECORATION_QWS_H__ | ||
21 | #define QPE_DECORATION_QWS_H__ | ||
22 | |||
23 | |||
24 | #include <qwsdefaultdecoration_qws.h> | ||
25 | #include <qimage.h> | ||
26 | #include <qdatetime.h> | ||
27 | #include <qguardedptr.h> | ||
28 | |||
29 | |||
30 | #ifndef QT_NO_QWS_QPE_WM_STYLE | ||
31 | |||
32 | class QPEManager; | ||
33 | class QTimer; | ||
34 | |||
35 | class QPEDecoration : public QWSDefaultDecoration | ||
36 | { | ||
37 | public: | ||
38 | QPEDecoration(); | ||
39 | virtual ~QPEDecoration(); | ||
40 | |||
41 | virtual QRegion region(const QWidget *, const QRect &rect, Region); | ||
42 | virtual void paint(QPainter *, const QWidget *); | ||
43 | virtual void paintButton(QPainter *, const QWidget *, Region, int state); | ||
44 | |||
45 | void maximize( QWidget * ); | ||
46 | void minimize( QWidget * ); | ||
47 | virtual void help( QWidget * ); | ||
48 | |||
49 | enum QPERegion { Help=LastRegion+1 }; | ||
50 | void buttonClicked( QPERegion r ); | ||
51 | |||
52 | protected: | ||
53 | void fillTitle( QPainter *p, const QWidget *w, int x, int y, int w, int h ); | ||
54 | // virtual int getTitleWidth(const QWidget *); | ||
55 | virtual int getTitleHeight(const QWidget *); | ||
56 | virtual const char **menuPixmap(); | ||
57 | virtual const char **closePixmap(); | ||
58 | virtual const char **minimizePixmap(); | ||
59 | virtual const char **maximizePixmap(); | ||
60 | virtual const char **normalizePixmap(); | ||
61 | |||
62 | protected: | ||
63 | QImage imageOk; | ||
64 | QImage imageClose; | ||
65 | QImage imageHelp; | ||
66 | QString helpFile; | ||
67 | bool helpExists; | ||
68 | QPEManager *qpeManager; | ||
69 | }; | ||
70 | |||
71 | |||
72 | class QPEManager : public QObject | ||
73 | { | ||
74 | Q_OBJECT | ||
75 | friend class QPEDecoration; | ||
76 | public: | ||
77 | QPEManager( QPEDecoration *d, QObject *parent=0 ); | ||
78 | |||
79 | void updateActive(); | ||
80 | |||
81 | protected: | ||
82 | int pointInQpeRegion( QWidget *w, const QPoint &p ); | ||
83 | virtual bool eventFilter( QObject *, QEvent * ); | ||
84 | void drawButton( QWidget *w, QPEDecoration::QPERegion r, int state ); | ||
85 | |||
86 | protected slots: | ||
87 | void whatsThisTimeout(); | ||
88 | |||
89 | protected: | ||
90 | QPEDecoration *decoration; | ||
91 | QGuardedPtr<QWidget> active; | ||
92 | int helpState; | ||
93 | QTime pressTime; | ||
94 | QTimer *wtTimer; | ||
95 | }; | ||
96 | |||
97 | |||
98 | #endif // QT_NO_QWS_QPE_WM_STYLE | ||
99 | |||
100 | |||
101 | #endif // QPE_DECORATION_QWS_H__ | ||