#include </home/clem/local/src/opie/library/qpeapplication.h>
Inheritance diagram for QPEApplication:


Public Types | |
| enum | StylusMode { LeftOnly, RightOnHold } |
| enum | InputMethodHint { Normal, AlwaysOff, AlwaysOn } |
| enum | screenSaverHint { Disable = 0, DisableLightOff = 1, DisableSuspend = 2, Enable = 100 } |
| enum | StylusMode { LeftOnly, RightOnHold } |
| enum | InputMethodHint { Normal, AlwaysOff, AlwaysOn } |
| enum | screenSaverHint { Disable = 0, DisableLightOff = 1, DisableSuspend = 2, Enable = 100 } |
Signals | |
| void | clientMoused () |
| void | timeChanged () |
| void | clockChanged (bool pm) |
| void | micChanged (bool muted) |
| void | volumeChanged (bool muted) |
| void | appMessage (const QCString &msg, const QByteArray &data) |
| void | weekChanged (bool startOnMonday) |
| void | dateFormatChanged (DateFormat) |
| void | flush () |
| void | reload () |
| void | clientMoused () |
| void | timeChanged () |
| void | clockChanged (bool pm) |
| void | micChanged (bool muted) |
| void | volumeChanged (bool muted) |
| void | appMessage (const QCString &msg, const QByteArray &data) |
| void | weekChanged (bool startOnMonday) |
| void | dateFormatChanged (DateFormat) |
| void | flush () |
| void | reload () |
Public Member Functions | |
| QPEApplication (int &argc, char **argv, Type=GuiClient) | |
| ~QPEApplication () | |
| void | applyStyle () |
| void | reset () |
| void | showMainWidget (QWidget *, bool nomax=FALSE) |
| void | showMainDocumentWidget (QWidget *, bool nomax=FALSE) |
| bool | keepRunning () const |
| bool | keyboardGrabbed () const |
| int | exec () |
| QPEApplication (int &argc, char **argv, Type=GuiClient) | |
| ~QPEApplication () | |
| void | applyStyle () |
| void | showMainWidget (QWidget *, bool nomax=FALSE) |
| void | showMainDocumentWidget (QWidget *, bool nomax=FALSE) |
| bool | keepRunning () const |
| bool | keyboardGrabbed () const |
| int | exec () |
| int | x11ClientMessage (QWidget *, XEvent *, bool) |
Static Public Member Functions | |
| static QString | qpeDir () |
| static QString | documentDir () |
| static int | defaultRotation () |
| static void | setDefaultRotation (int r) |
| static void | setCurrentRotation (int r) |
| static void | setCurrentMode (int x, int y, int depth) |
| static void | grabKeyboard () |
| static void | ungrabKeyboard () |
| static void | setStylusOperation (QWidget *, StylusMode) |
| static StylusMode | stylusOperation (QWidget *) |
| static void | setInputMethodHint (QWidget *, InputMethodHint) |
| static InputMethodHint | inputMethodHint (QWidget *) |
| static void | showDialog (QDialog *, bool nomax=FALSE) QPE_WEAK_SYMBOL |
| static int | execDialog (QDialog *, bool nomax=FALSE) QPE_WEAK_SYMBOL |
| static void | showWidget (QWidget *, bool nomax=FALSE) QPE_WEAK_SYMBOL |
| static void | setKeepRunning () |
| static QString | qpeDir () |
| static QString | documentDir () |
| static int | defaultRotation () |
| static void | setDefaultRotation (int r) |
| static void | grabKeyboard () |
| static void | ungrabKeyboard () |
| static void | setStylusOperation (QWidget *, StylusMode) |
| static StylusMode | stylusOperation (QWidget *) |
| static void | setInputMethodHint (QWidget *, InputMethodHint) |
| static InputMethodHint | inputMethodHint (QWidget *) |
| static void | showDialog (QDialog *, bool nomax=FALSE) |
| static int | execDialog (QDialog *, bool nomax=FALSE) |
| static void | showWidget (QWidget *, bool nomax=FALSE) |
| static void | setKeepRunning () |
Protected Member Functions | |
| bool | qwsEventFilter (QWSEvent *) |
| void | internalSetStyle (const QString &style) |
| void | prepareForTermination (bool willrestart) |
| virtual void | restart () |
| virtual void | shutdown () |
| bool | eventFilter (QObject *, QEvent *) |
| void | timerEvent (QTimerEvent *) |
| bool | raiseAppropriateWindow () |
| virtual void | tryQuit () |
| virtual void | restart () |
| virtual void | shutdown () |
| void | prepareForTermination (bool willrestart) |
| bool | eventFilter (QObject *, QEvent *) |
| void | timerEvent (QTimerEvent *) |
| void | raiseAppropriateWindow () |
| virtual void | tryQuit () |
Private Slots | |
| void | systemMessage (const QCString &msg, const QByteArray &data) |
| void | pidMessage (const QCString &msg, const QByteArray &data) |
| void | removeSenderFromStylusDict () |
| void | hideOrQuit () |
| void | hideOrQuit () |
| void | systemMessage (const QCString &, const QByteArray &) |
| void | pidMessage (const QCString &, const QByteArray &) |
| void | removeSenderFromStylusDict () |
Private Member Functions | |
| void | mapToDefaultAction (QWSKeyEvent *ke, int defKey) |
| void | processQCopFile () |
| void | initTranslations () |
| void | internalSetStyle (const QString &) |
Private Attributes | |
| QPEApplicationData * | d |
| bool | reserved_sh |
| Private * | d |
| QCopChannel * | m_sys |
| QCopChannel * | m_pid |
Classes | |
| class | Private |
Simply by using QPEApplication instead of QApplication, a standard Qt application becomes a Qtopia application. It automatically follows style changes, quits and raises, and in the case of document-oriented applications, changes the currently displayed document in response to the environment.
To create a document-oriented application use showMainDocumentWidget(); to create a non-document-oriented application use showMainWidget(). The keepRunning() function indicates whether the application will continue running after it's processed the last QCop message. This can be changed using setKeepRunning().
A variety of signals are emitted when certain events occur, for example, timeChanged(), clockChanged(), weekChanged(), dateFormatChanged() and volumeChanged(). If the application receives a QCop message on the application's QPE/Application/{appname} channel, the appMessage() signal is emitted. There are also flush() and reload() signals, which are emitted when synching begins and ends respectively - upon these signals, the application should save and reload any data files that are involved in synching. Most of these signals will initially be received and unfiltered through the appMessage() signal.
This class also provides a set of useful static functions. The qpeDir() and documentDir() functions return the respective paths. The grabKeyboard() and ungrabKeyboard() functions are used to control whether the application takes control of the device's physical buttons (e.g. application launch keys). The stylus' mode of operation is set with setStylusOperation() and retrieved with stylusOperation(). There are also setInputMethodHint() and inputMethodHint() functions.
Definition at line 80 of file qpeapplication.h.
|
|
Definition at line 38 of file qpeapplication.h. |
|
|
Normal the application sometimes needs text input (the default). AlwaysOff the application never needs text input. AlwaysOn the application always needs text input. Definition at line 106 of file qpeapplication.h. |
|
|
Definition at line 60 of file qpeapplication.h. |
|
|
Definition at line 112 of file qpeapplication.h. |
|
|
Definition at line 31 of file qpeapplication.h. |
|
|
LeftOnly the stylus only generates LeftButton events (the default). RightOnHold the stylus generates RightButton events if the user uses the press-and-hold gesture.
Definition at line 98 of file qpeapplication.h. |
|
||||||||||||||||
|
Constructs a QPEApplication just as you would construct a QApplication, passing argc, argv, and t. For applications, t should be the default, GuiClient. Only the Qtopia server passes GuiServer. Definition at line 816 of file qpeapplication.cpp. References applyStyle(), QDataStream::atEnd(), QFile::close(), d, f, FALSE, QFile::handle(), hideOrQuit(), QPEMenuToolFocusManager::initialize(), IO_ReadOnly, QIODevice::isOpen(), FontDatabase::loadRenderers(), QFile::open(), pidMessage(), qstrcmp(), qtopia_loadTranslations(), qtopiaMsgHandler(), QFile::remove(), QCString::replace(), AppLnk::setBigIconSize(), AppLnk::setSmallIconSize(), systemMessage(), TRUE, and type. |
|
|
Destroys the QPEApplication. Definition at line 1204 of file qpeapplication.cpp. References d, and ungrabKeyboard(). |
|
||||||||||||||||
|
|
|
|
|
|
|
|
|
|
For internal use only.
Definition at line 1356 of file qpeapplication.cpp. References d, dec(), Disabled, internalSetStyle(), Config::readBoolEntry(), Config::readEntry(), Config::readNumEntry(), Config::setGroup(), and TRUE. Referenced by QPEApplication(), reset(), and systemMessage(). |
|
||||||||||||
|
|
|
||||||||||||
|
This signal is emitted when a message is received on this application's QPE/Application/appname QCop channel. The slot to which you connect this signal uses msg and data in the following way:
void MyWidget::receive( const QCString& msg, const QByteArray& data ) { QDataStream stream( data, IO_ReadOnly ); if ( msg == "someMessage(int,int,int)" ) { int a,b,c; stream >> a >> b >> c; ... } else if ( msg == "otherMessage(QString)" ) { ... } }
Referenced by pidMessage(). |
|
|
|
|
|
Referenced by qwsEventFilter(). |
|
|
|
|
|
Referenced by systemMessage(). |
|
|
|
|
|
Referenced by systemMessage(). |
|
|
|
|
|
For internal use only.
Definition at line 1264 of file qpeapplication.cpp. References QString::contains(), and d. Referenced by RotateApplet::activated(), AppLnk::execute(), and initEnvironment(). |
|
|
|
|
|
||||||||||||
|
Reimplemented in ServerApplication, and OQWSServer. |
|
||||||||||||
|
Reimplemented in ServerApplication, and OQWSServer. Definition at line 1985 of file qpeapplication.cpp. References d, FALSE, KeyPress, KeyRelease, printf, RightOnHold, and TRUE. Referenced by OQWSServer::eventFilter(), and ServerApplication::eventFilter(). |
|
|
Reimplemented in ServerApplication. |
|
|
Reimplemented in ServerApplication. Definition at line 2135 of file qpeapplication.cpp. References d. Referenced by ServerApplication::exec(), fileviewer(), main(), UI::MainLoop(), and AppLnkSearch::search(). |
|
||||||||||||
|
|
|
||||||||||||
|
|
|
|
|
Referenced by pidMessage(). |
|
|
|
|
|
Grabs the physical keyboard keys, e.g. the application's launching keys. Instead of launching applications when these keys are pressed the signals emitted are sent to this application instead. Some games programs take over the launch keys in this way to make interaction easier.
Definition at line 2127 of file qpeapplication.cpp. Referenced by ButtonSettings::ButtonSettings(), Gutenbrowser::cleanUp(), KAstTopLevel::KAstTopLevel(), konsoleInit(), main(), Opie::Core::OKeyConfigManager::OKeyConfigManager(), ParaShoot::ParaShoot(), and ServerApplication::ServerApplication(). |
|
|
|
|
|
For internal use only. User initiated quit. Makes the window 'Go Away'. If preloaded this means hiding the window. If not it means quitting the application. As this is user initiated we don't need to check state. Definition at line 2189 of file qpeapplication.cpp. References d. Referenced by pidMessage(), and QPEApplication(). |
|
|
Definition at line 341 of file qpeapplication.cpp. References QValueList< T >::begin(), d, QValueList< T >::end(), and qpeDir(). |
|
|
|
|
|
Returns the currently set hint to the system as to whether widget w has any use for text input methods.
Definition at line 995 of file qpeapplication.cpp. References Normal. Referenced by qwsEventFilter(). |
|
|
|
|
|
For internal use only.
Definition at line 1812 of file qpeapplication.cpp. References IID_Style, lower(), QLibrary, qpeDir(), and QS_OK. Referenced by applyStyle(). |
|
|
|
|
|
Returns TRUE if the application will quit after processing the current list of qcop messages; otherwise returns FALSE.
Definition at line 1804 of file qpeapplication.cpp. References d. |
|
|
|
|
|
For internal use only.
Definition at line 2103 of file qpeapplication.cpp. References d. |
|
||||||||||||
|
Definition at line 1042 of file qpeapplication.cpp. References Qt::Key_Return. Referenced by qwsEventFilter(). |
|
|
|
|
|
Referenced by systemMessage(). |
|
||||||||||||
|
|
|
||||||||||||
|
Definition at line 1667 of file qpeapplication.cpp. References appMessage(), d, FALSE, flush(), hideOrQuit(), IO_ReadOnly, processQCopFile(), raiseAppropriateWindow(), reload(), Global::setDocument(), stream, TRUE, and tryQuit(). Referenced by QPEApplication(). |
|
|
|
|
|
For internal use only.
Definition at line 1900 of file qpeapplication.cpp. References tr. Referenced by ServerApplication::restart(), and ServerApplication::shutdown(). |
|
|
Referenced by pidMessage(), and systemMessage(). |
|
|
|
|
|
|
For internal use only.
Reimplemented in OConsoleApplication. Definition at line 1066 of file qpeapplication.cpp. References HackDialog::acceptIt(), active, AlwaysOff, AlwaysOn, clientMoused(), d, Global::hideInputMethod(), inputMethodHint(), Qt::Key_Escape, Qt::Key_F1, Qt::Key_F29, Qt::Key_F30, Qt::Key_F33, Qt::Key_Return, Qt::Key_Space, KeyPress, KeyRelease, mapToDefaultAction(), qApp, HackDialog::rejectIt(), Global::showInputMethod(), TRUE, and type. Referenced by OConsoleApplication::qwsEventFilter(). |
|
|
|
|
|
For internal use only.
Definition at line 1592 of file qpeapplication.cpp. References d, FALSE, and TRUE. Referenced by pidMessage(). |
|
|
|
|
|
Referenced by pidMessage(). |
|
|
|
|
|
Definition at line 2092 of file qpeapplication.cpp. References d. Referenced by setStylusOperation(). |
|
|
Definition at line 1338 of file qpeapplication.cpp. References applyStyle(), and QString::null. Referenced by systemMessage(). |
|
|
Reimplemented in ServerApplication. |
|
|
For internal use only.
Reimplemented in ServerApplication. Definition at line 1925 of file qpeapplication.cpp. Referenced by systemMessage(). |
|
||||||||||||||||
|
Definition at line 1316 of file qpeapplication.cpp. References qApp, and qws_clearLoadedFonts(). Referenced by systemMessage(). |
|
|
Definition at line 205 of file qpeapplication.h. References DegToTrans(), driver, QCString::find(), QCString::left(), qApp, and setDefaultRotation(). Referenced by systemMessage(). |
|
|
|
|
|
For internal use only.
Definition at line 1287 of file qpeapplication.cpp. References driver, QCString::find(), QCString::left(), qApp, Config::setGroup(), and Config::writeEntry(). Referenced by setCurrentRotation(), and systemMessage(). |
|
||||||||||||
|
|
|
||||||||||||
|
Hints to the system that widget w has use for text input methods as specified by mode.
Definition at line 1016 of file qpeapplication.cpp. References createInputMethodDict(), and Normal. Referenced by main(), MindBreaker::MindBreaker(), MineSweep::MineSweep(), ParaShoot::ParaShoot(), and SnakeGame::SnakeGame(). |
|
|
|
|
|
If an application is started via a QCop message, the application will process the QCop message and then quit. If the application calls this function while processing a QCop message, after processing its outstanding QCop messages the application will start 'properly' and show itself.
Definition at line 1790 of file qpeapplication.cpp. Referenced by OPimMainWindow::appMessage(), Opie::OPimMainWindow::appMessage(), DateBook::appMessage(), AddressbookWindow::appMessage(), HelpBrowser::appMessage(), Clock::appMessage(), MainWindowImp::receive(), SlaveReciever::recieveAnswer(), and DrawPad::slotAppMessage(). |
|
||||||||||||
|
|
|
||||||||||||
|
||||||||||||
|
|
|
||||||||||||
|
||||||||||||
|
|
|
||||||||||||
|
Sets widget mw as the mainWidget() and shows it. For small windows, consider passing TRUE for nomaximize rather than the default FALSE. This calls designates the application as a document-oriented application. The mw widget must have this slot: setDocument(const QString&).
Definition at line 1769 of file qpeapplication.cpp. References d, QString::fromUtf8(), and Global::setDocument(). Referenced by QuickLauncher::exec(), and main(). |
|
||||||||||||
|
Reimplemented in Opie::Core::OApplication. |
|
||||||||||||
|
Sets widget mw as the mainWidget() and shows it. For small windows, consider passing TRUE for nomaximize rather than the default FALSE.
Reimplemented in Opie::Core::OApplication. Definition at line 1752 of file qpeapplication.cpp. References d. Referenced by QuickLauncher::exec(), main(), UI::make_mainwin(), and Opie::Core::OApplication::showMainWidget(). |
|
||||||||||||
|
|
|
||||||||||||
|
|
Reimplemented in ServerApplication. |
|
|
For internal use only.
Reimplemented in ServerApplication. Definition at line 1917 of file qpeapplication.cpp. Referenced by systemMessage(). |
|
|
|
|
|
Returns the current StylusMode for widget w.
Definition at line 1942 of file qpeapplication.cpp. References LeftOnly. |
|
||||||||||||
|
Reimplemented in ServerApplication. |
|
||||||||||||
|
Reimplemented in ServerApplication. Definition at line 1408 of file qpeapplication.cpp. References active, AlarmServer::addAlarm(), applyStyle(), clockChanged(), d, dateFormatChanged(), AlarmServer::deleteAlarm(), depth, FALSE, IO_ReadOnly, Key_C, QPEMenuToolFocusManager::manager(), micChanged(), processQCopFile(), reset(), restart(), setCurrentMode(), setCurrentRotation(), setDefaultRotation(), shutdown(), stream, t, timeChanged(), TRUE, tryQuit(), type, v, volumeChanged(), and weekChanged(). Referenced by QPEApplication(). |
|
|
|
|
|
Referenced by systemMessage(). |
|
|
|
|
|
Definition at line 2075 of file qpeapplication.cpp. |
|
|
|
|
|
For internal use only. External request for application to quit. Quits if possible without loosing state. Definition at line 2164 of file qpeapplication.cpp. References d. Referenced by pidMessage(), and systemMessage(). |
|
|
|
|
|
Reverses the effect of grabKeyboard(). This is called automatically on program exit. Definition at line 2113 of file qpeapplication.cpp. Referenced by Gutenbrowser::cleanUp(), ButtonSettings::~ButtonSettings(), Opie::Core::OKeyConfigManager::~OKeyConfigManager(), ~QPEApplication(), and ServerApplication::~ServerApplication(). |
|
|
|
|
|
Referenced by ServerApplication::ServerApplication(), and systemMessage(). |
|
|
|
|
|
Referenced by systemMessage(). |
|
||||||||||||||||
|
Definition at line 735 of file qpeapplication.cpp. References qWarning(). |
|
|
Reimplemented in Opie::Core::OApplication. Definition at line 100 of file qpeapplication.h. |
|
|
Reimplemented in Opie::Core::OApplication. Definition at line 177 of file qpeapplication.h. Referenced by applyStyle(), defaultRotation(), eventFilter(), exec(), grabKeyboard(), hideOrQuit(), initTranslations(), keepRunning(), keyboardGrabbed(), pidMessage(), QPEApplication(), qwsEventFilter(), raiseAppropriateWindow(), removeSenderFromStylusDict(), setKeepRunning(), showMainDocumentWidget(), showMainWidget(), systemMessage(), timerEvent(), TransToDeg(), tryQuit(), ungrabKeyboard(), and ~QPEApplication(). |
|
|
Definition at line 103 of file qpeapplication.h. |
|
|
Definition at line 102 of file qpeapplication.h. |
|
|
Definition at line 179 of file qpeapplication.h. |
1.4.2