![]() Qtopia Home - Classes - Hierachy - Annotated - Functions - Licenses - Reference |
![]() |
Application Services are standardized APIs to functionality supplied by applications. They allow applications to invoke the services of other applications, while allowing the specific application providing the service to be selected by the system integrator or end-user.
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.
To respond to a service request, an application should connect to the QPEApplication::appMessage() signal.
Applications register as providing a service by supplying a standard Qtopia configuration file,
$QPEDIR/services/ The standard keys in this file are:
An integer. 100 should be interpreted as Version 1.00.
Later versions of a service may support additional actions.
Additional actions to those defined by the basic (standard) service.
For each entry in the Actions list above, there is
a group defining properties of the action.
Each service must be carefully specified as 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 standard Qtopia configuration file, $QPEDIR/services/<servicename>.service
The keys in this file are:
This is a list of actions separated by semicolon (;). The actions
include any formal parameters in parantheses, including the case
of no parameters.
For each entry in the Actions list above, there is
a group defining properties of the action.
An action with no parameters will appear in the list of available actions
in the button settings. There is no need to add this section if
the action has parameters and will not be shown to the user.
For example:
Usually, only one application responds to a given service. The user selects
which application handles the service using the Application
Services settings. If the service can be provided by multiple
applications, the service file will contain:
The servicename of a service may contain '/', indicating that the
service is actually an hierarchy of services. For example, the
SetValue/v-card service is used to set v-card values, but the service
is structured such that other SetValue services follow the same
general protocol.
This section defines the Trolltech basic services available on a Qtopia device:
Each of the basic services responds to the following messages:
A list of services ordered by message name is available at: Service Overview and the following additional services are described in the sections below:
The following actions are defined for document-
oriented services:
In response to this message, the WebAccess service retrieves the
resource specified by the URL and either displays it to the user,
invokes further services to display the resource, or notifies the
user that no facility exists for displaying the resource.
If the resource cannot be retrieved, the WebAccess notifies the user.
In response to this message, the WebAccess service retrieves the
resource specified by the URL, creates a document containing the
resource. If services exist to display the document, the
WebAccess service gives the user the option to display the document.
If the resource cannot be retrieved, the WebAccess notifies the user.
In response to this message, the WebAccess service retrieves the
resource specified by the URL, creates a document containing the
resource using the given doclnk as the document link file. The
document is created even if the resource could not be retrieved.
As a result of creating the document, Qtopia sends the
QPE/System linkChanged(QString) message, with the doclnk as the
argument.
The following actions are defined for WAP
Push and Over-The-Air (OTA) > Services:
WAP push services are registered by either MIME type or port number.
MIME type services are named Push/T where T is the MIME type.
For example, messages of type application/vnd.wap.connectivity-wbxml are
handled by a service called Push/application/vnd.wap.connectivity-wbxml.
Port number services are named smsapp/N where N is the port
number in decimal.
The file may contain any additional sections, keys and values as
defined by the documentation of the service.
Adding a New
[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
Multiple = 1
in the [Service] section.
Advanced
Pre-Defined Services
Note: Sending the quit() message when a service is not started will start the service and immediately
terminate it.
Document-Oriented Services
The service should delete the file after reading it.
WebAccess Services
WAP Push and Over-The-Air (OTA) Services
Copyright © 2005 Trolltech
Trademarks