Qtopia Home - Classes - Hierachy - Annotated - Functions - Qt Embedded

Qtopia Application Services

Introduction

Application Services are standardized APIs to functionality supplied by applications. The purpose is to allow applications to invoke the services of other applications, yet allow the end-user to decide which application provides each service.

Requesting Services

To request a service, the calling application executes:

    ServiceRequest srv(servicename, action);
    srv << parameters;
    srv.send();

For example:

    ServiceRequest srv("Email", "writeMail(QString,QString)");
    srv << QString("Johan R. User") << QString("random@trolltech.com");
    srv.send();

ServiceRequest::send() returns a bool value indicating whether the service is available.

Responding to Service Requests

To respond to a service request, an application should connect to the QPEApplication::appMessage() signal.

Applications register as providing a service by supplying a $QPEDIR/services/servicename/appname file, where servicename is both the directory name and the name of the service and appname is the application's executable filename. This file is a standard Qtopia Config file. The keys in this file are:

Adding a New Service

Each service must be very carefully specified since it provides a system wide API that can be invoked by other applications and the user. A service should only be added if it:

To add a new service provide a $QPEDIR/services/servicename.service file, which is a standard Qtopia Config file. The keys in this file are:

Example:

[Translation]
File=QtopiaServices
Context=Calendar
[Service]
Actions = raiseToday();newEvent()
Icon = datebook_icon
Name[]=Calendar
[newEvent()]
Icon = datebook_icon
Name[]=New event
[raiseToday()]
Icon=today
Name[]=Today's calendar

Usually, only one application responds to a given service. The user selects which application handles the service using the Application Services settings. If however, the service can be provided by multiple applications, the service file will contain:

Multiple = 1

in the [Service] section.

Pre-Defined Services

The services below are defined by Trolltech as basic services that may be available on a Qtopia device, and the messages which such services handle.

All services respond to the following messages:

Document Oriented services

The following actions are defined for document oriented services:

EMail services

WebAccess services

PlayMedia services

Contacts services

Calendar services

Tasks services

TimeMonitor services

CleanupWizard services


Copyright © 2001-2005 Trolltech Trademarks
Qtopia version 2.1.1