summaryrefslogtreecommitdiff
path: root/library/qpeapplication.h
Unidiff
Diffstat (limited to 'library/qpeapplication.h') (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpeapplication.h40
1 files changed, 39 insertions, 1 deletions
diff --git a/library/qpeapplication.h b/library/qpeapplication.h
index 729cf2b..3ef8b46 100644
--- a/library/qpeapplication.h
+++ b/library/qpeapplication.h
@@ -8,65 +8,103 @@
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#ifndef __QPE_APPLICATION_H__ 20#ifndef __QPE_APPLICATION_H__
21#define __QPE_APPLICATION_H__ 21#define __QPE_APPLICATION_H__
22 22
23#include <stdlib.h> // for setenv() 23#include <stdlib.h> // for setenv()
24 24
25#include <qglobal.h> 25#include <qglobal.h>
26#include <qapplication.h> 26#include <qapplication.h>
27#include <qdialog.h> 27#include <qdialog.h>
28#include <qwsdisplay_qws.h> 28#include <qwsdisplay_qws.h>
29#if defined(_WS_QWS_) && !defined(Q_WS_QWS) 29#if defined(_WS_QWS_) && !defined(Q_WS_QWS)
30#define Q_WS_QWS 30#define Q_WS_QWS
31#endif 31#endif
32#include "qpedecoration_qws.h" 32#include "qpedecoration_qws.h"
33#include "timestring.h" 33#include "timestring.h"
34 34
35class QCopChannel; 35class QCopChannel;
36class QPEApplicationData; 36class QPEApplicationData;
37class QWSEvent; 37class QWSEvent;
38class QWSKeyEvent; 38class QWSKeyEvent;
39 39
40 40/**
41 \brief The QPEApplication class implements various system services
42 that are available to all Qtopia applications.
43
44 Simply by using QPEApplication instead of QApplication, a standard Qt
45 application becomes a Qtopia application. It automatically follows
46 style changes, quits and raises, and in the
47 case of \link docwidget.html document-oriented\endlink applications,
48 changes the currently displayed document in response to the environment.
49
50 To create a \link docwidget.html document-oriented\endlink
51 application use showMainDocumentWidget(); to create a
52 non-document-oriented application use showMainWidget(). The
53 keepRunning() function indicates whether the application will
54 continue running after it's processed the last \link qcop.html
55 QCop\endlink message. This can be changed using setKeepRunning().
56
57 A variety of signals are emitted when certain events occur, for
58 example, timeChanged(), clockChanged(), weekChanged(),
59 dateFormatChanged() and volumeChanged(). If the application receives
60 a \link qcop.html QCop\endlink message on the application's
61 QPE/Application/\e{appname} channel, the appMessage() signal is
62 emitted. There are also flush() and reload() signals, which
63 are emitted when synching begins and ends respectively - upon these
64 signals, the application should save and reload any data
65 files that are involved in synching. Most of these signals will initially
66 be received and unfiltered through the appMessage() signal.
67
68 This class also provides a set of useful static functions. The
69 qpeDir() and documentDir() functions return the respective paths.
70 The grabKeyboard() and ungrabKeyboard() functions are used to
71 control whether the application takes control of the device's
72 physical buttons (e.g. application launch keys). The stylus' mode of
73 operation is set with setStylusOperation() and retrieved with
74 stylusOperation(). There are also setInputMethodHint() and
75 inputMethodHint() functions.
76
77 \ingroup qtopiaemb
78*/
41class QPEApplication : public QApplication 79class QPEApplication : public QApplication
42{ 80{
43 Q_OBJECT 81 Q_OBJECT
44public: 82public:
45 QPEApplication( int& argc, char **argv, Type=GuiClient ); 83 QPEApplication( int& argc, char **argv, Type=GuiClient );
46 ~QPEApplication(); 84 ~QPEApplication();
47 85
48 static QString qpeDir(); 86 static QString qpeDir();
49 static QString documentDir(); 87 static QString documentDir();
50 void applyStyle(); 88 void applyStyle();
51 void reset(); 89 void reset();
52 static int defaultRotation(); 90 static int defaultRotation();
53 static void setDefaultRotation(int r); 91 static void setDefaultRotation(int r);
54 static void setCurrentRotation(int r); 92 static void setCurrentRotation(int r);
55 static void setCurrentMode(int x, int y, int depth ); 93 static void setCurrentMode(int x, int y, int depth );
56 static void grabKeyboard(); 94 static void grabKeyboard();
57 static void ungrabKeyboard(); 95 static void ungrabKeyboard();
58 96
59 enum StylusMode { 97 enum StylusMode {
60 LeftOnly, 98 LeftOnly,
61 RightOnHold 99 RightOnHold
62 // RightOnHoldLeftDelayed, etc. 100 // RightOnHoldLeftDelayed, etc.
63 }; 101 };
64 static void setStylusOperation( QWidget*, StylusMode ); 102 static void setStylusOperation( QWidget*, StylusMode );
65 static StylusMode stylusOperation( QWidget* ); 103 static StylusMode stylusOperation( QWidget* );
66 104
67 enum InputMethodHint { 105 enum InputMethodHint {
68 Normal, 106 Normal,
69 AlwaysOff, 107 AlwaysOff,
70 AlwaysOn 108 AlwaysOn
71 }; 109 };
72 110