Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

ApplicationLauncher Class Reference
[QtBaseModule]

The ApplicationLauncher class is responsible for fundamental application management and IPC routing within Qtopia. More...

    #include <ApplicationLauncher>

Inherits QObject.

Public Functions

  • QStringList applications () const
  • bool canLaunch ( const QString & app )
  • bool launch ( const QString & app )
  • ApplicationTypeLauncher::ApplicationState state ( const QString & app ) const
  • 29 public functions inherited from QObject

Signals

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 1 public type inherited from QObject
  • 4 static public members inherited from QObject
  • 7 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

The ApplicationLauncher class is responsible for fundamental application management and IPC routing within Qtopia.

The ApplicationLauncher provides a Qt Extended Server Task. Qt Extended Server Tasks are documented in full in the QtopiaServerApplication class documentation.

Note: This class is part of the Qt Extended server and cannot be used by other Qt Extended applications.

Task NameApplicationLauncher
InterfacesApplicationLauncher
ServicesSuspend

IPC and application control are tightly linked in Qtopia. At any level higher than the ApplicationLauncher itself, Qt Extended does not intrinsically understand the notion of "starting" an application. Qt Extended treats an application as a named IPC endpoint that exposes one or more IPC services for use by other applications or the system itself. The named IPC endpoint is known as the application's "application channel".

The primary role of the ApplicationLauncher is to manage a component's ability to receive and respond to service requests. The ApplicationLauncher considers an application "running" when it is able to receive service messages even though the application may not be thought as such by an end user. Management of end user features of an application (such as when the UI is raised or hidden) is done by other system components.

The application launcher framework consists of three primary parts - the application launcher, a series of application type launchers and the application IPC router.

Internally the ApplicationLauncher class has a very basic model of an application - it is something that can be started, stopped and can receive IPC messages. The specifics of process control is handled by pluggable implementers of the ApplicationTypeLauncher interface. By separating the specifics in this way, Qt Extended can easily be adapted to handle foreign applications, such as Java applications, in a seamless and highly integrated fashion.

The ApplicationLauncher also doesn't intrinsically know the specifics of the IPC bus. Instead an implementation of the ApplicationIpcRouter class abstracts the details from it.

When the system attempts to start an application by sending it a message on its application channel, the ApplicationIpcRouter detects the message and asks the ApplicationLauncher to launch the application, by calling the ApplicationLauncher::launch() method. This instructs the ApplicationLauncher to bring the application to a state where it can receive IPC messages.

If the application is not running, the ApplicationLauncher iterates through the ordered list of tasks implementing the ApplicationTypeLauncher interface. Each task is asked if it can launch the application, and if it can, is asked to do so. The ApplicationLauncher monitors the progress of the ApplicationTypeLauncher through Qt signals, which it consolidates and emits to the rest of the Qt Extended server.

Once the application is ready to receive messages, the ApplicationTypeLauncher informs the router by invoking the ApplicationIpcRouter::addRoute() method, passing an implementation of the ApplicationIpcRouter::RouteDestination interface. This call instructs the IPC Router to forward messages to the application through the ApplicationIpcRouter::RouteDestination. All queued messages will be delivered at this time.

How the ApplicationIpcRouter::RouteDestination implementation (usually the ApplicationTypeLauncher) handles delivery of the message is up to it. This allows more advanced ApplicationTypeLauncher implementations - such as a Java application type launcher - to adapt Qt Extended service messages into a form suitable for the application type they manage. For example, while Qt Extended uses a "raise()" message sent to an application's application channel to cause it to show its main UI, a Java application that has no notion of Qt Extended messages will need to have this message transformed appropriately.

To summarize,

ComponentClassFunctionality
Application LauncherApplicationLauncherManages ApplicationTypeLauncher instances and maintains a consolidated view of applications. Other components within the server may use the ApplicationLauncher to monitor application state, but must remember that this state only represents an applications ability to receive IPC messages, and not necessarily user visible information such as whether the application is visible.
Application Type LaunchersApplicationTypeLauncherHandles the specifics of different types of applications and launching mechanisms on behalf of the ApplicationLauncher. Other components within the server should never need to access these instances directly.
Application Ipc RouterApplicationIpcRouterAbstracts the IPC transport used for application messages from the ApplicationLauncher. On reception of an application message, instructs the ApplicationLauncher to start the application and subsequently delivers messages to ApplicationTypeLauncher instances for possible transformation before delivery to the application.


Member Function Documentation

void ApplicationLauncher::applicationNotFound ( const QString & application )   [signal]

Emitted whenever a non-existant application is asked to launch. The corresponding call to launch() will also return false.

void ApplicationLauncher::applicationStateChanged ( const QString & application, ApplicationTypeLauncher::ApplicationState state )   [signal]

Emitted whenever the application state changes to state.

void ApplicationLauncher::applicationTerminated ( const QString & application, ApplicationTypeLauncher::TerminationReason reason, bool filtered = false )   [signal]

Emitted whenever the application terminates. reason will be set to the termination reason. If filtered is true, an ApplicationTerminationHandler instance has filtered the termination.

QStringList ApplicationLauncher::applications () const

Return the list of starting and running applications. The list order represents the order in which the applications were launched.

bool ApplicationLauncher::canLaunch ( const QString & app )

Returns true if application app can be launched. Returns false otherwise. When true is returned, it means an instance of a subclass of ApplicationTypeLauncher instance exists that knows how to launch the application. The subsequent attempt to launch the application may still fail.

Note that true is also returned if app is already running.

bool ApplicationLauncher::launch ( const QString & app )

Attempts to launch application app. Returns true if app is launched successfully. Also returns true if app is already running. Returns false if no launcher can be found that knows how to launch app.

ApplicationTypeLauncher::ApplicationState ApplicationLauncher::state ( const QString & app ) const

Returns the current state of the application, app.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 64
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. La rubrique Qt a besoin de vous ! 1
Page suivante

Le Qt Developer Network au hasard

Logo

Comment créer une fenêtre À propos

Le Qt Developer Network est un réseau de développeurs Qt anglophone, où ils peuvent partager leur expérience sur le framework. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt qtextended4.4
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web