QPEApplication Class Reference
The QPEApplication class implements various system services that are available to all Qtopia applications. More...
#include <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 } |
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 () |
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 () |
Static Public Member Functions | |
| QString | qpeDir () |
| QString | documentDir () |
| int | defaultRotation () |
| void | setDefaultRotation (int r) |
| void | setCurrentRotation (int r) |
| void | setCurrentMode (int x, int y, int depth) |
| void | grabKeyboard () |
| void | ungrabKeyboard () |
| void | setStylusOperation (QWidget *, StylusMode) |
| StylusMode | stylusOperation (QWidget *) |
| void | setInputMethodHint (QWidget *, InputMethodHint) |
| InputMethodHint | inputMethodHint (QWidget *) |
| void | showDialog (QDialog *, bool nomax=FALSE) |
| int | execDialog (QDialog *, bool nomax=FALSE) |
| void | showWidget (QWidget *, bool nomax=FALSE) |
| 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 | polish (QWidget *) |
Detailed Description
The QPEApplication class implements various system services that are available to all Qtopia applications.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 79 of file qpeapplication.h.
Member Enumeration Documentation
|
|
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 97 of file qpeapplication.h. Referenced by eventFilter(), and stylusOperation(). |
|
|
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 105 of file qpeapplication.h. Referenced by inputMethodHint(). |
Constructor & Destructor Documentation
|
||||||||||||||||
|
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 597 of file qpeapplication.cpp. References QDataStream::atEnd(), QFile::close(), QObject::connect(), QApplication::desktop(), QFile::handle(), QObject::installEventFilter(), QIODevice::isOpen(), QApplication::lastWindowClosed(), QFile::open(), QFile::remove(), QCString::replace(), AppLnk::setBigIconSize(), QPixmapCache::setCacheLimit(), QMimeSourceFactory::setDefaultFactory(), QToolTip::setEnabled(), QApplication::setFont(), and AppLnk::setSmallIconSize(). |
|
|
Destroys the QPEApplication. Definition at line 1019 of file qpeapplication.cpp. References ungrabKeyboard(). |
Member Function Documentation
|
|
Returns Definition at line 1035 of file qpeapplication.cpp. Referenced by MimeType::appsFolderName(), Resource::findPixmap(), Resource::findSound(), and FontDatabase::loadRenderers(). |
|
|
Returns the user's current Document directory. There is a trailing "/". .. well, it does now,, and there's no trailing '/' Definition at line 1048 of file qpeapplication.cpp. |
|
|
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 1935 of file qpeapplication.cpp. |
|
|
Reverses the effect of grabKeyboard(). This is called automatically on program exit. Definition at line 1921 of file qpeapplication.cpp. Referenced by ~QPEApplication(). |
|
||||||||||||
|
Causes widget w to receive mouse events according to the stylus mode.
Definition at line 1795 of file qpeapplication.cpp. References QObject::connect(), QObject::destroyed(), QObject::installEventFilter(), and QObject::removeEventFilter(). Referenced by FileSelector::FileSelector(). |
|
|
Returns the current StylusMode for widget w.
Definition at line 1771 of file qpeapplication.cpp. References StylusMode. |
|
||||||||||||
|
Hints to the system that widget w has use for text input methods as specified by mode.
Definition at line 823 of file qpeapplication.cpp. |
|
|
Returns the currently set hint to the system as to whether widget w has any use for text input methods.
Definition at line 802 of file qpeapplication.cpp. References InputMethodHint. |
|
||||||||||||
|
Sets widget mw as the mainWidget() and shows it. For small windows, consider passing TRUE for nomaximize rather than the default FALSE.
Definition at line 1572 of file qpeapplication.cpp. References QApplication::setMainWidget(). |
|
||||||||||||
|
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 1589 of file qpeapplication.cpp. References QApplication::argc(), QApplication::argv(), and QApplication::setMainWidget(). |
|
|
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 1610 of file qpeapplication.cpp. References d, and QObject::inherits(). |
|
|
Returns TRUE if the application will quit after processing the current list of qcop messages; otherwise returns FALSE.
Definition at line 1624 of file qpeapplication.cpp. |
|
|
Reimplemented from QApplication. Definition at line 1943 of file qpeapplication.cpp. References QApplication::exec(), and QApplication::processEvents(). |
|
||||||||||||
|
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)" ) { ... } }
|
|
||||||||||||
|
Reimplemented from QObject. Definition at line 1814 of file qpeapplication.cpp. References QMouseEvent::button(), QKeyEvent::count(), QKeyEvent::isAutoRepeat(), QKeyEvent::key(), QObject::killTimer(), QMouseEvent::pos(), QApplication::postEvent(), QObject::startTimer(), QKeyEvent::state(), StylusMode, and QEvent::type(). |
|
|
Reimplemented from QObject. Definition at line 1887 of file qpeapplication.cpp. References QObject::killTimer(), QApplication::postEvent(), and QTimerEvent::timerId(). |
The documentation for this class was generated from the following files:
