Home · All Classes · Main Classes · Deprecated |
MApplication manages the GUI application's control flow and main settings. More...
Inherits QApplication.
Signals | |
void | localeSettingsChanged () |
void | prestartReleased () |
void | prestartRestored () |
Public Member Functions | |
MApplication (int &argc, char **argv, const QString &appIdentifier=QString(), MApplicationService *service=0) | |
MApplication (int &argc, char **argv, MApplicationService *service) | |
virtual | ~MApplication () |
virtual void | restorePrestart () |
virtual void | releasePrestart () |
Static Public Member Functions | |
static MApplication * | instance () |
static QString | deviceName () |
static bool | softwareRendering () |
static bool | fullScreen () |
static bool | showBoundingRect () |
static bool | showFps () |
static bool | logFps () |
static bool | showSize () |
static bool | showPosition () |
static bool | showMargins () |
static bool | showObjectNames () |
static bool | showStyleNames () |
static bool | showCursor () |
static bool | emulateTwoFingerGestures () |
static void | setShowPosition (bool show) |
static void | setShowMargins (bool show) |
static void | setShowObjectNames (bool show) |
static void | setShowStyleNames (bool show) |
static void | setShowSize (bool show) |
static void | setShowBoundingRect (bool show) |
static void | setShowFps (bool show) |
static void | setLogFps (bool show) |
static void | setShowCursor (bool show) |
static MApplicationWindow * | activeApplicationWindow () |
static MWindow * | activeWindow () |
static QList< MWindow * > | windows () |
static QString | appName () |
static QString | binaryName () |
static MFeedbackPlayer * | feedbackPlayer () |
static bool | isLoadMInputContextEnabled () |
static void | setLoadMInputContext (bool enable) |
static void | setPrestartMode (M::PrestartMode mode) |
static M::PrestartMode | prestartMode () |
static bool | isPrestarted () |
static void | setPrestarted (bool enable) |
static void | stdExit (int status) |
Protected Member Functions | |
MApplication (MApplicationPrivate &dd, int &argc, char **argv, const QString &appIdentifier=QString()) | |
Protected Attributes | |
MApplicationPrivate *const | d_ptr |
MApplication manages the GUI application's control flow and main settings.
The MApplication instance automatically extracts the application name from the arguments given in the constructor. It also loads the CSS stylesheet and the SVG file and adds application specific image paths to the pixmap search paths used by the current MTheme instance.
CSS and SVG files are searched for in order from the following places:
When the first instance of the CSS or SVG file is found, it is loaded to the current MTheme. Also the image subdirectory of each of the aforementioned paths is appended to the pixmap search paths used by MTheme.
MApplication will also create a QDBus service with a name made by prepending 'com.nokia.' to the application name provided in the constructor (or the binary name if no name is provided in the constructor). Due to this, the application name can't contain characters not allowed by dbus. The service will provide an interface called MApplicationIf which calls service methods in an instance of MApplicationService. By default, MApplication will construct an instance of MApplicationService, but the application programmer can derive a class from MApplicationService and provide a pointer to that in the constructor for MApplication to use instead. This way, the application programmer can override the methods in MApplicationService and change the behaviour of the application's interface.
The default behaviour is to only allow a single instance of any application. When an application is launched, it attempts to register itself as a DBUS service (as above). Only the first instance of the application will be successful, and subsequent attempts will fail. When DBUS registration fails, the default behaviour is to call the first instance's MApplicationService launch() method, and then quit. This causes the first instance to become visible (raises the window).
If other behaviour is required, for example if you want multiple instances of an application, then it is necessary to derive a class from MApplicationService and override its methods.
Notice that it is not supported to create, delete and again create an MApplication instance in the same program.
MApplication::MApplication | ( | int & | argc, | |
char ** | argv, | |||
const QString & | appIdentifier = QString() , |
|||
MApplicationService * | service = 0 | |||
) |
Initializes the window system and constructs an application object.
argc | number of arguments passed to the application from the command line | |
argv | argument strings passed to the application from the command line | |
appIdentifier | an optional identifier for the application. Can contain alphabetical characters, numbers, dashes and underscores. If an empty string is given (the default) the application binary file name is used. |
MApplication::MApplication | ( | int & | argc, | |
char ** | argv, | |||
MApplicationService * | service | |||
) |
MApplication::~MApplication | ( | ) | [virtual] |
Cleans up any window system resources that were allocated by this application.
MApplication::MApplication | ( | MApplicationPrivate & | dd, | |
int & | argc, | |||
char ** | argv, | |||
const QString & | appIdentifier = QString() | |||
) | [protected] |
MApplicationWindow * MApplication::activeApplicationWindow | ( | ) | [static] |
Returns the currently active application window.
MWindow * MApplication::activeWindow | ( | ) | [static] |
Returns the currently active window.
Reimplemented from QApplication.
QString MApplication::appName | ( | ) | [static] |
Returns the application's app name.
QString MApplication::binaryName | ( | ) | [static] |
Returns the application's binary name.
QString MApplication::deviceName | ( | ) | [static] |
Target device name.
bool MApplication::emulateTwoFingerGestures | ( | ) | [static] |
Emulate two finger gestures.
MFeedbackPlayer * MApplication::feedbackPlayer | ( | ) | [static] |
Returns object which provide interface for nonvisual feedback or NULL.
bool MApplication::fullScreen | ( | ) | [static] |
Full screen command line option set.
MApplication * MApplication::instance | ( | ) | [static] |
Returns a pointer to the application's MApplication instance. If no instance has been allocated, null is returned.
bool MApplication::isLoadMInputContextEnabled | ( | ) | [static] |
Returns whether automatic loading of MInputContext is enabled.
bool MApplication::isPrestarted | ( | ) | [static] |
Return true if application is in the prestarted state.
true
if application is in the prestarted state. void MApplication::localeSettingsChanged | ( | ) | [signal] |
Signal emitted when the default system locale changes.
bool MApplication::logFps | ( | ) | [static] |
Log frame rate command line option set.
M::PrestartMode MApplication::prestartMode | ( | ) | [static] |
Return the current prestart mode.
void MApplication::prestartReleased | ( | ) | [signal] |
Signal that is emitted when the application has been released from the prestarted state. Next the application should show a window.
void MApplication::prestartRestored | ( | ) | [signal] |
Signal that is emitted when the application has been restored to the prestarted state.
void MApplication::releasePrestart | ( | ) | [virtual] |
Called when MApplication is released from the prestarted state. Effectively this method just shows MApplication::activeWindow(). Does nothing by default if multi-windowed prestart is selected. Re-imp this if desired.
void MApplication::restorePrestart | ( | ) | [virtual] |
Called when MApplication returns to prestarted state (if supported by the mode). Hides all windows by default. Re-imp this if desired.
void MApplication::setLoadMInputContext | ( | bool | enable | ) | [static] |
Sets whether MApplication should automatically load m input context.
void MApplication::setLogFps | ( | bool | show | ) | [static] |
Enables or disables logging of frames.
void MApplication::setPrestarted | ( | bool | enable | ) | [static] |
Manually release/restore the application from/to the prestarted state. Multi-window applications may need this if they want to show some specific window using some other D-Bus service than MApplicationService. This triggers corresponding signals and handlers if the state changes.
enable | If set to true, prestart is restored if lazy shutdown selected. If set to false, prestart is released (equals to MApplicationService::lauch()). |
void MApplication::setPrestartMode | ( | M::PrestartMode | mode | ) | [static] |
Select the prestart mode.
mode | Prestart mode |
void MApplication::setShowBoundingRect | ( | bool | show | ) | [static] |
Sets if bounding rects of widgets should be shown or not.
void MApplication::setShowCursor | ( | bool | show | ) | [static] |
Sets if the cursor should be shown or not.
void MApplication::setShowFps | ( | bool | show | ) | [static] |
Sets if a frames-per-second counter should be shown or not.
void MApplication::setShowMargins | ( | bool | show | ) | [static] |
Sets if margins of widgets should be shown or not.
void MApplication::setShowObjectNames | ( | bool | show | ) | [static] |
Sets if names of objects should be shown or not.
void MApplication::setShowPosition | ( | bool | show | ) | [static] |
Sets if position of widgets should be shown or not.
void MApplication::setShowSize | ( | bool | show | ) | [static] |
Sets if sizes of widgets should be shown or not.
void MApplication::setShowStyleNames | ( | bool | show | ) | [static] |
Sets if names of styles should be shown or not.
bool MApplication::showBoundingRect | ( | ) | [static] |
Show bounding rectangles command line option set.
bool MApplication::showCursor | ( | ) | [static] |
Show cursor.
bool MApplication::showFps | ( | ) | [static] |
Show frame rate command line option set.
bool MApplication::showMargins | ( | ) | [static] |
Show widgets margins.
bool MApplication::showObjectNames | ( | ) | [static] |
Show object names.
bool MApplication::showPosition | ( | ) | [static] |
Show widgets positions.
bool MApplication::showSize | ( | ) | [static] |
Show widgets sizes.
bool MApplication::showStyleNames | ( | ) | [static] |
Show style names.
bool MApplication::softwareRendering | ( | ) | [static] |
Software rendering command line option set.
void MApplication::stdExit | ( | int | status | ) | [static] |
Returns a list of all windows in the application.
MApplicationPrivate* const MApplication::d_ptr [protected] |
Copyright © 2010 Nokia Corporation | MeeGo Touch |