summaryrefslogtreecommitdiff
path: root/library/qpeapplication.h
authorzecke <zecke>2004-02-06 15:48:42 (UTC)
committer zecke <zecke>2004-02-06 15:48:42 (UTC)
commitd1c1ce295b6522e52244c970010a9e42c0b614ae (patch) (unidiff)
tree54e3fefdb0ea998e5c9117f245d6a615ce02200c /library/qpeapplication.h
parentb033733924e5d3454bb0a810c6a70d4ff0531d2b (diff)
downloadopie-d1c1ce295b6522e52244c970010a9e42c0b614ae.zip
opie-d1c1ce295b6522e52244c970010a9e42c0b614ae.tar.gz
opie-d1c1ce295b6522e52244c970010a9e42c0b614ae.tar.bz2
add api docu
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
@@ -1,104 +1,142 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 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 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 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
73 enum screenSaverHint { 111 enum screenSaverHint {
74 Disable = 0, 112 Disable = 0,
75 DisableLightOff = 1, 113 DisableLightOff = 1,
76 DisableSuspend = 2, 114 DisableSuspend = 2,
77 Enable = 100 115 Enable = 100
78 }; 116 };
79 117
80 static void setInputMethodHint( QWidget *, InputMethodHint ); 118 static void setInputMethodHint( QWidget *, InputMethodHint );
81 static InputMethodHint inputMethodHint( QWidget * ); 119 static InputMethodHint inputMethodHint( QWidget * );
82 120
83 void showMainWidget( QWidget*, bool nomax=FALSE ); 121 void showMainWidget( QWidget*, bool nomax=FALSE );
84 void showMainDocumentWidget( QWidget*, bool nomax=FALSE ); 122 void showMainDocumentWidget( QWidget*, bool nomax=FALSE );
85 static void showDialog( QDialog*, bool nomax=FALSE ); 123 static void showDialog( QDialog*, bool nomax=FALSE );
86 static int execDialog( QDialog*, bool nomax=FALSE ); 124 static int execDialog( QDialog*, bool nomax=FALSE );
87 /* Merge setTempScreenSaverMode */ 125 /* Merge setTempScreenSaverMode */
88#ifdef QTOPIA_INTERNAL_INITAPP 126#ifdef QTOPIA_INTERNAL_INITAPP
89 void initApp( int argv, char **argv ); 127 void initApp( int argv, char **argv );
90#endif 128#endif
91 129
92 static void setKeepRunning(); 130 static void setKeepRunning();
93 bool keepRunning() const; 131 bool keepRunning() const;
94 132
95 bool keyboardGrabbed() const; 133 bool keyboardGrabbed() const;
96 134
97 int exec(); 135 int exec();
98 136
99signals: 137signals:
100 void clientMoused(); 138 void clientMoused();
101 void timeChanged(); 139 void timeChanged();
102 void clockChanged( bool pm ); 140 void clockChanged( bool pm );
103 void micChanged( bool muted ); 141 void micChanged( bool muted );
104 void volumeChanged( bool muted ); 142 void volumeChanged( bool muted );