summaryrefslogtreecommitdiffstats
path: root/doc/src
diff options
context:
space:
mode:
authorabcd <qt-info@nokia.com>2010-04-30 10:59:05 +1000
committerabcd <qt-info@nokia.com>2010-04-30 10:59:05 +1000
commitedf5945a07a15d1e9f50ee4ed33e32fa3ebb796d (patch)
tree2a2e33ff3cde2e50ca0fb9722eaee5a33adce507 /doc/src
parentf1cdf42293023c54002a3637ef2bb4bb731d8b48 (diff)
parent5f5434cd5f647f4009f7010a0e05f9e5f8ec1c20 (diff)
Merge branch '1.1-plugins' into 1.1-mapsintegrate
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/bearermanagement.qdoc69
-rw-r--r--doc/src/contacts.qdoc384
-rw-r--r--doc/src/contactsasync.qdoc179
-rw-r--r--doc/src/contactsschema.qdoc66
-rw-r--r--doc/src/contactssync.qdoc275
-rw-r--r--doc/src/contactsusage.qdoc319
-rw-r--r--doc/src/examples.qdoc16
-rw-r--r--doc/src/examples/bluetoothtransferplugin.qdoc13
-rw-r--r--doc/src/examples/declarative-sfw-dialer.qdoc (renamed from doc/src/examples/declarative.qdoc)110
-rw-r--r--doc/src/examples/declarative-sfw-notes.qdoc103
-rw-r--r--doc/src/examples/filemanagerplugin.qdoc18
-rw-r--r--doc/src/examples/notesmanagerplugin.qdoc51
-rw-r--r--doc/src/examples/qmlcontacts.qdoc (renamed from doc/src/examples/incomingcalls.qdoc)32
-rw-r--r--doc/src/examples/quickstart.qdoc53
-rw-r--r--doc/src/examples/samplephonebook.qdoc79
-rw-r--r--doc/src/examples/sfw-notes.qdoc55
-rw-r--r--doc/src/examples/sysinfo.qdoc103
-rw-r--r--doc/src/examples/undocumented.qdoc14
-rw-r--r--doc/src/future.qdoc9
-rw-r--r--doc/src/images/Rotation_angles.pngbin0 -> 21599 bytes
-rw-r--r--doc/src/images/sample-phonebook-1.pngbin0 -> 15113 bytes
-rw-r--r--doc/src/images/sample-phonebook-2.pngbin0 -> 44359 bytes
-rw-r--r--doc/src/images/sample-phonebook-3.pngbin0 -> 11758 bytes
-rw-r--r--doc/src/images/sample-phonebook-4.pngbin0 -> 14265 bytes
-rw-r--r--doc/src/images/sysinfo.pngbin0 -> 35304 bytes
-rw-r--r--doc/src/index.qdoc232
-rw-r--r--doc/src/installation.qdoc24
-rw-r--r--doc/src/legal/gpl.qdoc17
-rw-r--r--doc/src/legal/licenses.qdoc495
-rw-r--r--doc/src/location.qdoc6
-rw-r--r--doc/src/messaging.qdoc20
-rw-r--r--doc/src/multimedia.qdoc12
-rw-r--r--doc/src/preview.qdoc9
-rw-r--r--doc/src/publ-subs.qdoc24
-rw-r--r--doc/src/qt.index14
-rw-r--r--doc/src/qtmobility-known-issues.qdoc4
-rw-r--r--doc/src/sensors.qdoc68
-rw-r--r--doc/src/sf.qdoc10
-rw-r--r--doc/src/si.qdoc17
-rw-r--r--doc/src/snippets/code/doc_src_gpl.qdoc720
-rw-r--r--doc/src/snippets/code/doc_src_licenses.qdoc149
-rw-r--r--doc/src/snippets/multimedia-snippets/player.cpp8
-rw-r--r--doc/src/snippets/qtcontactsdocsample/qtcontactsdocsample.cpp346
-rw-r--r--doc/src/snippets/qtcontactsdocsample/qtcontactsdocsample.pro21
-rw-r--r--doc/src/snippets/qtcontactsdocsample/qtcontactsdocsampleasync.cpp315
-rw-r--r--doc/src/snippets/qtcontactsdocsample/requestexample.h42
-rw-r--r--doc/src/snippets/qtversitdocsample/qtversitdocsample.cpp345
-rw-r--r--doc/src/snippets/qtversitdocsample/qtversitdocsample.pro27
-rw-r--r--doc/src/snippets/sensors/creating.cpp66
-rw-r--r--doc/src/snippets/sensors/main.cpp46
-rw-r--r--doc/src/snippets/sensors/mybackend.h61
-rw-r--r--doc/src/snippets/sensors/plugin.cpp69
-rw-r--r--doc/src/snippets/sensors/sensors.pro13
-rw-r--r--doc/src/snippets/sensors/start.cpp61
-rw-r--r--doc/src/snippets/snippets.pro3
-rw-r--r--doc/src/versit.qdoc58
56 files changed, 3124 insertions, 2126 deletions
diff --git a/doc/src/bearermanagement.qdoc b/doc/src/bearermanagement.qdoc
index 968551d2a6..7c654c4d4d 100644
--- a/doc/src/bearermanagement.qdoc
+++ b/doc/src/bearermanagement.qdoc
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -59,6 +59,12 @@ access points.
\tableofcontents
+\section1 Namespace
+
+The QtMobility API's are placed into the \i{QtMobility} namespace. This is done
+to facilitate the future migration of Mobility API's into Qt. See the
+\l {Quickstart Example}{Quickstart guide} for an example on how the
+namespace impacts on application development.
\section1 Overview
@@ -69,14 +75,14 @@ to start, stop network interfaces and influences other connection specific
details. Depending on the platform's capabilities it may even provide
session management so that a network interface remains up for as long as
clients have a registered interest in them while at the same time
-optimizes the interface's uptime.
+optimizes the interface's uptime.
-This API is a key enabler for HTTP level roaming in
+This API is a key enabler for HTTP level roaming in
\l {QNetworkAccessManager}{QNetworkAccessManager}.
This API does not provide support for management of network configurations
themselves. It is up to the platform to provide infrastructure which
-enables to user to create, edit or delete network configurations.
+enables to user to create, edit or delete network configurations.
\section2 The API in Detail
@@ -86,7 +92,7 @@ how a particular network interface is started. One of the most simplistic
examples might be an Ethernet configuration that links a network card to a
DHCP server. A more complex example might be a Wireless LAN configuration
which may comprise of hardware details such as the WLAN card address,
-WLAN access point details (e.g ESSID, encryption details) and user specific
+WLAN access point details (e.g ESSID, encryption details) and user specific
information (for example username and password). Once the network interface
was configured and started according to the configuration blue print,
multiple applications are free to use this link layer connection/session
@@ -95,13 +101,13 @@ only provides limited information about the configuration details themselves.
It's main purpose is to act as a configuration identifier through which link
layer connections can be created, destroyed and monitored.
-QNetworkSession provies two types of use cases. It enables the monitoring of
+QNetworkSession provides two types of use cases. It enables the monitoring of
physical network interfaces and management of network sessions. Network sessions
are a common feature on mobile devices where multiple applications
can request network sessions as they see fit. The system consolidates and tracks
-active network sessions for the same network interface by maintaining the link
+active network sessions for the same network interface by maintaining the link
layer connections until the last session has been closed. The subsequent table
-lists the major QNetworkSession functions and how they fit into the session and
+lists the major QNetworkSession functions and how they fit into the session and
hardware management categories:
\table 60%
@@ -117,12 +123,12 @@ hardware management categories:
\row \o \o QNetworkSession::closed()
\endtable
-The state of the session represents the state of the underlying access point
-whereas the session's openess implies the networking/connectivity state available
+The state of the session represents the state of the underlying access point
+whereas the session's openness implies the networking/connectivity state available
to the current process.
Possible use cases for interface management are network management related
-applications which intend to monitor the connetivity state but do not engage
+applications which intend to monitor the connectivity state but do not engage
in network communication themselves. Any application wanting to open a socket
to a remote address will typically use session management related functionality.
@@ -154,7 +160,7 @@ which implies children can only be of type \l {QNetworkConfiguration::InternetAc
Most systems allow the user to define the systems default configuration.
Usually the default behavior is either a service network, a particular
-internet access point or the user instructs the platform to ask the user
+Internet access point or the user instructs the platform to ask the user
once an application requests the network. User interaction is generally
implemented by some sort of system dialog which shows up at the appropriate
point in time. The application does not have to handle the user input. This
@@ -164,32 +170,27 @@ a quick way how an application can quickly create a new network session
without (or only minimal) user interaction:
\code
+ // Set Internet Access Point
QNetworkConfigurationManager manager;
- const bool canStartIAP = (manager.capabilities() & QNetworkConfigurationManager::BearerManagement);
+ const bool canStartIAP = (manager.capabilities()
+ & QNetworkConfigurationManager::CanStartAndStopInterfaces);
+ // Is there default access point, use it
QNetworkConfiguration cfg = manager.defaultConfiguration();
- if (!cfg.isValid() || !canStartIAP)
+ if (!cfg.isValid() || (!canStartIAP && cfg.state() != QNetworkConfiguration::Active)) {
+ QMessageBox::information(this, tr("Network"), tr(
+ "No Access Point found."));
return;
- switch(cfg.type()) {
- case QNetworkConfiguration::InternetAccessPoint:
- // no user interaction -> system starts IAP immediately
- break;
- case QNetworkConfiguration::ServiceNetwork:
- // no user interaction -> system determines best IAP in group and starts it
- break;
- case QNetworkConfiguration::UserChoice:
- // automatic IAP resolution by system or by asking user as
- // part of QNetworkSession::open() call
- break;
}
- QNetworkSession* session = new QNetworkSession(cfg);
- session->open();
+ session = new QNetworkSession(cfg, this);
+ session->open();
+ session->waitForOpened(-1);
\endcode
To accommodate the "Ask user" use case the default configuration can be of
type QNetworkConfiguration::UserChoice. A user choice configuration is
resolved as part of the \l {QNetworkSession::open()} call. Note that a
-\l{QNetworkConfiguration::UserChoice}{UserChoice} configuration is only
+\l{QNetworkConfiguration::UserChoice}{UserChoice} configuration is only
ever returned via \l {QNetworkConfigurationManager::defaultConfiguration()}
and not \l QNetworkConfigurationManager::allConfigurations().
@@ -202,7 +203,7 @@ implement a custom dialog which is populated based on what
\section3 Managing network sessions
A QNetworkSession object separates a \l {QNetworkSession::state()}{state()}
-and an \l{QNetworkSession::isOpen()}{isOpen()} condition.
+and an \l{QNetworkSession::isOpen()}{isOpen()} condition.
The state() attribute enables developers to detect whether the system
currently maintains a global network session for the given
@@ -240,7 +241,7 @@ Roaming is the process of reconnecting a device from one network to another
while minimizing the impact on the application. The system notifies the application
about link layer changes so that the required preparation can be taken.
The most common reaction would be to reinitialize sockets and to renegotiate
-statefull connections with other parties. In the most extreme cases applications
+stateful connections with other parties. In the most extreme cases applications
may even prevent the roaming altogether.
Roaming is initiated when the system determines that a more appropriate access point
@@ -266,7 +267,7 @@ QNetworkSession is the central class for managing roaming related issues.
Some API features are not available on all platforms. The
\l QNetworkConfigurationManager::Capability should be used to detect
platform features at runtime. The following table lists the various
-platform API's being used by this API. This may assist in the process of
+platform APIs being used by this API. This may assist in the process of
determining the feature support:
\table
@@ -290,7 +291,8 @@ determining the feature support:
\o This platform enjoys the most comprehensive feature set. In addition to the features support by the S60 3.1 Network roaming is supported.
\row
\o Mac OS\unicode{0xAE}
- \o This platform has full support by way of CoreWLAN offered in Mac OS 10.6. Previous versions of Mac OS - 10.5 and 10.4 have limited support.
+ \o This platform has full support by way of CoreWLAN offered in Mac OS 10.6. Previous
+ versions of Mac OS - 10.5 and 10.4 have limited support.
\row
\o All other platforms (*nix, Windows Mobile)
\o This backend is the fallback for all platforms supports network interface notifications via active polling only.
@@ -299,7 +301,8 @@ determining the feature support:
\section1 Examples
\section2 Bearer Cloud Example
-The \l {bearercloud}{Bearer Cloud} example graphically represents the available access points to various networks and their sytlized distance from the user.
+The \l {bearercloud}{Bearer Cloud} example graphically represents the available access points to
+various networks and their respective configuration state.
\section2 Bearer Monitor Example
The \l{bearermonitor}{Bearer Monitor} displays various networks or services by status and configuration.
diff --git a/doc/src/contacts.qdoc b/doc/src/contacts.qdoc
index d097f581d4..927e171ee5 100644
--- a/doc/src/contacts.qdoc
+++ b/doc/src/contacts.qdoc
@@ -69,10 +69,46 @@ applications.
\section1 Overview
-A contact is the digital representation of a person, group or entity,
-which is stored in a platform-specific manner. Information pertaining to a
-single contact may be located across several different datastores, and each
-datum (or detail) may or may not pertain to a particular context in which
+The QtMobility API's are placed into the \i{QtMobility} namespace. This is done
+to facilitate the future migration of Mobility API's into Qt. See the
+\l {Quickstart Example}{Quickstart guide} for an example on how the
+namespace impacts on application development.
+
+Contact information is stored in datastores whose functionality is exposed
+via a \l{QContactManager}{manager}. The Contacts API models a
+\l{QContact}{contact} as a collection of distinct details. Each
+\l{QContactDetail}{detail} conforms to a particular
+\l{QContactDetailDefinition}{definition} (or template), which may be
+extensible or otherwise modifiable by clients. Individual contacts may be
+related to one other, and these \l{QContactRelationship}{relationships} are
+stored separately from contacts themselves and may be manipulated directly by
+clients.
+
+\l{QContact}{Contact}, \l{QContactDetailDefinition}{detail definition}, and
+\l{QContactRelationship}{relationship} information may all be
+retrieved, modified or deleted by clients using either
+\l{Contacts Asynchronous API}{synchronous} or
+\l{Contacts Asynchronous API}{asynchronous} API.
+
+\section1 Client-Facing API
+
+The client-facing API allows retrieval, modification and deletion of contacts,
+detail definitions and relationships, and access to manager meta data and
+capability reporting.
+
+\section2 Container Classes
+
+Contact information is stored in container (value) classes. These classes
+are not derived from QObject, and hence can be used in lists, do not have
+parents, do not emit signals, and so on. They represent data which may be
+manipulated and retrieved from a \l{Manager}{manager}.
+
+\section3 Contact
+
+A \l{QContact}{contact} is the digital representation of a person, group or
+entity, which is stored in a platform-specific manner. Information pertaining
+to a single contact may be located across several different datastores, and
+each datum (or detail) may or may not pertain to a particular context in which
that information is valid. A contact may include semantically identical
pieces of information that are relevant in different contexts. For
example, a contact may have a phone number that is relevant to their "home"
@@ -83,177 +119,183 @@ information in a given context can be considered equivalent to a "contextual
identity". This allows great flexibility when consolidating data from
various sources into a single, cohesive contact.
-Each datum (or detail) stored in a contact has defined semantics of usage
-and storage. The Qt Contacts API allows per-datastore contact detail
-definitions, allowing a manager to provide clients with this information on
-demand, and allowing third-party developers to register detail definitions
-for use by clients. A detail definition includes the fields (and value-types
-of those fields) which make up the detail, per-contact uniqueness constraints on
-details of the definition, and access constraints (such as read-only,
-create-only, etc). Additionally, the fields of a detail definition may
-also be constrained to be read-only or not.
-
-A detail is a single, cohesive unit of information that is stored in a
-contact. As explained previously, it is valid for a particular context or
-set of contexts, and conforms to a particular definition. A detail may have
-specific metadata associated with it, such as its sub-type, context, and
-arbitrary, user-defined metadata.
-
-Contacts may participate in relationships with other contacts. The details
-of any such relationship is stored by the manager which contains the contact.
-There are several standard relationship types supported by the default
-schema, and arbitrary relationship types are also allowed. In particular,
-membership of a contact in a group can be modeled as that group contact
-participating in a \c HasMember relationship with the contact.
-
-Access to the contacts is provided by implementations of the Qt Contacts
-manager API. A manager provides access to zero or more platform-specific
-datastores. Each datastore may support different capabilities (for example,
-the ability to store certain datatypes, the ability to natively filter on
-different details or details of different definitions, the provision of
-locking mechanisms, the provision of changelog information, etc) which are
-reported by the manager on request. The manager therefore provides access to
-detail definitions, contacts, and relationships stored in different datastores,
-in a platform and datastore independent manner. The engine of a manager may
-be implemented as a plugin to allow dynamic loading of different engines at
-run-time.
-
-\section1 Using the API
-
-This section provides some examples of common usage of the API.
-
-\section2 Synchronous API Usage
-
-The synchronous API provides the simplest way to access or modify the
-contact information managed by a particular backend. It has the
-disadvantage that calls block until completion and is therefore
-most suitable only for applications which interact with local, high-speed
-datastores.
-
-\section3 Saving a new contact to the default manager
-
-The client creates a new contact, adds a name and a phone number, and
-saves it to the default store of the default manager.
-
-We assume the existence of a specialised leaf-class that allows simple
-access to details of the definition identified by the "PhoneNumber"
-identifier, and another that allows simple access to details of the
-definition identified by the "Name" identifier. These specialised leaf
-classes may be written by anyone, and simply wrap the functionality
-provided by QContactDetail in order to allow simpler access to fields
-supported by a particular definition.
-
- \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Creating a new contact
-
-\section3 Filtering by detail definition and value
-
-The client utilises a default manager and asks for any contacts with a
-particular phone number. The example assumes that the default manager
-supports the provided QContactPhoneNumber detail leaf class (which
-implements the default definition for phone number details).
-
- \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Filtering by definition and value
-
-\section3 Viewing a specific detail of a contact
-
-The client retrieves the phone numbers of a contact, and displays the first
-one
-
- \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Viewing a specific detail of a contact
-
-\section3 Viewing all of the details of a contact
-
-The client retrieves all of the details of a contact, and displays them
-
- \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Viewing the details of a contact
-
-It is important to note that details are implicitly shared objects with particular
-semantics surrounding saving, removal and modification. The following example
-demonstrates these semantics
-
- \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Demonstration of detail sharing semantics
-
-\section3 Installing a plugin that modifies the definition of one type of detail
-
-The client installs a plugin, which requires a new field to be added to
-details of the "EmailAddress" definition. It loads the definition from the
-default manager, modifies it (by adding the new field - a label field), and
-saves it back.
-
- \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Installing a plugin which modifies a definition
-
-\section3 Modifying an existing contact and saving the modifications
+Each contact stored in a manager is identified by an \l{QContactId}{id} which
+consists of a manager identifier (URI) and the
+\l{QContactLocalId}{manager-local id} which is used to identify the contact
+in that manager. Note that a contact stored in one manager may have the same
+local id as a different contact stored in another manager; please see the
+QContactId documentation for more information.
+
+\section3 Detail
+
+A \l{QContactDetail}{detail} is a single, cohesive unit of information that is
+stored in a contact. As explained previously, it is valid for a particular
+context or set of contexts, and conforms to a particular definition. A detail
+may have specific metadata associated with it, such as its sub-type, context,
+and arbitrary, user-defined metadata, as well as access constraints which may
+apply to the the detail (such as read-only, irremovable, etc).
+
+There are a number of common details defined in the API which are intended
+for use by clients, as listed \l{"Contact Details" Leaf Classes}{here}.
+
+\section3 Detail Definition
+
+Each detail stored in a contact has defined semantics of usage and storage.
+The Qt Contacts API allows per-datastore contact
+\l{QContactDetailDefinition}{detail definitions}, allowing a manager to
+provide clients with this information on demand, and allowing third-party
+developers to register detail definitions for use by clients. A detail
+definition includes the fields (and value-types of those fields) which make up
+the detail, and per-contact uniqueness constraints on details of the
+definition.
+
+Most clients can safely ignore this class entirely, since they will most
+likely want to use the predefined details listed
+\l{"Contact Details" Leaf Classes}{here}. In some cases, however, a manager
+will not support all of the fields of a particular predefined detail leaf
+class; in that case, it may be necessary for the client to inspect the
+supported detail definition for that leaf class and modify its behaviour
+accordingly (for example, if the \c CustomLabel field of the QContactName
+leaf detail is not supported in a particular manager).
+
+\section3 Relationships
+
+Contacts may participate in \l{QContactRelationship}{relationships} with other
+contacts. The details of any such relationship is stored by the manager which
+contains the contact. There are several standard relationship types supported
+by the default schema, and arbitrary relationship types are also allowed if
+the manager supports that feature. One important relationship is that of
+group membership; membership of a contact in a group can be modeled as that
+group contact participating in a \c HasMember relationship with the contact.
+
+\section2 Manager
+
+Access to contacts is provided by implementations of the Qt Contacts
+\l{QContactManager}{manager} API. A manager provides access to zero or more
+platform-specific datastores. Each datastore may support different
+capabilities (for example, the ability to store certain datatypes, the ability
+to natively filter on different details or details of different definitions,
+the provision of locking mechanisms, the provision of changelog information,
+etc) which are reported by the manager on request. The manager therefore
+provides access to detail definitions, contacts, and relationships stored in
+different datastores, in a platform and datastore independent manner.
+
+\section3 Meta Data API
+
+The API offered by the QContactManager exposes functionality which is
+implemented by plugins. These plugins may be platform specific, and may be
+provided by Nokia or by third party developers. As described above, each
+plugin will have different capabilities and implement the functionality
+exposed by the Contacts API to a different degree.
+
+The QContactManager class provides a static function
+QContactManager::availableManagers() which allows clients of the API to
+determine (at run time) which plugins (managers) are available for use.
+
+Clients of the API also need to be able to determine (at run time) what the
+capabilities of a given plugin (contact manager) are. The QContactManager
+class provides API to query the capabilities of a given manager with the
+following synchronous functions:
+\list
+ \o hasFeature(QContactManager::ManagerFeature feature, const QString& contactType = QContactType::TypeContact) const
+ \o isFilterSupported(const QContactFilter& filter) const
+ \o isRelationshipTypeSupported(const QString& relationshipType, const QString& contactType = QContactType::TypeContact) const
+ \o supportedDataTypes() const
+ \o supportedContactTypes() const
+\endlist
-The client retrieves a contact, modifies one of its details, adds a new
-detail, and then saves the contact back to the manager. Note that it uses
-the newly added field of the email address definition!
+A given manager is identified by its URI. The URI consists of the manager's
+name, any relevant parameters which were used during instantiation of the
+manager, and the version of the manager. While the name of the manager
+identifies the plugin which provides the functionality, you cannot guarantee
+that the data available through one manager will be available through another
+with the same name (for example, if one parameter tells the plugin to store
+and retrieve contact information from a particular online service or local
+file).
+
+The synchronous API offered to allow run-time querying of a manager's metadata
+includes:
+\list
+ \o managerName() const
+ \o managerParameters() const
+ \o managerUri() const
+ \o managerVersion() const;
+ \o (static) parseUri(const QString& uri, QString* managerName, QMap<QString, QString>* params)
+ \o (static) buildUri(const QString& managerName, const QMap<QString, QString>& params, int implementationVersion = -1)
+\endlist
- \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Modifying an existing contact
+The functionality that the above functions provide is only available through
+synchronous API.
-\section2 Asynchronous API Usage
-The asynchronous API provides a flexible and powerful method of accessing
-and modifying the contact information managed by a particular backend in an
-asynchronous manner. Use of the asynchronous API is slightly more complex
-than use of the synchronous API, but offers the programmer greater
-flexibility when requesting information from remote or slow, local
-datastores.
+\section3 Asynchronous API
-\section3 Requesting Contacts
+The asynchronous API provides a way to access or modify the
+contact information managed by a particular backend via non-blocking,
+asynchronous requests. It is recommended for most
+applications that the asynchronous API be used where possible.
-The client sets up a request for contacts matching a specific criteria
-from a particular manager.
+The asynchronous API is offered through various classes derived from the
+QContactAbstractRequest class, including QContactLocalIdFetchRequest,
+QContactFetchRequest, QContactSaveRequest, QContactRemoveRequest,
+QContactDetailDefinitionFetchRequest, QContactDetailDefinitionSaveRequest,
+QContactDetailDefinitionRemoveRequest, QContactRelationshipFetchRequest,
+QContactRelationshipSaveRequest, and QContactRelationshipRemoveRequest.
-Results from the request will be displayed to the user as they are
-received.
+The asynchronous API allows manipulation of \l{QContact}{contacts},
+\l{QContactRelationship}{contact relationships}, and
+\l{QContactDetailDefinition}{schema definitions}, but does not provide manager
+capability or meta data information reporting.
- \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Asynchronous contact request
+For more detailed documentation on the asynchronous API, see the \l{Contacts Asynchronous API}.
-\section3 Other Asynchronous Operations
+\section3 Synchronous API
-All other asynchronous operations are performed in a similar manner to the
-previous example. A request of the desired type (which is derived from
-QContactAbstractRequest) is created, certain criteria are set which
-determine the result of the request, and the progress signal of the request
-is connected to a slot which deals with the result. The request can then
-be started.
+The synchronous API provides the simplest way to access or modify the
+contact information managed by a particular backend. It has the
+disadvantage that calls block the current thread of execution until completion
+and is therefore most suitable only for applications which interact with
+local, high-speed datastores, or for applications which do not require a
+responsive UI.
-Any operation that may be performed using the synchronous API may also be
-performed using the asynchronous API. It is recommended for most
-applications that the asynchronous API be used where possible.
+The synchronous API is offered through the QContactManager class, and includes
+manipulation of \l{QContact}{contacts},
+\l{QContactRelationship}{contact relationships}, and
+\l{QContactDetailDefinition}{schema definitions}. As previously described,
+the meta data reporting and manipulation functions are also provided via
+synchronous API only.
-\section1 Manager Settings And Configuration
+For more detailed documentation on the synchronous API, see the \l{Contacts Synchronous API}.
-Users of the contacts API can define which backend they wish to access if a manager
-for that backend is available. The list of available managers can be queried programmatically at
-run-time, and the capabilities of different managers can be ascertained by inspecting a
-QContactManager instance. Furthermore, some managers can be constructed
-with parameters which affect the operation of the backend.
+\section1 Non-Client-Facing API
-\section2 Loading the manager for a specific backend
+The non-client-facing API allows third party developers to implement a manager
+engine plugin from which clients may request data.
-In this example, the client loads a manager for a specific backend. While
-this could be found and retrieved using a more advanced plugin framework
-(such as the Qt Service Framework), this code assumes that the client has
-prior knowledge of the backend in question.
+\section2 Manager Engine
- \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Loading a specific manager backend
+The functionality exposed by the QContactManager class may be implemented by
+\l{QContactManagerEngine}{engine} plugins which interface directly to a
+platform-specific backend or provide their own data storage backend. As such,
+the terms "manager", "plugin" and "backend" are used interchangeably in this
+documentation to refer to any engine plugin which implements the functionality
+exposed by the QContactManager interface. The plugin architecture allows
+dynamic loading of different manager engines at runtime.
-\section2 Loading a manager with specific parameters
+A manager backend may be implemented by subclassing
+\l{QContactManagerEngine}, and providing a \l{QContactManagerEngineFactory}
+which can instantiate it when required.
-The client loads a manager with specific parameters defined. The
-parameters which are available are backend specific, and so the client had
-to know that the "Settings" parameter was valid for the particular backend,
-and what argument it took. In this example, the client tells the backend to
-load detail definitions saved in a particular settings file.
+\section1 Using the API
- \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Loading a specific manager backend with parameters
+Some examples of common usage of the API may be found
+\l{Contacts API Usage}{here}.
\section1 Building and compiling
-This library requires Qt 4.5 to be installed.
+This library requires Qt 4.6 to be installed.
-To build the library, run \tt qmake and \tt make.
+To build the library, see the Qt Mobility installation instructions.
\section1 Reference documentation
@@ -276,8 +318,10 @@ may have certain constraints, as listed in the \l{Qt Contacts Schema}{schema}.
\section2 Asynchronous Requests
-Clients may use either the synchronous or asynchronous API to access
-functionality provided by a manager backend. The asynchronous API is
+Clients may use either the \l{Contacts Synchronous API}{synchronous}
+or \l{Contacts Asynchronous API}{asynchronous} API to access
+functionality provided by a manager backend. The
+\l{Contacts Asynchronous API}{asynchronous} API is
offered through subclasses of the \l{QContactAbstractRequest} class:
\annotatedlist contacts-requests
@@ -296,46 +340,26 @@ criteria:
A client can also request that the results of such a selection be sorted,
by passing a \l{QContactSortOrder} (or list of sort orders) to the manager.
-\section2 Actions
-
-Clients can perform actions on contacts which support them. Actions are
-things like "Send Email" or "Dial", and can be provided from various
-sources including Qt Plugins or the Qt Mobility Service Framework. Every
-action implementation is uniquely identified by a combination of its name,
-the name of the vendor which provided the implementation, and the version
-of the implementation according to the vendor. These pieces of data may be
-encapsulated in a \l{QContactActionDescriptor} which can be used to
-retrieve an instance of the implementation from a
-\l{QContactActionFactory}.
-
-When an instance of a \l{QContactAction} is created, the caller takes
-ownership of the instance, and must delete it after use.
-
\section2 Implementing Backends
-A manager backend may be implemented by subclassing
-\l{QContactManagerEngine}, and providing a \l{QContactManagerEngineFactory}
-which can instantiate it when required.
-
-\section2 Manager information and functionality reporting
+A backend implementor must implement the following interfaces:
-Different backends have different capabilities and offer different functionality.
-In order to allow clients to query the provided functionality at runtime, every
-backend must be capable of reporting their functionality and implementation version. They are
-reported to clients through various functions provided by the \l{QContactManager} class.
+\annotatedlist contacts-backends
\section2 Synchronization and Serialization
-The contacts API is used by another Qt Mobility module: the \l {Versit API} {Versit}* module. It allows
+The contacts API is used by another Qt Mobility module: the \l {Versit API (technology preview)} {Versit}* module. It allows
serialization of a QContact into a vCard document, and vice versa.
[*] Versit \reg is a trademark of the Internet Mail Consortium.
\section2 Examples
+The following sample applications show examples of API usage:
\list
\o \l{samplephonebook}{Sample Phonebook}
- \o \l{incomingcalls}{Incoming Call Simulator}
+ \o \l{qmlcontacts}{QML-based Sample Phonebook}
\endlist
+See also: \l{Contacts API Usage}
*/
diff --git a/doc/src/contactsasync.qdoc b/doc/src/contactsasync.qdoc
new file mode 100644
index 0000000000..0a47b25354
--- /dev/null
+++ b/doc/src/contactsasync.qdoc
@@ -0,0 +1,179 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+
+\page contactsasync.html
+
+\title Contacts Asynchronous API
+
+\tableofcontents
+
+
+\section1 Introduction
+
+The Contacts Asynchronous API enables a client to asynchronously fetch, update, or remove
+contact, relationship or schema data from a contact manager. Use of the asynchronous API
+offers the programmer greater flexibility when requesting information from remote or
+slow local datastores.
+
+\section1 Using the API
+
+The asynchronous API offered by the Contacts module is available through classes
+derived from the QContactAbstractRequest class. It consists of three major sections:
+\list
+ \o Contact Manipulation
+ \o Relationship Manipulation
+ \o Schema Manipulation
+\endlist
+
+The functionality offered by the synchronous API in these three categories is also
+available through the asynchronous API. There is one category of functionality
+which is not provided by the asynchronous API which is provided by the synchronous
+API: some information and reporting functionality is only provided through the
+synchronous API.
+
+For detailed information about the information and reporting functionality provided,
+please refer to the documentation for the \l{Contacts Synchronous API}.
+
+The functions to set and retrieve the id of the self-contact are also only provided by
+the synchronous API.
+
+\section2 Contact Manipulation
+
+The most common type of operation that clients will perform involves retrieval or modification of contacts.
+For in-depth information about contact manipulation, please refer to the \l{Contacts Synchronous API}.
+
+There are four different types of operation which are supported by the asynchronous API:
+\list
+ \o Fetch contact ids
+ \o Fetch contacts
+ \o Save contacts (create or update)
+ \o Remove contacts
+\endlist
+
+These operations are supported via the QContactLocalIdFetchRequest, QContactFetchRequest,
+QContactSaveRequest and QContactRemoveRequest classes, respectively.
+
+The synchronous API offered by the QContactManager class to allow manipulation of contacts consists
+of the following functions:
+\list
+ \o contactIds(const QList<QContactSortOrder>& sortOrders = QList<QContactSortOrder>()) const
+ \o contactIds(const QContactFilter& filter, const QList<QContactSortOrder>& sortOrders = QList<QContactSortOrder>()) const
+ \o contacts(const QList<QContactSortOrder>& sortOrders = QList<QContactSortOrder>(), const QContactFetchHint& fetchHint = QContactFetchHint()) const
+ \o contacts(const QContactFilter& filter, const QList<QContactSortOrder>& sortOrders = QList<QContactSortOrder>(), const QContactFetchHint& fetchHint = QContactFetchHint()) const
+ \o saveContacts(QList<QContact>* contacts, QMap<int, QContactManager::Error>* errorMap)
+ \o removeContacts(QList<QContactLocalId>* contactIds, QMap<int, QContactManager::Error>* errorMap)
+\endlist
+
+\section3 Relationship Manipulation
+
+Contacts may be related in various ways. The contacts API allows clients to define relationships between contacts.
+For in-depth information about relationship manipulation, please refer to the \l{Contacts Synchronous API}.
+
+There are three different types of operation which are supported by the asynchronous API:
+\list
+ \o Fetch relationships
+ \o Save relationships (create or update, if supported by the backend)
+ \o Remove relationships (if supported by the backend)
+\endlist
+
+These operations are supported via the QContactRelationshipFetchRequest,
+QContactRelationshipSaveRequest and QContactRelationshipRemoveRequest classes respectively.
+
+The synchronous API offered by the QContactManager class to allow manipulation of relationships
+consists of the following functions:
+\list
+ \o relationships(const QContactId& participantId, QContactRelationshipFilter::Role role = QContactRelationshipFilter::Either) const;
+ \o relationships(const QString& relationshipType = QString(), const QContactId& participantId = QContactId(), QContactRelationshipFilter::Role role = QContactRelationshipFilter::Either) const;
+ \o saveRelationship(QContactRelationship* relationship);
+ \o saveRelationships(QList<QContactRelationship>* relationships);
+ \o removeRelationship(const QContactRelationship& relationship);
+ \o removeRelationships(const QList<QContactRelationship>& relationships);
+\endlist
+
+\section2 Schema Manipulation
+
+The schema supported by a plugin is the list of detail definitions which are supported by the plugin.
+For in-depth information about the schema, please refer to the \l{Contacts Synchronous API}.
+
+There are three different types of operation which are supported by the asynchronous API:
+\list
+ \o Fetch detail definitions
+ \o Save detail definitions (create or update, if supported by the backend)
+ \o Remove detail definitions (if supported by the backend)
+\endlist
+
+These operations are supported via the the QContactDetailDefinitionFetchRequest,
+QContactDetailDefinitionSaveRequest and QContactDetailDefinitionRemoveRequest classes,
+respectively.
+
+The synchronous API offered by the QContactManager class to allow manipulation of the schema consists
+of the following functions:
+\list
+ \o detailDefinitions(const QString& contactType = QContactType::TypeContact) const
+ \o detailDefinition(const QString& definitionName, const QString& contactType = QContactType::TypeContact) const
+ \o saveDetailDefinition(const QContactDetailDefinition& def, const QString& contactType = QContactType::TypeContact)
+ \o removeDetailDefinition(const QString& definitionName, const QString& contactType = QContactType::TypeContact)
+\endlist
+
+\section1 Examples Of Usage
+
+\section2 Fetching Contacts
+
+The client sets up a request for contacts matching a specific criteria
+from a particular manager.
+
+Results from the request will be displayed to the user as they are
+received.
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Asynchronous contact request
+
+\section2 Other Asynchronous Operations
+
+All other asynchronous operations are performed in a similar manner to the
+previous example. A request of the desired type (which is derived from
+QContactAbstractRequest) is created, certain criteria are set which
+determine the intent of the request, and the signals of the request
+are connected to slots which deals with the results. The request can then
+be started.
+
+*/
diff --git a/doc/src/contactsschema.qdoc b/doc/src/contactsschema.qdoc
index c0f8907613..eab9d70759 100644
--- a/doc/src/contactsschema.qdoc
+++ b/doc/src/contactsschema.qdoc
@@ -77,16 +77,10 @@ The leaf details that form the default schema are as follows:
\annotatedlist contacts-details
-In the default schema, each of these definitions have various access and uniqueness constraints.
-Additionally, fields of the definitions may have an access constraint of read-only defined for them.
-
\section2 Detail Definition Uniqueness
A uniqueness constraint on a detail definition means that for any \l{QContact}, only one detail of that
-definition may be saved. Generally, it is information for which a contradicting detail would mean
-inability to identify the contact. Please note that some details, such as \l{QContactBirthday} or
-\l{QContactName}, do not have a uniqueness constraint, since in different contexts, different information
-may be valid.
+definition may be saved.
The leaf classes which have a uniqueness constraint in the default schema are as follows:
\list
@@ -96,43 +90,55 @@ The leaf classes which have a uniqueness constraint in the default schema are as
\o \l{QContactGuid}
\endlist
-\section2 Detail Definition Access Constraints
+\section2 Detail Access Constraints
+
+Some details in a contact retrieved from a manager may have access constraints set.
+An access constraint on a detail means that the detail may not be removed (if the access constraint is \c QContactDetail::Irremovable)
+or updated (if the access constraint is \c QContactDetail::ReadOnly) by the client. If the client attempts to save an updated
+version of a read-only detail in a contact, or remove a detail which is irremovable from a contact, the operation will succeed;
+however those updates to the contact will be ignored by the manager when the contact is saved there.
-An access constraint on a detail definition means that for any detail of that definition in a \l{QContact},
-the specified access constraints apply. For example, the \l{QContactDisplayLabel} is defined in the default
-schema as a read-only detail definition; meaning that details of that type in a contact cannot be created, modified or deleted by
-the client, but are provided by the backend (in the case of \l{QContactDisplayLabel}, automatically synthesized
-by the backend from various details of the contact).
+For example, the \l{QContactDisplayLabel} is defined in the default schema as a read-only, irremovable detail,
+meaning that it may not be modified or deleted by the client, but are provided by the backend (in the case
+of \l{QContactDisplayLabel}, automatically synthesized by the backend from various details of the contact, like
+the \l{QContactName}, \l{QContactNickname}, etc).
-There are three possible detail definition-level access constraints: read-only, create-only and no-constraint.
-A read-only constraint ensures that clients cannot create, delete or modify details of that definition; a create-only
-constraint ensures that clients cannot modify details of that definition, but can create them (with whichever
-values they see fit); if no constraint is specified, details of that definition may be created, modified or deleted as required.
+There are three possible detail access constraints: read-only, irremovable and no constraint.
+A read-only constraint ensures that clients cannot modify the values stored in such details in the persistent
+copy of the contact (that is, the contact as it is stored in the manager); the irremovable constaint ensures
+that a particular detail may not be removed by clients. In general, most details which are read only will
+also be irremovable, and vice versa. One exception to this is the \l{QContactType} detail, which is
+irremovable but may be updated by clients as desired.
+Details with no constraint may be added, updated and removed as desired by the client. Changes to such details
+in a contact will be persisted in the manager when the client calls \l{QContactManager::saveContact()}.
-Please see the documentation of \l{QContactDetailDefinition} for more information on access constraints.
+Please see the documentation of \l{QContactDetail} for more information on access constraints.
The leaf classes which have access constraints in the default schema are as follows:
\list
- \o \l{QContactGuid} is \c QContactDetailDefinition::CreateOnly
- \o \l{QContactSyncTarget} is \c QContactDetailDefinition::CreateOnly
- \o \l{QContactTimestamp} is \c QContactDetailDefinition::ReadOnly
- \o \l{QContactDisplayLabel} is \c QContactDetailDefinition::ReadOnly
+ \o \l{QContactGuid} is \c QContactDetail::ReadOnly and \c QContactDetail::Irremovable
+ \o \l{QContactSyncTarget} is \c QContactDetail::ReadOnly and \c QContactDetail::Irremovable
+ \o \l{QContactTimestamp} is \c QContactDetail::ReadOnly and \c QContactDetail::Irremovable
+ \o \l{QContactPresence} is \c QContactDetail::ReadOnly and \c QContactDetail::Irremovable
+ \o \l{QContactDisplayLabel} is \c QContactDetail::ReadOnly and \c QContactDetail::Irremovable
+ \o \l{QContactType} is \c QContactDetail::Irremovable
\endlist
Furthermore, in the default schema, every contact is required to have at least two details by default: a \l{QContactType} which describes
the type of entity that the contact represents (for example, a person or a group), and a \l{QContactDisplayLabel} which holds
the default display label for the contact.
-\section2 Field Access Constraints
+\section2 Backend-provided Details
-Furthermore, some fields of some definitions are also constrained to be read-only. This is information which is generated or automatically
-provided by the backend, which is related to user-provided information that is also stored in the detail.
+As described in the section on detail access constraints, some details are provided by the backend,
+such as \l{QContactDisplayLabel} and \l{QContactPresence}. When the client attempts to save a \l{QContact}
+that contains these details, these details will be ignored by the backend (since any values in this field
+are synthesized by the backend). This means that while clients may (for example) add a
+\l{QContactPresence} detail to a \l{QContact}, it will not be persisted in the manager when the
+client attempts to save that contact.
-The eponymous example of this is the \l{QContactOnlineAccount} leaf detail, which has unconstrained fields which store the URI and service
-provider of the account, and several read-only fields in which are stored presence information, status messages, and service availability.
+Precisely which details are backend-provided is backend specific; some backends provide more details
+than others.
-Currently, the \l{QContactOnlineAccount} is the only leaf detail with field-level access constraints. Every field in details of this
-type are \c QContactDetailDefinition::ReadOnly except for \c QContactOnlineAccount::FieldAccountUri and
-\c QContactOnlineAccount::FieldServiceProvider, which have no constraint.
*/
diff --git a/doc/src/contactssync.qdoc b/doc/src/contactssync.qdoc
new file mode 100644
index 0000000000..fb80655b49
--- /dev/null
+++ b/doc/src/contactssync.qdoc
@@ -0,0 +1,275 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+
+\page contactssync.html
+
+\title Contacts Synchronous API
+
+\tableofcontents
+
+
+\section1 Introduction
+
+The Contacts Synchronous API enables a client to synchronously fetch, update, or remove
+contact data from a contact manager. A synchronous API is of most use to clients who wish
+to perform simple requests where performance or UI responsiveness is not critical.
+Synchronous calls to a contact manager will block until they are completed, and therefore
+should not be performed in the GUI thread if the manager is a frontend to an online service
+or long-latency datastore. The main advantage of the synchronous API is its simplicity and
+convenience.
+
+Most operations which may be performed using the synchronous API may also be
+performed using the asynchronous API. It is recommended for most
+applications that the asynchronous API be used where possible.
+
+
+\section1 Using The API
+
+The synchronous API offered by the Contacts module is available through the QContactManager
+class. It consists of four major sections:
+\list
+ \o Error Reporting
+ \o Schema Manipulation
+ \o Contact Manipulation
+ \o Relationship Manipulation
+\endlist
+
+
+\section2 Error Reporting
+
+When a synchronous operation fails, clients need to be able to retrieve error information associated
+with that synchronous operation. The QContactManager::error() function provides this information to clients.
+
+For some synchronous operations (for example, batch save or remove operations) it is possible that
+multiple errors may occur during the operation. In those cases, the synchronous function will take
+a pointer to a map of input index to error, which will be filled by the function as required, and
+the QContactManager::error() function will report the overall operation error.
+
+Error reporting is handled slightly differently in the asynchronous API, in that each instance of
+an asynchronous request is able to report any overall operation error as well as the finer-grained
+map of errors, for the operation which it requested.
+
+
+\section2 Contact Manipulation
+
+The most common type of operation that clients will perform involves retrieval or modification of contacts.
+The QContactManager class offers synchronous API to retrieve, create, update and delete contacts. The create
+and update operations are provided through the same interface. Both singular and batch operations are offered
+by the API.
+
+A contact is identified by its QContactId. This id consists of two parts: a URI which identifies the contact manager
+which stores the contact, and the local id of the contact in that manager. Some operations which take a pointer
+to a contact as an argument may modify the contact during the operation; updating the contact id is a common example.
+
+The QContactManager class provides API for accessing the ids of contacts which are stored in the manager:
+\list
+ \o contactIds(const QList<QContactSortOrder>& sortOrders = QList<QContactSortOrder>()) const
+ \o contactIds(const QContactFilter& filter, const QList<QContactSortOrder>& sortOrders = QList<QContactSortOrder>()) const
+\endlist
+
+The contact id retrieval functionality is also provided via asynchronous API through the QContactLocalIdFetchRequest class.
+
+The synchronous, singular contact manipulation functions offered by the QContactManager class are:
+\list
+ \o contact(const QContactLocalId& contactId, const QContactFetchHint& fetchHint = QContactFetchHint()) const
+ \o saveContact(QContact* contact)
+ \o removeContact(const QContactLocalId& contactId)
+\endlist
+
+The (optional) fetch argument to the contact accessor function allows clients to tell the plugin
+which types of information they wish to retrieve. This argument is a hint only, and may be ignored safely by the plugin,
+or used by the plugin to optimize the performance of the retrieve operation.
+
+The save operation entails a validation step, where the contact's details are checked against the supported schema.
+If the contact is valid, it will be saved. Note that if the contact already exists in the database (determined by
+the id of the contact) it will be replaced with the contact contained in the argument. This means that clients should
+not save any contact which was retrieved with a non-empty fetchHint defined, or data loss may occur.
+
+Any error which occurs during such singular contact manipulation functions may be accessed by calling QContactManager::error()
+directly after the original synchronous call.
+
+The synchronous, batch contact manipulation functions offered by the QContactManager class are:
+\list
+ \o contacts(const QList<QContactSortOrder>& sortOrders = QList<QContactSortOrder>(), const QContactFetchHint& fetchHint = QContactFetchHint()) const
+ \o contacts(const QContactFilter& filter, const QList<QContactSortOrder>& sortOrders = QList<QContactSortOrder>(), const QContactFetchHint& fetchHint = QContactFetchHint()) const
+ \o saveContacts(QList<QContact>* contacts, QMap<int, QContactManager::Error>* errorMap)
+ \o removeContacts(QList<QContactLocalId>* contactIds, QMap<int, QContactManager::Error>* errorMap)
+\endlist
+
+The batch save and remove functions both take an (optional) pointer to a map of errors. If the pointer is non-null,
+this map will be filled out with any errors which occur. The overall operation error of any batch manipulation operation
+may be accessed by calling QContactManager::error() directly after the original synchronous call.
+
+The contact manipulation functionality is also provided via asynchronous API through the QContactFetchRequest,
+QContactSaveRequest, and QContactRemoveRequest classes.
+
+The "self" contact is a special concept, which has dedicated API. A client may instruct any backend which supports the
+concept of a self contact that a particular, previously saved contact is the self contact. Any backend which implements
+this functionality should report that it supports the QContactManager::SelfContact feature.
+
+The API which provides the self-contact functionality consists of:
+\list
+ \o setSelfContactId(const QContactLocalId& contactId)
+ \o selfContactId() const
+\endlist
+
+In order to unset the self contact, a client may either delete the contact which is currently set as the self contact,
+or set the self contact id to be the invalid, zero id (constructed via QContactLocalId(0)).
+The self-contact manipulation functionality is only available via the synchronous API.
+
+
+\section2 Relationship Manipulation
+
+Contacts may be related in various ways. The contacts API allows clients to define relationships between contacts
+if the plugin providing the functionality supports such relationships. Any plugin which supports relationships
+should report this functionality by reporting that it supports the QContactManager::Relationships feature.
+
+Some plugins support arbitrary relationship types. Clients can define custom relationships between contacts saved
+in such plugins. Any plugin which supports arbitrary relationship types should report this functionality by reporting
+that it supports the QContactManager::ArbitraryRelationshipTypes feature.
+
+The API which provides the relationship manipulation functionality consists of:
+\list
+ \o relationships(const QContactId& participantId, QContactRelationshipFilter::Role role = QContactRelationshipFilter::Either) const;
+ \o relationships(const QString& relationshipType = QString(), const QContactId& participantId = QContactId(), QContactRelationshipFilter::Role role = QContactRelationshipFilter::Either) const;
+ \o saveRelationship(QContactRelationship* relationship);
+ \o saveRelationships(QList<QContactRelationship>* relationships);
+ \o removeRelationship(const QContactRelationship& relationship);
+ \o removeRelationships(const QList<QContactRelationship>& relationships);
+\endlist
+
+The relationship manipulation functionality is also provided via asynchronous API through the QContactRelationshipFetchRequest,
+QContactRelationshipSaveRequest, and QContactRelationshipRemoveRequest classes.
+
+
+\section2 Schema Manipulation
+
+The schema supported by a plugin is the list of detail definitions which are supported by the plugin.
+A contact which contains a detail of a particular definition which is not supported by the plugin
+will fail to validate when the user attempts to save it in that manager. The schema also includes
+any access constraints which may apply to certain details or detail definitions (for example,
+a particular detail definition might be declared to be unique per-contact in a particular manager).
+
+Every plugin will support a slightly different schema, as the schema which can be supported will depend
+on the semantics and limitations of the underlying storage platform on which the plugin is based.
+The default schema is described in the \l {Qt Contacts Schema}{Qt Mobility Contacts schema documentation},
+and plugins should attempt to implement that schema; however no guarantees are given to clients as to
+the conformance of the schemas supported by various plugins to the default schema.
+
+Some plugins support extensible detail types. This means that third party developers can
+extend the schema of such plugins at run time (for example, to add a new field to a detail).
+Some plugins allow third party developers to define new detail types (that is, to
+add an entirely new detail type to the schema supported by that plugin).
+Plugins which support these types of operations must report to clients that they support the
+QContactManager::MutableDefinitions feature.
+
+The synchronous API offers several functions to retrieve or modify the schema supported by a plugin:
+\list
+ \o detailDefinitions(const QString& contactType = QContactType::TypeContact) const
+ \o detailDefinition(const QString& definitionName, const QString& contactType = QContactType::TypeContact) const
+ \o saveDetailDefinition(const QContactDetailDefinition& def, const QString& contactType = QContactType::TypeContact)
+ \o removeDetailDefinition(const QString& definitionName, const QString& contactType = QContactType::TypeContact)
+\endlist
+
+The schema manipulation functionality is also provided via asynchronous API through the
+QContactDetailDefinitionFetchRequest, QContactDetailDefinitionSaveRequest and QContactDetailDefinitionRemoveRequest
+classes.
+
+Note that the schema supported by a plugin may vary depending on the type of contact to which the schema applies.
+For example, a particular plugin might support name, address, phone number, email address, and gender details for
+normal contacts, but only name, address, and phone number details for a group contact.
+
+
+\section1 Examples Of Usage
+
+The synchronous API provides the simplest way to access or modify the
+contact information managed by a particular backend. It has the
+disadvantage that calls block until completion and is therefore
+most suitable only for applications which interact with local, high-speed
+datastores.
+
+
+\section2 Saving a new contact to the default manager
+
+The client creates a new contact, adds a name and a phone number, and
+saves it to the default store of the default manager.
+
+We assume the existence of a specialised leaf-class that allows simple
+access to details of the definition identified by the "PhoneNumber"
+identifier, and another that allows simple access to details of the
+definition identified by the "Name" identifier. These specialised leaf
+classes may be written by anyone, and simply wrap the functionality
+provided by QContactDetail in order to allow simpler access to fields
+supported by a particular definition.
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Creating a new contact
+
+\section2 Filtering by detail definition and value
+
+The client utilises a default manager and asks for any contacts with a
+particular phone number. The example assumes that the default manager
+supports the provided QContactPhoneNumber detail leaf class (which
+implements the default definition for phone number details).
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Filtering by definition and value
+
+
+\section2 Installing a plugin that modifies the definition of one type of detail
+
+The client installs a plugin, which requires a new field to be added to
+details of the "EmailAddress" definition. It loads the definition from the
+default manager, modifies it (by adding the new field - a label field), and
+saves it back.
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Installing a plugin which modifies a definition
+
+\section3 Modifying an existing contact and saving the modifications
+
+The client retrieves a contact, modifies one of its details, adds a new
+detail, and then saves the contact back to the manager. Note that it uses
+the newly added field of the email address definition!
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Modifying an existing contact
+
+*/
+
diff --git a/doc/src/contactsusage.qdoc b/doc/src/contactsusage.qdoc
new file mode 100644
index 0000000000..16b7980f94
--- /dev/null
+++ b/doc/src/contactsusage.qdoc
@@ -0,0 +1,319 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+
+\page contactsusagehtml
+
+\title Contacts API Usage
+
+\tableofcontents
+
+\section1 Introduction
+
+This section provides some examples of common usage of the Qt Contacts API.
+
+\section1 Manager Settings And Configuration
+
+Users of the contacts API can define which backend they wish to access if a
+manager for that backend is available. The list of available managers can be
+queried programmatically at run-time, and the capabilities of different
+managers can be ascertained by inspecting a QContactManager instance.
+Furthermore, some managers can be constructed with parameters which affect the
+operation of the backend.
+
+\section2 Loading the default manager for the platform
+
+Most users of the API will want to use the default manager for the platform,
+which provides access to the system address book. Instantiating a manager by
+using the default constructor will result in the default manager for that
+platform being instantiated.
+
+The default constructor can either be used to create a manager on the stack,
+in which case it will be deleted automatically when it goes out of scope:
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Loading the default manager for the platform
+
+or it can be used explicitly to create a manager on the heap, in which case
+the client must ensure that they delete the manager when they are finished
+with it in order to avoid a memory leak:
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Loading the default manager for the platform on heap
+
+\section2 Querying a manager for capabilities
+
+Different managers will support different capabilities and details. Clients
+can use the meta data reporting functions of QContactManager to determine what
+the capabilities of the manager they have instantiated might be.
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Querying a manager for capabilities
+
+\section2 Loading the manager for a specific backend
+
+In this example, the client loads a manager for a specific backend. While
+this could be found and retrieved using a more advanced plugin framework
+(such as the Qt Service Framework), this code assumes that the client has
+prior knowledge of the backend in question.
+
+Clients may wish to use this feature of the API if they wish to store or
+retrieve contact information to a particular manager (for example, one that
+interfaces with a particular online service).
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Loading a specific manager backend
+
+\section2 Loading a manager with specific parameters
+
+The client loads a manager with specific parameters defined. The
+parameters which are available are backend specific, and so the client had
+to know that the "Settings" parameter was valid for the particular backend,
+and what argument it took. In this example, the client tells the backend to
+load detail definitions saved in a particular settings file.
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Loading a specific manager backend with parameters
+
+\section1 Contact Detail Manipulation
+
+Once a contact has been created (or retrieved from a manager), the client can
+retrieve, create, update or delete details from the contact. Since QContact
+and QContactDetail are both container (value) classes, the API offered for
+these operations is purely synchronous.
+
+A contact consists of the details it contains, as well as an id. Some details
+are read-only (such as the display label of a contact) or irremovable (like
+the type of a contact), but most are freely modifiable by clients.
+
+\section2 Adding a detail to a contact
+
+The client adds a name and a phone number to a contact.
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Adding a detail to a contact
+
+\section2 Updating a detail in a contact
+
+The client updates the phone number of a contact.
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Updating a detail in a contact
+
+\section2 Removing a detail from a contact
+
+The client removes the phone number of a contact.
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Removing a detail from a contact
+
+\section2 Viewing a specific detail of a contact
+
+The client retrieves and displays the first phone number of a contact
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Viewing a specific detail of a contact
+
+\section2 Viewing all of the details of a contact
+
+The client retrieves all of the details of a contact, and displays them
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Viewing the details of a contact
+
+It is important to note that details are implicitly shared objects with
+particular semantics surrounding saving, removal and modification. The
+following example demonstrates these semantics
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Demonstration of detail sharing semantics
+
+\section1 Persistent Contact Information
+
+After instantiating a manager, clients will wish to retrieve or modify contact
+information (including relationships and possibly detail definitions) which
+is persistently stored in the manager (for example, in a database or online
+cloud).
+
+If the client wishes to use the asynchronous API, it is suggested that their
+class uses member variables for the manager and requests, similarly to:
+
+ \snippet snippets/qtcontactsdocsample/requestexample.h Class setup
+
+This allows them to define slots which deal with the data as required when the
+state of the request changes:
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsampleasync.cpp Example of an asynchronous request slot
+
+Note that if the client is interested in receiving the results of the request
+as they become available, rather than only the final set of results once the
+request changes state (to \c FinishedState, for example), the client should
+instead connect the QContactAbstractRequest::resultsAvailable() signal to the
+slot which deals with the results.
+
+\section2 Creating a new contact in a manager
+
+The client creates a new contact and saves it in a manager
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsampleasync.cpp Creating a new contact in a manager
+
+Alternatively, the client can explicitly block execution until the request is
+complete, by doing something like:
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsampleasync.cpp Creating a new contact in a manager waiting until finished
+
+The equivalent code using the synchronous API looks like:
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Synchronously creating a new contact in a manager
+
+\section2 Retrieving contacts from a manager
+
+The client requests all contacts from the manager which match a particular
+filter.
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsampleasync.cpp Filtering contacts from a manager
+
+The equivalent code using the synchronous API looks like:
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Synchronously filtering contacts from a manager
+
+The client can also retrieve a particular existing contact from a manager, by
+directly requesting the contact with a particular (previously known) id.
+With the asynchronous API, this takes the form of another filter:
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsampleasync.cpp Retrieving an existing contact from a manager
+
+The synchronous API provides a function specifically for this purpose:
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Synchronously retrieving an existing contact from a manager
+
+\section2 Updating an existing contact in a manager
+
+The client updates a previously saved contact by saving the updated version of
+the contact. Any contact whose id is the same as that of the updated contact
+will be overwritten as a result of the save request.
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsampleasync.cpp Updating an existing contact in a manager
+
+The equivalent code using the synchronous API looks like:
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Synchronously updating an existing contact in a manager
+
+\section2 Removing a contact from a manager
+
+The client removes a contact from the manager by specifying its local id.
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsampleasync.cpp Removing a contact from a manager
+
+The equivalent code using the synchronous API looks like:
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Synchronously removing a contact from a manager
+
+\section2 Creating a new relationship between two contacts
+
+The client specifies a relationship between two contacts stored in the manager
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsampleasync.cpp Creating a new relationship between two contacts
+
+The equivalent code using the synchronous API looks like:
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Synchronously creating a new relationship between two contacts
+
+\section2 Retrieving relationships between contacts
+
+The client requests the relationships that a particular contact is involved in
+from the manager in which the contact is stored.
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsampleasync.cpp Retrieving relationships between contacts
+
+The equivalent code using the synchronous API looks like:
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Synchronously retrieving relationships between contacts
+
+When a contact is retrieved, it will contain a cache of the relationships in
+which it is involved at the point in time at which it was retrieved.
+This provides clients with a simple way to retrieve the relationships in which
+a contact is involved, but carries the risk that the cache is stale.
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Retrieving relationships from cache
+
+Clients can inform the manager that they do not require this cache of
+relationships to be populated when retrieving a contact, which can allow a
+manager to optimize contact retrieval. Other retrieval optimizations are also
+possible to specify, for example that they are only interested in certain types of details.
+The following code shows how the client can inform the manager that they are
+only interested in relationships of the \c HasMember type (groups):
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsampleasync.cpp Providing a fetch hint
+
+The equivalent code using the synchronous API looks like:
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Synchronously providing a fetch hint
+
+\section2 Removing a relationship between two contacts
+
+The client can remove a relationship directly from a manager.
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsampleasync.cpp Removing a relationship
+
+The equivalent code using the synchronous API looks like:
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Synchronously removing a relationship
+
+Alternatively, when a contact which is involved in a relationship is removed,
+any relationships in which it is involved will be removed also.
+
+\section2 Querying the schema supported by a manager
+
+The client queries the schema supported by a manager, and checks to see if a
+particular detail definition supports a certain field.
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsampleasync.cpp Querying the schema supported by a manager
+
+The equivalent code using the synchronous API looks like:
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Synchronously querying the schema supported by a manager
+
+\section2 Modifying the schema supported by a manager
+
+The client attempts to modify a particular detail definition by extending it
+so that it supports an extra field.
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsampleasync.cpp Modifying the schema supported by a manager
+
+The equivalent code using the synchronous API looks like:
+
+ \snippet snippets/qtcontactsdocsample/qtcontactsdocsample.cpp Synchronously modifying the schema supported by a manager
+
+Note that some managers do not support mutable definitions, and hence
+attempting to modify or remove detail definitions in those managers will fail.
+
+*/
diff --git a/doc/src/examples.qdoc b/doc/src/examples.qdoc
index 3718436201..ca4b634d7d 100644
--- a/doc/src/examples.qdoc
+++ b/doc/src/examples.qdoc
@@ -57,7 +57,7 @@
\list
\o \l{samplephonebook}{Sample Phonebook}
- \o \l{incomingcalls}{Incoming Call Simulator}
+ \o \l{qmlcontacts}{QML-based Sample Phonebook}
\endlist
\section2 Location
@@ -65,30 +65,23 @@
\list
\o \l{fetchgooglemaps}{Fetch Google Maps}
\o \l{logfilepositionsource}{Log File Position Source}
- \o \l{flickrdemo}{Flickr Demo}
- \o \l{lightmaps}{Light Maps}
- \o \l{weatherinfo}{Weather Info}
\endlist
\section2 Messaging
\list
\o \l{keepintouch}{Keep in Touch}
- \o \l{querymessages}{Query Messages}
\o \l{serviceactions}{Service Actions}
- \o \l{writemessage}{Write Message}
\endlist
\section2 Multimedia
\list
\o \l{audiorecorder}{Audio Recorder}
- \o \l{cameracapture}{Camera Capture}
\o \l{player}{Player}
\o \l{radio}{Radio}
\o \l{recorder}{Recorder}
\o \l{slideshow}{Slideshow}
- \o \l{streamplayer}{Stream Player}
\endlist
\section2 Publish and Subscribe
@@ -101,10 +94,13 @@
\section2 Service Framework
\list
+ \o \l{servicebrowser}{Service Browser}\raisedaster
\o \l{bluetoothtransferplugin}{Bluetooth Transfer Plugin}
- \o \l{declarative}{Qt Declarative based service framework example}
\o \l{filemanagerplugin}{File Manager Plugin}
- \o \l{servicebrowser}{Service Browser}\raisedaster
+ \o \l{notesmanagerplugin}{Notes Manager Plugin}
+ \o \l{sfw-notes}{Notes Manager}
+ \o \l{declarative-sfw-notes}{Declarative Notes Manager}
+ \o \l{declarative-sfw-dialer}{Declarative Dialer}
\endlist
\section2 System Information
diff --git a/doc/src/examples/bluetoothtransferplugin.qdoc b/doc/src/examples/bluetoothtransferplugin.qdoc
index d150ba3b35..615afa10e6 100644
--- a/doc/src/examples/bluetoothtransferplugin.qdoc
+++ b/doc/src/examples/bluetoothtransferplugin.qdoc
@@ -44,4 +44,17 @@
\title Bluetooth Transfer Plugin Example
This example shows how to write a service plugin for the \l{Qt Service Framework}{Service Framework}.
+
+ \section1 Registering the Service
+ The service can be registered by using the function \l{QServiceManager::}{addService()}, this takes a path to the XML file that describes the service, \i{bluetoothtransferservice.xml}.
+
+ \section1 Writing the Plugin
+ To implement a plugin it is necessary to create a new plugin class derived from QObject and QServicePluginInterface. The function QServicePluginInterface::createInstance() is implemented to return the appropriate instantiated object based on the interface name passed into the function. Since there is only one interface name for this example there is no test involved, so we can simply create the object implementing the service and return its pointer.
+
+ \snippet ../../examples/bluetoothtransferplugin/bluetoothtransferplugin.cpp createinstance
+
+ The implementation of the service BluetoothTransfer is simply a test function for this example. The BluetoothTransfer class is very simple, with only an empty constructor and the sendFile() function
+
+ \snippet ../../examples/bluetoothtransferplugin/bluetoothtransfer.cpp sendFile
+
*/
diff --git a/doc/src/examples/declarative.qdoc b/doc/src/examples/declarative-sfw-dialer.qdoc
index bc87a2087e..f6bedb4111 100644
--- a/doc/src/examples/declarative.qdoc
+++ b/doc/src/examples/declarative-sfw-dialer.qdoc
@@ -40,14 +40,18 @@
****************************************************************************/
/*!
-\example declarative
+\example declarative-sfw-dialer
\title Service Framework using QML Example
\bold {Explanation:}
This example should demonstrate how to use the Service Framework and
-access the services in a QMLContext.
+access the services in a QMLContext. Currently there is a wrapper class
+which provides functionality for a single service as well as a list of
+services. In future releases this will be included as a plugin. Another
+example that demonstrates how to connect to a single service object to
+implement a simple note taking application can be found \l{declarative-sfw-notes}{here}.
\target guidesign
@@ -55,10 +59,6 @@ The GUI looks like following picture:
\image DialerServiceGUI.png "GUI"
-The following picture shows the architecture of this example:
-
-\image DialerServiceUML.png "UML"
-
The following steps outline how to make a QML based application
using the Service Framework technology.
@@ -72,26 +72,22 @@ For the usage of several Qml objects and Service Framework we need to
prepare our main.cpp:
\list 1
\o Include the appropriate headers
- \o Include the neccessary Qml objects header
- \o Include the Service Framework object header
+ \o Include the neccessary service framework type registrations
+ \o Include the QML canvas to be displayed
\endlist
-Steps 1 and 2 are shown in the example below:
-\snippet declarative/main.cpp 0
+Step is shown below:
+\snippet declarative-sfw-dialer/sfwexample/main.cpp 0
+
+Now to make our service framework wrappers known to QML as registered types we need the
+following inline method:
+\snippet declarative-sfw-dialer/sfwexample/main.cpp 1
-We are using the QmlView header which we need to
-load the main Qml file and show the Qml site.
-\snippet declarative/main.cpp 1
-\snippet declarative/main.cpp 2
-\snippet declarative/main.cpp 3
+This allows us to import our new types in QML by:
+\snippet declarative-sfw-dialer/sfwexample/content/DialerList.qml 4
-Furthermore we are using the QmlContext header
-which we need to add our own implemented object in the Qml context.
-This means that we can create our own object and access it in a QML script file.
-\target addpropertyinqmlcontext
-In this case we can access our service list over the "services" property
-in Qml script.
-\snippet declarative/main.cpp 4
+We are using QDeclarativeView to load and show our QML content
+\snippet declarative-sfw-dialer/sfwexample/main.cpp 2
\bold {The Services:}
@@ -105,14 +101,15 @@ In this example we've implemented 2 services called
Landdialer and Voipdialer.
You can find the projects for those services in:
-declarative\\landlinedialer and declarative\\voipdialer.
+declarative-sfw-dialer\\landlinedialer and declarative-sfw-dialer\\voipdialer.
Those projects will create a shared library in each case.
If the library needs to be available over the Service Framework,
we need to register the library.
You can do this by using the QServiceManager function addService(...).
-In our example this will be done in the function registerExampleServices in ServiceRegister:
-\snippet declarative/sfwexample.cpp 0
+In our example this will be done in the function registerExampleServices in the registration class
+accompanying the main function:
+\snippet declarative-sfw-dialer/sfwexample/sfwexample.cpp 0
As you can see we register the services using a xml file.
This xml file basically contains all information to register the shared library in the
@@ -122,13 +119,14 @@ For more information please read more about the Qt Service Framework
The QServiceManager creates an instance of a services over a QServicePluginInterface.
For each services we provide a Plugin.
-\snippet declarative/voipdialer/voipdialerplugin.h 0
+
+\snippet declarative-sfw-dialer/voipdialer/voipdialerplugin.h 0
The Q_INTERFACES macro tells Qt which interfaces the class implements.
Both seviceplugins needs to implement the QServicePluginInterface.
In our case we only need to overwrite the virtual function createInstance.
-\snippet declarative/voipdialer/voipdialerplugin.cpp 0
+\snippet declarative-sfw-dialer/voipdialer/voipdialerplugin.cpp 0
As you can see the createInstance function create the appropriate dialer object
and returns it.
@@ -140,58 +138,62 @@ the states, properties, signals and slots that we
want to access in out QML script later.
\target voipdialer_h_0
-\snippet declarative/voipdialer/voipdialer.h 0
+\snippet declarative-sfw-dialer/voipdialer/voipdialer.h 0
\bold {The ServiceWrapper:}
The ServiceWarpper is our object that is accessible in the QML script.
Over the ServiceWrapper we can access several service details by calling the properties of the wrapper.
-\snippet declarative/sfwexample.h 0
-
-\bold {The ServiceRegister:}
+\snippet declarative-sfw-dialer/sfwexample/qdeclarativeservice.h 0
-The ServiceRegister contains a list of all available services they contain the com.nokia.qt.examples.Dialer interface.
-In the constructor of ServiceRegister a call will be made to register the dialer services (LandLineDialer and VoipDaler)
-from this example.
+Additionally, there is a QList of ServiceWrapper objects that is also available through QML which can be used to
+obtain a list of services and their details by supplying an interface with an optional minimum version number. QML
+can gain access to these details including the list using the QML-specific QDeclarativeListProperty with the
+following properties.
-\snippet declarative/sfwexample.cpp 0
+\snippet declarative-sfw-dialer/sfwexample/qdeclarativeservice.h 1
-After this call the ServiceRegister fills it's internal ServiceWrappper QList.
+The ServiceWrapperList contains a list of all available services that contain the com.nokia.qt.examples.Dialer interface.
+In the setInterfaceName(..) function which is QML accessible, a QList of ServiceWrapper objects is populated for the
+dialer services (LandLineDialer and VoipDaler). Each ServiceWrapper object containts the QServiceInterfaceDescriptor and
+properties which allow QML to access the service library functions. This is done by utilising the code below:
-\snippet declarative/sfwexample.cpp 1
+\snippet declarative-sfw-dialer/sfwexample/qdeclarativeservice.cpp 0
-In the header of ServiceRegister we allow external objects to access the ServiceWrapper QList.
-
-\snippet declarative/sfwexample.h 1
-
-You may remember that we add this QList to our qml context as a property named \l {addpropertyinqmlcontext}{ services}
+QML context requires a special declarative list when declaring the property, in this case the property services will
+provide QML with the list of ServiceWrappers which can call serviceObject(..) to reference the service library functions.
\bold {Service access on the QML site}
The QML elements are implemented in 4 different qml scripting files
\l {guidesign}{ see GUI design}.
-In the ServiceList.qml file the services property is assigned to the ListView model property.
+The first step is to use our ServiceWrapperList to specify the interface and minimum version (optional) through QML item
+context, which will produce a list of ServiceWrapper objects.
+
+\snippet declarative-sfw-dialer/sfwexample/content/DialerList.qml 5
+
+In the DialerList.qml file the services property is assigned to the ListView model property.
-\snippet declarative/ServiceList.qml 0
+\snippet declarative-sfw-dialer/sfwexample/content/DialerList.qml 0
To show the items of the model property we need to create a delegate component and assign it to the ListView
Delegate property:
-\snippet declarative/ServiceList.qml 1
+\snippet declarative-sfw-dialer/sfwexample/content/DialerList.qml 1
In this component you can define how you want to draw one ListView item.
You can acces insite of this component the current ListWiew item by using the variable modelData.
In our example we are using two text lines. Furthermore we can define whats happening if we click
on a ListView item by using the MouseRegion.
-\target ServiceList_qml_2
-\snippet declarative/ServiceList.qml 2
+\target DialerList_qml_2
+\snippet declarative-sfw-dialer/sfwexample/content/DialerList.qml 2
Another component can be created for highliting a list item:
-\snippet declarative/ServiceList.qml 3
+\snippet declarative-sfw-dialer/sfwexample/content/DialerList.qml 3
\bold {Service signals and function calls on the QML site}
@@ -201,23 +203,23 @@ As you can see in the onDial event we call the service function dialNumber and
the onHangup calls hangup.
Both function are implemented in the service \l {voipdialer_h_0} { (see voipdialer header file).}
-\snippet declarative/sfw-kinetic-example.qml 0
+\snippet declarative-sfw-dialer/sfwexample/sfwexample.qml 0
In DialScreen.qml the dial and the hangup signals are defined.
The hangup signal will be emited if the HangUpButton was clicked:
-\snippet declarative/DialScreen.qml 1
+\snippet declarative-sfw-dialer/sfwexample/content/DialScreen.qml 1
The dial signal will be emited if the CallButton was clicked:
-\snippet declarative/DialScreen.qml 2
+\snippet declarative-sfw-dialer/sfwexample/content/DialScreen.qml 2
Now we need to connect the stateChanged signal form the services with an event handler on the QML site.
-This is done in the sfw-kinetic-example.qml file:
+This is done in our main declarative file:
-\snippet declarative/sfw-kinetic-example.qml 1
+\snippet declarative-sfw-dialer/sfwexample/sfwexample.qml 1
The DialScreen.currentDialer is assigned during a ListView item click in the
-\l {ServiceList_qml_2}{ ServiceList.qml file}.
+\l {DialerList_qml_2}{ ServiceList.qml file}.
*/
diff --git a/doc/src/examples/declarative-sfw-notes.qdoc b/doc/src/examples/declarative-sfw-notes.qdoc
new file mode 100644
index 0000000000..4ab0600677
--- /dev/null
+++ b/doc/src/examples/declarative-sfw-notes.qdoc
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\example declarative-sfw-notes
+
+\title Declarative Service Framework Notes Manager
+
+This example demonstrates how to use the \l{notesmanagerplugin}{Notes Manager service plugin}
+to implement a notes managing application with QML as the declarative user-interface. There
+is also a non-QML counterpart which demonstrates an identical application using standard Qt
+user-interface tool. See \l{sfw-notes}{Service Framework Notes Manager} for more details.
+
+
+\bold {Explanation}
+
+In general, QML requires external types and registrations to be provided via a plugin-based
+system, which the service framework does not currently provide. Instead, we have a wrapper
+class which provides access to the QServiceManager and QServiceInterfaceDescriptor API that
+needs to be included in the project and declared in the main funciton of the application. The
+wrapper is referred to as QDeclarativeService.
+
+This example demonstrates how QML can be used to completely control the logic of the
+application, using a combination of declarative elements and Javascript in the QML file. The
+main function is used to produce an application binary but once service framework supports
+a QML plugin, only the QML file will be needed. Also contained is a class that registers our
+Notes Manager service to supply the plugin library, which can also be done using the
+servicefw tool.
+
+There is another service framework example that demonstrates how to use the wrapper to
+browse a list of services to select for dialing usage. See
+\l{declarative-sfw-dialer}{Declarative Service Framework Dialer} for a detailed explanation.
+
+The secion belows explains how QML can be used to emulate to exact functionality of the
+alternate Qt/C++ example.
+
+
+\bold {QML File}
+
+The very first step is to import our registered types with the following:
+\snippet declarative-sfw-notes/declarative-sfw-notes.qml 0
+
+Now to obtain the default service with a specific interface name from within QML we can
+use the Service wrapper item as follows:
+\snippet declarative-sfw-notes/declarative-sfw-notes.qml 6
+
+In most cases we will need the service to be avaiable to all parts of the QML file, meaning
+the actual QObject returned from the service wrapper needs to be a global property.
+\snippet declarative-sfw-notes/declarative-sfw-notes.qml 1
+
+The interfaceName property of the Service item has READ and WRITE methods which can be used
+to obtain a new service instance and check if there was a valid default service.
+\snippet declarative-sfw-notes/declarative-sfw-notes.qml 2
+
+With a valid reference which points to the service plugin class we can now invoke methods
+directly from the Notes Manager plugin. The example below shows how to obtain a list of
+notes and delete one from the notes manager database through QML.
+\snippet declarative-sfw-notes/declarative-sfw-notes.qml 3
+
+The Notes Manager plugin also provides readable functions which return the values of a
+single note and can be utilized to display on the UI as follows:
+\snippet declarative-sfw-notes/declarative-sfw-notes.qml 4
+\snippet declarative-sfw-notes/declarative-sfw-notes.qml 5
+
+*/
diff --git a/doc/src/examples/filemanagerplugin.qdoc b/doc/src/examples/filemanagerplugin.qdoc
index bf8b621dc8..fd7afb30a3 100644
--- a/doc/src/examples/filemanagerplugin.qdoc
+++ b/doc/src/examples/filemanagerplugin.qdoc
@@ -44,4 +44,22 @@
\title File Manager Plugin Example
This example shows how to write a service plugin for the \l{Qt Service Framework}{Service Framework}.
+
+ \section1 Registering the Service
+ The service can be registered by using the function \l{QServiceManager::}{addService()} which takes a path to the XML file that describes the service, \i{filemanagerservice.xml}.
+
+ \section1 Writing the Plug-In
+ A Service plug-in is made by deriving a new plugin class from the QServicePluginInterface class then implementing the function QServicePluginInterface::createInstance().
+
+ The FileManager plugin example has a simple \l {QServicePluginInterface::}{createInstance()}. It
+ only needs to create the appropriate object based on the interface name
+ and return a pointer to it.
+
+ \snippet ../../examples/filemanagerplugin/filemanagerplugin.cpp createinstance
+
+ The functionality of the FileManager and the FileTransfer classes are
+ in the separate classes FileManagerStorage and FileManagerTransfer respectively. The existing functions are merely test stubs to demonstrate
+ the concept.
+
+
*/
diff --git a/doc/src/examples/notesmanagerplugin.qdoc b/doc/src/examples/notesmanagerplugin.qdoc
new file mode 100644
index 0000000000..fc1f1b4b2d
--- /dev/null
+++ b/doc/src/examples/notesmanagerplugin.qdoc
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \example notesmanagerplugin
+ \title Notes Manager Plugin Example
+
+ This example shows how to write a service plugin that manages textual notes by using a
+ database to add, delete and store note objects. This plugin is QML compatible and is
+ therefore used in the example \l{declarative-sfw-notes}{Declarative Notes Manager} as
+ well as its non-QML counterpart \l{sfw-notes}{Notes Manager} which uses standard
+ user-interface files (*.ui).
+*/
diff --git a/doc/src/examples/incomingcalls.qdoc b/doc/src/examples/qmlcontacts.qdoc
index af049bda85..8050f2e08a 100644
--- a/doc/src/examples/incomingcalls.qdoc
+++ b/doc/src/examples/qmlcontacts.qdoc
@@ -40,34 +40,26 @@
****************************************************************************/
/*!
- \example incomingcalls
- \title Incoming Call Simulator
+ \example qmlcontacts
+ \title Sample QML-based Phonebook Example
\tableofcontents
- \section1 Incoming Calls
+ \section1 Phone Book
- This example shows how to access contact information asynchronously using the \l{Contacts}{Contacts API}.
- It generates a large number of contacts automatically, saves them to an in-memory, anonymous contacts store,
- and allows the user to view them in a model view. It then simulates incoming calls from random phone numbers,
- and displays information about the contact calling if the random phone number matches a phone number of a
- generated contact.
+ This example shows how to write a simple read-only phonebook with the \l{Contacts}{Contacts API},
+ with a user interface declared with the QML declarative language.
\section2 Motivation
- This application was written to provide an example to developers of how to use the Qt Contacts API.
- It uses an asynchronous method to retrieve details of contacts on demand, and displays them in a model view.
- It also provides an example of simple string matching on contact phone numbers to perform identification.
-
- \section2 Use Case
- A real address book may contain hundreds or even thousands of contacts. Being able to load a small portion
- of those contacts on-demand as required (for example, those visible in the UI currently, plus some cached),
- as opposed to the entire dataset, is a vital requirement.
+ This application was written to provide an example to developers of how to use the Qt Mobility Contacts API,
+ and an example of integration with QML.
\section2 Interface
- The application is not very interactive. The only allowable user interaction is the ability to scroll around
- the list of contacts, and to view the details of contacts from which a simulated phone call is coming.
+ The interface is simplistic and merely provides an example that may provide a starting point
+ for developers interested in designing QML-based interfaces for projects which use Qt Mobility APIs.
\section2 Known Issues
- The example is not intended to be feature complete. Also, the example model view and result caching engine
- performs superfluous asynchronous requests (i.e., for data already contained in the contact cache).
+ The example is not intended to be feature complete. Only a very limited subset of detail types are
+ supported by the application. It exercises only a very small portion of the Qt Contacts API.
+ The example is read-only and not performant.
*/
diff --git a/doc/src/examples/quickstart.qdoc b/doc/src/examples/quickstart.qdoc
index 4325f46bf9..e85b8327f5 100644
--- a/doc/src/examples/quickstart.qdoc
+++ b/doc/src/examples/quickstart.qdoc
@@ -53,7 +53,7 @@ as per \l {Installation Guide}.
One can start using Qt Mobility with 3 simple steps.
\list 1
\o Include the appropriate headers
- \o Use the \c QtMobility namespace
+ \o Use the QTM_USE_NAMESPACE macro (defined in qmobilityglobal.h but implicitly included from any Qt Mobility header)
\o Declare the usage of Qt Mobility
and appropriate API(s) in the project(.pro) file
\endlist
@@ -63,9 +63,8 @@ Steps 1 and 2 are shown in the example below:
This example uses the QSystemInfo headers to print out the
system's current country code. All the domain APIs are wrapped
-within the \c QtMobility namespace and thus developers either
-need to declare \c {using namespace QtMobility} or
-qualify their symbols e.g. \c {QtMobility::QSystemInfo}.
+within a Qt Mobility namespace and thus developers
+need to use the QTM_USE_NAMESPACE macro.
(\bold{Note}: If you are on the Symbian platform you will
need to define the actual header file, in this case
<qsysteminfo.h> rather than using the standard header form
@@ -87,6 +86,7 @@ determine the QtMobility library the current project should link to (in this exa
Each QtMobility API has its corresponding value which has to be added to \c MOBILITY. The subsequent table lists the APIs and the
corresponding values that can be assigned to \c MOBILITY.
+
\table
\header
\o Domain
@@ -120,6 +120,41 @@ corresponding values that can be assigned to \c MOBILITY.
\o versit
\endtable
+When developing on Symbian we will also need to add the required capabilites to the project file in order to satisfy the Symbian security model:
+
+\snippet quickstart/quickstart.pro 1
+
+\table
+\header
+ \o Domain
+ \o Symbian Capabilities
+\row
+ \o \l {Bearer Management}
+ \o ReadUserData NetworkServices (NetworkControl for QNetworkSession::stop())
+\row
+ \o \l {Contacts}
+ \o ReadUserData WriteUserData SwEvent ReadDeviceData WriteDeviceData
+\row
+ \o \l {Location}
+ \o Location
+\row
+ \o \l {Multimedia}
+ \o UserEnvironment ReadUserData WriteUserData ReadDeviceData WriteDeviceData
+\row
+ \o \l {Messaging}
+ \o LocalServices ReadUserData WriteUserData NetworkServices UserEnvironment ReadDeviceData WriteDeviceData
+\row
+ \o \l {Publish And Subscribe}
+ \o ReadDeviceData WriteDeviceData
+\row
+ \o \l {Qt Service Framework} {Service Framework}
+ \o No capabilities requried by itself, the plugins may have capability requirements.
+\row
+ \o \l {System Information}
+ \o LocalServices ReadUserData WriteUserData NetworkServices UserEnvironment Location TrustedUI ReadDeviceData
+\row
+\endtable
+
And we're done. If you are using the command line simply
enter:
\code
@@ -129,12 +164,12 @@ enter:
to generate the executable which can then be run.
-If you are developing for symbian, to make a debug build for the emulator run:
+If you are developing for Symbian, to make a debug build for the emulator run:
\code
qmake
make debug-winscw
\endcode
-This assumes that qmake is in your %PATH% and Qt has been build for the emulator already.
+This assumes that qmake is in your %PATH% and Qt has been built for the emulator already.
To make a release build and SIS package for a device run:
@@ -145,7 +180,7 @@ To make a release build and SIS package for a device run:
\endcode
For further details on how to build applications for
-symbian see \l {http://qt.nokia.com/doc/4.6/symbian-with-qt-introduction.html}
-{The Symbian Platform - Introduction to Qt}, \l {http://developer.symbian.org/wiki/index.php/Qt_Quick_Start}
-{Qt Quick Start} and the \c {symbian\install.txt}
+Symbian see \l {http://qt.nokia.com/doc/4.6/symbian-with-qt-introduction.html}
+{The Symbian Platform - Introduction to Qt} and \l {http://developer.symbian.org/wiki/index.php/Qt_Quick_Start}
+{Qt Quick Start}
*/
diff --git a/doc/src/examples/samplephonebook.qdoc b/doc/src/examples/samplephonebook.qdoc
index 6398548bc0..3078edbc89 100644
--- a/doc/src/examples/samplephonebook.qdoc
+++ b/doc/src/examples/samplephonebook.qdoc
@@ -50,38 +50,81 @@
This example shows how to write a simple phonebook with the \l{Contacts}{Contacts API}.
\section2 Motivation
- This application was written to provide an example to developers of how to use the Qt Contacts API.
- It also provides an example implementation of a vCard* serialiser and deserialiser, which enables
- persistent storage of QContact objects if no other persistent-storage backend is available.
+ This application was written to provide an example to developers of how to use the QtContacts and
+ QtVersit APIs.
+
+ It provides an example of how to use the QtMobility libraries to:
+ \list
+ \o select a backend for persistent storage
+ \o list the stored contacts
+ \o add contacts
+ \o edit contacts
+ \o use filters to find contacts matching certain criteria
+ \o import and export contact lists as vCards\reg *
+ \endlist
[*] \i{vCard is a registered trademark of the Internet Mail Consortium}
\section2 Use Case
Most people have a need to store information (such as addresses, telephone numbers and email addresses)
- of people that they know. This sample application provides a simple phone book which allows users
- to store certain pieces of information about their contacts, and save them to disc.
+ of people that they know. This sample application provides a simple phone book that allows users
+ to store certain pieces of information about their contacts, and save them to the contacts database of
+ their device.
\section2 Interface
- The application is aimed at desktop platforms as opposed to mobile platforms, and thus uses regular widgets
- as the basis of the interface. The main screen consists of a list view on the left, the current contact's
- details in the middle, and several navigation and control buttons on the right.
+ The application is designed to work on desktop and mobile platforms with
+ minimal differences in code between the platforms. The interface is
+ organized into a paged view, showing the \i {Contact List} by default.
+ Contacts can be added, edited or deleted using the buttons at the bottom
+ of the contact list.
+ To search for a contact in the list, a filter can be applied using the
+ \i {Apply Filter} item in the \i Contacts menu.
+
+ Here we see the \i {Contact List} with some names added.
+
+ \image sample-phonebook-1.png
+
+ When adding a new contact a new page is shown, with a \i{Set Picture}
+ button to import an image. It is a good idea to use smaller images if
+ you intend to export the contacts to a file later.
+
+ \image sample-phonebook-2.png
+
+ From the main menu, \i{Contacts}, you can select \i{Apply Filter}. This
+ will display a new page which enables the user to specify filter criteria.
+ In the screenshot below, we are selecting based on the first two characters
+ of the Name,
+
+ \image sample-phonebook-3.png
+
+ which gives us a subset of the list of contacts.
+
+ \image sample-phonebook-4.png
- \image spb-screen.png Screenshot of the sample phone book
+ To reset this, just select \i{Clear Filter} from the \i {Contacts} menu.
- The interface of the application is similar to that found in the Qt Addressbook Tutorial.
- Indeed, several sections of its code (including the "Find Contact" dialog code, and some of the main window
- interface and initialisation code) was recycled.
+ The contact list can also be imported and exported to the vCard format
+ through the \i {Import Contacts} and \i {Export Contacts} items in the
+ \i Contacts menu. This functionality can be used to populate the
+ list from another device or application.
\section2 Known Issues
The example is not intended to be feature complete. Only a very limited subset of detail types are
supported by the application. It exercises only a very small portion of the Qt Contacts API.
- Furthermore:
+ In particular:
\list
- \o You cannot export an unsaved contact.
- \o Exporting a saved contact to which changes have been made where those changes have not been saved
- will result in the original, currently saved contact being exported.
- \o Duplicate contacts are not filtered out - importing the same contact twice results in two identical contacts
- appearing in the list.
+ \o The example only exercises the synchronous API of QtContacts. For most real applications, the
+ asynchronous API is the preferred interface to use as it does not block the UI while a query
+ is made to the contacts backend.
+ \o Detail subtypes and contexts are not supported by the interface.
+ \o Duplicate contacts are not filtered out - importing the same contact twice results in two
+ identical contacts appearing in the list. In a real application, more complex synchronization
+ code may be required.
+ \o Contact groups are not supported. The QtContacts API supports two methods of grouping contacts.
+ One way is to use contacts of type \l{QContactType::TypeGroup}{TypeGroup}, along with the
+ \l{QContactRelationship::HasMember}{HasMember} QContactRelationship. The other way is to use
+ the QContactTag detail by giving related contacts the same tag. A real application may support
+ grouping via one or both of these methods.
\endlist
*/
diff --git a/doc/src/examples/sfw-notes.qdoc b/doc/src/examples/sfw-notes.qdoc
new file mode 100644
index 0000000000..7ea6d0b813
--- /dev/null
+++ b/doc/src/examples/sfw-notes.qdoc
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \example sfw-notes
+
+ \title Service Framework Notes Manager
+
+ This example demonstrates how to use the Service Framework to obtain a single
+ default service at a specified interface address provided by the Notes
+ Manager service \l{notesmanagerplugin}{plugin}, which can be used to implement
+ a notes managing application.
+
+ There is also a declarative example which implements identical functionality
+ using QML as the main user-interface context. This example is called the
+ \l{declarative-sfw-notes}{Declarative Notes Manager}
+*/
diff --git a/doc/src/examples/sysinfo.qdoc b/doc/src/examples/sysinfo.qdoc
new file mode 100644
index 0000000000..6ec2ef09dd
--- /dev/null
+++ b/doc/src/examples/sysinfo.qdoc
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \example sysinfo
+ \title System Information Example
+
+
+ \image sysinfo.png
+
+
+ The System Information example uses a tabbed dialog, with each tab
+ representing a particular type of data: versions, network and so on.
+
+ To access the information, the example creates objects belonging to the System Information classes
+
+ \annotatedlist systeminfo
+
+ Here are some examples that show how the example application reads the
+ device information.
+
+ The current language
+
+ \snippet ../../examples/sysinfo/dialog.cpp lang
+
+ Device information, starting with the battery level
+
+ \snippet ../../examples/sysinfo/dialog.cpp createdi
+ \dots
+ \snippet ../../examples/sysinfo/dialog.cpp batteryLevel
+
+ The manufacturer id and the product name
+
+ \snippet ../../examples/sysinfo/dialog.cpp manuf-id
+ \dots
+ \snippet ../../examples/sysinfo/dialog.cpp productName
+
+ And there are signals that can be used to update progress bars and other
+ indicators. An example is when the battery level changes, the batteryLevelChanged() signal is emitted
+
+ \snippet ../../examples/sysinfo/dialog.cpp sig batteryLevelChanged
+
+
+ Other information is stored as bitwise flags. The following code shows
+ the input methods being determined using flags.
+
+ \snippet ../../examples/sysinfo/dialog.cpp inputMethod flags
+
+ Various capabilities of the device can be found by testing for features.
+ In the example a Feature combo box, on the General tab, has a hard coded
+ list of features. When a listed featue is selected the getFeature()
+ function is called with the index which is handled by applying a test to
+ the corresponding feaure.
+
+ \snippet ../../examples/sysinfo/dialog.cpp feature
+ \dots
+ \snippet ../../examples/sysinfo/dialog.cpp feature-bluetooth
+ \dots
+ \snippet ../../examples/sysinfo/dialog.cpp feature test
+
+
+*/
+
+
+
diff --git a/doc/src/examples/undocumented.qdoc b/doc/src/examples/undocumented.qdoc
index c1d13168a5..0732063646 100644
--- a/doc/src/examples/undocumented.qdoc
+++ b/doc/src/examples/undocumented.qdoc
@@ -45,13 +45,8 @@
*/
/*!
- \example cameracapture
- \title Camera Capture Example
-*/
-
-/*!
- \example declarative
- \title Declarative Example
+ \example declarative-sfw-dialer
+ \title Declarative Service Framework Example
*/
/*!
@@ -105,11 +100,6 @@
*/
/*!
- \example streamplayer
- \title Stream Player Example
-*/
-
-/*!
\example sysinfo
\title System Information Example
*/
diff --git a/doc/src/future.qdoc b/doc/src/future.qdoc
index 26da8e450b..5ce8e517f6 100644
--- a/doc/src/future.qdoc
+++ b/doc/src/future.qdoc
@@ -50,19 +50,12 @@
\target {Management of Versit Documents}
\section1 Management of Versit Documents
-\l{Versit API}{Versit API Documentation}
+\l{Versit API (technology preview)}{Versit API Documentation}
Versit Classes.
\annotatedlist versit
-\target {Camera Support}
-\section1 Camera Support (Multimedia)
-
-\annotatedlist camera
-
-
-
*/
diff --git a/doc/src/images/Rotation_angles.png b/doc/src/images/Rotation_angles.png
new file mode 100644
index 0000000000..313e5590f4
--- /dev/null
+++ b/doc/src/images/Rotation_angles.png
Binary files differ
diff --git a/doc/src/images/sample-phonebook-1.png b/doc/src/images/sample-phonebook-1.png
new file mode 100644
index 0000000000..86fb454ef0
--- /dev/null
+++ b/doc/src/images/sample-phonebook-1.png
Binary files differ
diff --git a/doc/src/images/sample-phonebook-2.png b/doc/src/images/sample-phonebook-2.png
new file mode 100644
index 0000000000..a2eab955e9
--- /dev/null
+++ b/doc/src/images/sample-phonebook-2.png
Binary files differ
diff --git a/doc/src/images/sample-phonebook-3.png b/doc/src/images/sample-phonebook-3.png
new file mode 100644
index 0000000000..e526f4ec24
--- /dev/null
+++ b/doc/src/images/sample-phonebook-3.png
Binary files differ
diff --git a/doc/src/images/sample-phonebook-4.png b/doc/src/images/sample-phonebook-4.png
new file mode 100644
index 0000000000..41d67f6c94
--- /dev/null
+++ b/doc/src/images/sample-phonebook-4.png
Binary files differ
diff --git a/doc/src/images/sysinfo.png b/doc/src/images/sysinfo.png
new file mode 100644
index 0000000000..2245d6ea82
--- /dev/null
+++ b/doc/src/images/sysinfo.png
Binary files differ
diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc
index d8eebed8d4..e88b2df0ff 100644
--- a/doc/src/index.qdoc
+++ b/doc/src/index.qdoc
@@ -88,8 +88,7 @@
\o Services built on top of these APIs would include Internet
applications such as email and web browsing.
\o Multimedia features enable image and video capture with audio ,
- audio recording, and the playing of music or video clips. However,
- camera ability is not part of this release.
+ audio recording, and the playing of music or video clips.
\o Location will make the device aware of its geographical location
to support GIS applications.
\o Publish-Subscribe enables communication between separate objects
@@ -253,14 +252,6 @@
are proud of the work we have done on this project and want to show
not only what we are delivering now but what is around the corner.
- \section2 Camera
-
- A technology preview of the Camera API will be made available with this
- release. The Camera will be treated separately from Multimedia at this
- stage because of the different level of maturity of the APIs.
-
- For more details see the \l {preview.html#Camera-Support}{Camera classes}.
-
\section2 Sensors
An API for accessing hardware sensors. This covers both high-level
@@ -287,223 +278,206 @@
\raw HTML
- <table border="0">
+ <table cellpadding="2" cellspacing="1" border="0">
+ <tbody>
<tr>
<td>Color</td>
<td>Explanation</td>
+
</tr>
- <tr>
- <td bgcolor="green"></td>
- <td>A functional backend for the API on the platform exists inside QDF source code.</td>
- </tr>
- <tr>
- <td bgcolor="lightgreen"></td>
- <td>A functional backend for the API on the platform is being worked however it is not functionally complete.</td>
- </tr>
+ </tr>
+ <tr>
+ <td bgcolor="green"></td>
+ <td>A functional backend for the API on the platform is complete.</td>
+ </tr>
+ <tr>
+ <td bgcolor="yellow"></td>
+ <td>A functional backend for the API on the platform is being worked however it is not functionally complete.</td>
+
+ </tr>
+ <tr>
<tr>
<td bgcolor="lightgray"></td>
- <td>A functional backend for the API on the platform is being worked on.
- At this point it is far from functionally complete or there is no platform specific code inside QDF source code.</td>
+ <td>A functional backend for the API on the platform is being worked on. At this point it is far from functionally complete or there is no platform specific code inside QDF source code.</td>
</tr>
<tr>
<td bgcolor="gray"></td>
- <td>A functional backend for the API on the platform is not being worked on. It is
- possible for others to implement and integrate support.</td>
+ <td>A functional backend for the API on the platform is not being worked on. It is possible for others to implement and integrate support.</td>
</tr>
+ </tbody>
</table>
<br>
- <table border="1">
+
+ <b>Tier 1 Platforms</b><br>
+ Primary platforms are the main focus of Mobility API. There platforms are frequently tested by our unit test suite and other internal testing tools. However, the timeline of availability for each backend is subject to change.
+ <br>
+ <b>Tier 2 Platforms</b><br>
+ Secondary platforms include future direction of Qt Mobility API. Contributions to these platforms are welcome.
+ <br>
+ <br>
+ <table align="center" cellpadding="2" cellspacing="1" border="1">
+ <tbody>
<tr>
- <td></td>
- <td><b>API Maturity Level</b></td>
- <td><b>S60 3rd Edition, Feature Pack 1</b></td>
- <td><b>S60 3rd Edition, Feature Pack 2</b></td>
- <td><b>S60 5th Edition</b></td>
- <td><b>Symbian 9.2</b></td>
- <td><b>Symbian 10.1</b></td>
- <td><b>Maemo 5</b></td>
- <td><b>Maemo 6</b></td>
- <td><b>Windows CE/Mobile<b></td>
- <td><b>Windows XP/Vista</b></td>
- <td><b>Linux</b></td>
- <td><b>Mac OS X</b></td>
- <td><b>Other</b></td>
+ <td rowspan="2">&nbsp;</td>
+ <td rowspan="2"><b>API Maturity Level</b></td>
+ <td colspan="5" align="center" bgcolor="#96E066"><b>Tier 1 Platforms</b></td>
+
+ <td colspan="4" align="center" bgcolor="#96E066"><b>Tier 2 Platforms</b></td>
+ </tr>
+ <tr>
+ <td width="9%"><b>S60 3rd Edition, Feature Pack 1</b></td>
+ <td width="9%"><b>S60 3rd Edition, Feature Pack 2</b></td>
+ <td width="9%"><b>S60 5th Edition</b></td>
+ <td width="9%"><b>Symbian^3</b></td>
+ <td width="9%"><b>Maemo 5</b></td>
+ <td width="9%"><b>Windows CE/Mobile<b></b></b></td>
+ <td width="9%"><b>Windows XP/Vista</b></td>
+
+ <td width="9%"><b>Linux</b></td>
+ <td width="9%"><b>Mac OS X</b></td>
</tr>
<tr>
<td>Service Framework (in-process)</td>
- <td>BETA</td>
- <td bgcolor="green"></td>
+ <td>FINAL</td>
<td bgcolor="green"></td>
<td bgcolor="green"></td>
<td bgcolor="green"></td>
<td bgcolor="green"></td>
- <td bgcolor="lightgreen"></td>
<td bgcolor="green"></td>
<td bgcolor="green"></td>
<td bgcolor="green"></td>
+
<td bgcolor="green"></td>
<td bgcolor="green"></td>
- <td></td>
</tr>
<tr>
<td>Messaging</td>
- <td>BETA</td>
+ <td>FINAL</td>
+ <td bgcolor="green"></td>
+ <td bgcolor="green"></td>
+ <td bgcolor="green"></td>
+ <td bgcolor="green"></td>
+ <td bgcolor="green"></td>
<td bgcolor="green"></td>
<td bgcolor="green"></td>
<td bgcolor="green"></td>
- <td bgcolor="lightgray"></td>
- <td bgcolor="lightgray"></td>
- <td bgcolor="lightgray"></td>
- <td bgcolor="lightgreen"></td>
- <td bgcolor="green">Using MAPI and Pocket Outlook Object Model</td>
- <td bgcolor="lightgreen">Using MAPI and Outlook</td>
- <td bgcolor="green">Using QMF</td>
<td bgcolor="gray"></td>
- <td></td>
+
</tr>
<tr>
<td>Bearer Management</td>
- <td>BETA</td>
- <td bgcolor="green"></td>
+ <td>FINAL</td>
<td bgcolor="green"></td>
<td bgcolor="green"></td>
<td bgcolor="green"></td>
<td bgcolor="green"></td>
- <td bgcolor="lightgray"></td>
<td bgcolor="green"></td>
<td bgcolor="green"></td>
<td bgcolor="green"></td>
<td bgcolor="green"></td>
<td bgcolor="green"></td>
- <td></td>
</tr>
<tr>
+
<td>Publish and Subscribe</td>
- <td>BETA</td>
+ <td>FINAL</td>
+ <td bgcolor="green"></td>
+ <td bgcolor="green"></td>
<td bgcolor="green"></td>
<td bgcolor="green"></td>
<td bgcolor="green"></td>
- <td bgcolor="lightgreen"></td>
- <td bgcolor="lightgreen"></td>
- <td bgcolor="lightgreen"></td>
- <td bgcolor="lightgreen"></td>
<td bgcolor="green"></td>
<td bgcolor="green"></td>
<td bgcolor="green"></td>
<td bgcolor="green"></td>
- <td></td>
</tr>
<tr>
<td>Contacts</td>
- <td>BETA</td>
- <td bgcolor="green"></td>
- <td bgcolor="green"></td>
+
+ <td>FINAL</td>
+ <td bgcolor="yellow"></td>
<td bgcolor="green"></td>
<td bgcolor="green"></td>
<td bgcolor="green"></td>
- <td bgcolor="lightgray"></td>
<td bgcolor="green"></td>
<td bgcolor="green"></td>
<td bgcolor="gray"></td>
<td bgcolor="gray"></td>
<td bgcolor="gray"></td>
- <td></td>
</tr>
<tr>
<td>Location</td>
- <td>BETA</td>
+ <td>FINAL</td>
+
+ <td bgcolor="green"></td>
+ <td bgcolor="green"></td>
+ <td bgcolor="green"></td>
<td bgcolor="green"></td>
<td bgcolor="green"></td>
<td bgcolor="green"></td>
<td bgcolor="green"></td>
<td bgcolor="green"></td>
- <td bgcolor="lightgreen"></td>
- <td bgcolor="lightgreen"></td>
<td bgcolor="green"></td>
- <td bgcolor="gray"></td>
- <td bgcolor="gray"></td>
- <td bgcolor="gray"></td>
- <td bgcolor="green">NMEA data provider support</td>
</tr>
<tr>
<td>Multimedia</td>
<td>BETA</td>
- <td bgcolor="lightgreen"></td>
- <td bgcolor="lightgreen"></td>
- <td bgcolor="lightgreen"></td>
- <td bgcolor="lightgreen"></td>
- <td bgcolor="lightgray"></td>
- <td bgcolor="lightgray"></td>
- <td bgcolor="lightgray"></td>
- <td bgcolor="lightgray"></td>
- <td bgcolor="lightgray"></td>
- <td bgcolor="green">GStreamer</td>
- <td bgcolor="lightgray"></td>
- <td></td>
+ <td bgcolor="green"></td>
+ <td bgcolor="green"></td>
+
+ <td bgcolor="green"></td>
+ <td bgcolor="green"></td>
+ <td bgcolor="green"></td>
+ <td bgcolor="gray"></td>
+ <td bgcolor="green"></td>
+ <td bgcolor="green"></td>
+ <td bgcolor="green"></td>
</tr>
<tr>
<td>System Information</td>
- <td>BETA</td>
+ <td>FINAL</td>
+ <td bgcolor="green"></td>
+ <td bgcolor="green"></td>
+ <td bgcolor="green"></td>
+ <td bgcolor="green"></td>
+
<td bgcolor="green"></td>
<td bgcolor="green"></td>
<td bgcolor="green"></td>
- <td bgcolor="lightgreen"></td>
- <td bgcolor="lightgreen"></td>
- <td bgcolor="lightgreen"></td>
- <td bgcolor="lightgray"></td>
- <td bgcolor="lightgreen"></td>
<td bgcolor="green"></td>
<td bgcolor="green"></td>
- <td bgcolor="lightgreen"></td>
- <td></td>
</tr>
+ <tr>
<td>Sensors</td>
- <td>TP</td>
- <td bgcolor="lightgray"></td>
- <td bgcolor="lightgray"></td>
- <td bgcolor="lightgray"></td>
- <td bgcolor="lightgray"></td>
- <td bgcolor="lightgray"></td>
- <td bgcolor="lightgreen"></td>
+ <td>BETA</td>
+ <td bgcolor="yellow"></td>
<td bgcolor="lightgray"></td>
- <td bgcolor="gray"></td>
- <td bgcolor="gray"></td>
- <td bgcolor="gray"></td>
- <td bgcolor="gray"></td>
- <td></td>
- </tr>
- <td>Camera</td>
- <td>TP</td>
- <td bgcolor="lightgreen"></td>
- <td bgcolor="lightgreen"></td>
- <td bgcolor="lightgreen"></td>
<td bgcolor="lightgray"></td>
<td bgcolor="lightgray"></td>
+ <td bgcolor="green"></td>
<td bgcolor="gray"></td>
+
<td bgcolor="gray"></td>
<td bgcolor="gray"></td>
<td bgcolor="gray"></td>
- <td bgcolor="lightgreen"></td>
- <td bgcolor="gray"></td>
- <td></td>
</tr>
+ <tr>
<td>Versit</td>
- <td>TP</td>
- <td bgcolor="lightgreen"></td>
- <td bgcolor="lightgreen"></td>
- <td bgcolor="lightgreen"></td>
- <td bgcolor="lightgreen"></td>
- <td bgcolor="lightgreen"></td>
- <td bgcolor="lightgreen"></td>
- <td bgcolor="lightgreen"></td>
- <td bgcolor="lightgreen"></td>
- <td bgcolor="lightgreen"></td>
- <td bgcolor="lightgreen"></td>
- <td bgcolor="lightgreen"></td>
- <td></td>
+ <td>FINAL</td>
+ <td bgcolor="green"></td>
+ <td bgcolor="green"></td>
+ <td bgcolor="green"></td>
+ <td bgcolor="green"></td>
+ <td bgcolor="green"></td>
+ <td bgcolor="green"></td>
+ <td bgcolor="green"></td>
+ <td bgcolor="green"></td>
+
+ <td bgcolor="green"></td>
</tr>
- <p />
- <p />
+ <p></p>
+ <p></p>
+ </tbody>
</table>
<br>
diff --git a/doc/src/installation.qdoc b/doc/src/installation.qdoc
index b896522fb1..90c55228cf 100644
--- a/doc/src/installation.qdoc
+++ b/doc/src/installation.qdoc
@@ -52,9 +52,11 @@ To begin, obtain the most recent distrubution package from
\section1 Pre-requisites & Dependencies
To install Qt Mobility you must already have installed
Qt 4.6 or higher, visit \l {http://get.qt.nokia.com} to obtain
-a copy. Furthermore perl must be installed and available in the environment path. Windows
-environments may require the installtion of a perl interpreter such as
-\l {http://www.activestate.com/activeperl} {ActivePerl}.
+a copy. Furthermore perl must be installed and available in the environment path.
+Windows environments may require the installation of a perl interpreter such as
+\l {http://www.activestate.com/activeperl} {ActivePerl}. On the Maemo 5 (Fremantle)
+platform PR1.2 firmware release or newer is required.
+
Qt Mobility Project APIs are comprised of a number of domains. Some of
these domains have dependencies and these are outlined below:
@@ -75,7 +77,8 @@ these domains have dependencies and these are outlined below:
\o N
\row
\o Contacts
- \o The Maemo 6 backend depends on \l {http://maemo.gitorious.org/maemo-af/libqttracker}{libqttracker}.
+ \o The Maemo 5 backend depends on \l {http://maemo.org/packages/view/libosso-abook/}{libosso-abook}.
+ The Maemo 6 backend depends on \l {http://maemo.gitorious.org/maemo-af/libqttracker}{libqttracker}.
Other components offered by the Maemo 6 platform may be required in order to support the full functionality of the Maemo 6 backend.
\o Y
\o N
@@ -87,7 +90,7 @@ these domains have dependencies and these are outlined below:
The LBT library is not publicly available at the time of writing.
The developer documentation for \l {http://carbidehelp.nokia.com/help/index.jsp?topic=/S60_5th_Edition_Cpp_Developers_Library/GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6/html/Location_ServicesIndexPage.html}
{S60 Location Services} is probably the best source for LBT availability updates, as it
- will be updated when the library is relased.
+ will be updated when the library is released.
\o N(Y)
\o N
\row
@@ -101,7 +104,7 @@ these domains have dependencies and these are outlined below:
functionality will not work if you are using the MinGW compiler.
The messaging API SMS/MMS functionality requires that the platform
- provides SMS/MMS facilites. Email functionality requires that an email
+ provides SMS/MMS facilities. Email functionality requires that an email
account is available on the platform.
\o N
\o Y
@@ -112,8 +115,6 @@ these domains have dependencies and these are outlined below:
On all platforms, QML elements for sound effects and music and video playing are exported if QtDeclarative (auto-detected) is available.
On all platforms, additional rendering paths are enabled of QtOpenGL (auto-detected) is available.
-
- On Maemo 5, QtMedia depends on \l {http://www.pulseaudio.org}{PulseAudio} if QtDeclarative is used.
\o
\o
\row
@@ -125,15 +126,10 @@ these domains have dependencies and these are outlined below:
The gstengine plugin for Linux and Maemo depends on gstreamer-0.10 (>= 0.10.19), gstreamer-audio-0.10 (>= 0.10.19), gstreamer-base-0.10 (>= 0.10.19), gstreamer-interfaces-0.10 (>= 0.10.19) and gstreamer-video-0.10 (>= 0.10.19).
If asound (auto-detected) is available, ALSA device detection will be enabled.
- The phononengine plugin for Mac depends on phonon.
-
The QtMobilityMultimediaEngine for Symbian depends on QtMultimedia.
To enable all mediaservices on symbian one must download sdk plugins. Sdk plugins are available at \l http://wiki.forum.nokia.com/index.php/SDK_API_Plug-in
For 5th edition sdk plugins are installed with installer (all at once), but for FP1 and FP2 devices a zip is provided. You will need following plugins to compile all features:
- MediaPlayerEngine (MediaPlayerUtilityAPI for 3rd FP2), AudioRoutingAPI , Tuner Utility (only for 3rd FP1) Radio Utility API (for 3rd FP2 and 5th ed), SymbianOnboardCameraAdvancedSettingsAPI(for 3rd FP2 and 5th ed) and
- autofocus_extension_library_s60_3rd_ed for (3rd FP1 included in the camera example \l http://sw.nokia.com/id/2f492479-ac8c-4c3e-aa90-cc883e190d83/S60_Platform_Camera_Example_with_AutoFocus_Support_v2_2_en.zip)
- To get camera service working you will also need camera wrapper from Forum Nokia at \l http://sw.nokia.com/id/1cde08b0-1f57-41ba-851b-776c43fdec6c/S60_Platform_Camera_Example_v3_0_en.zip Example application contains camerawrapper binaries and sis for the device
-
+ MediaPlayerEngine (MediaPlayerUtilityAPI for 3rd FP2), AudioRoutingAPI , Tuner Utility (only for 3rd FP1) Radio Utility API (for 3rd FP2 and 5th ed).
\o Y
\o N
\row
diff --git a/doc/src/legal/gpl.qdoc b/doc/src/legal/gpl.qdoc
index 906dde62a2..82eeea1313 100644
--- a/doc/src/legal/gpl.qdoc
+++ b/doc/src/legal/gpl.qdoc
@@ -39,23 +39,6 @@
**
****************************************************************************/
-/*! \page gpl.html
-\title GNU General Public License (GPL)
-\ingroup licensing
-\brief About the GPL license used for Qt.
-
-The Qt GUI Toolkit is Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).\br
-Contact: Nokia Corporation (qt-info@nokia.com)
-
-Qt is available under the GPL.
-
-\section1 The GNU General Public License (Version 3)
-
-Reference: \l{GNU General Public License}
-
-\snippet doc/src/snippets/code/doc_src_gpl.qdoc GPL v3
-*/
-
/*! \page lgpl.html
\title GNU Lesser General Public License (LGPL)
\ingroup licensing
diff --git a/doc/src/legal/licenses.qdoc b/doc/src/legal/licenses.qdoc
deleted file mode 100644
index 7830047f9c..0000000000
--- a/doc/src/legal/licenses.qdoc
+++ /dev/null
@@ -1,495 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \group licensing
- \title Licensing Information
- \brief Information about licenses and licensing issues.
-
- These documents include information about Qt's licenses and the licenses
- of third party components used in Qt.
-
- \generatelist{related}
-*/
-
-
-/*!
- \page licenses.html
- \title Other Licenses Used in Qt
- \ingroup licensing
- \brief Information about other licenses used for Qt components and third-party code.
-
- Qt contains some code that is not provided under the
- \l{GNU General Public License (GPL)},
- \l{GNU Lesser General Public License (LGPL)} or the
- \l{Qt Commercial Editions}{Qt Commercial License Agreement}, but rather under
- specific licenses from the original authors. Some pieces of code were developed
- by Nokia and others originated from third parties.
- This page lists the licenses used, names the authors, and links
- to the places where it is used.
-
- Nokia gratefully acknowledges these and other contributions
- to Qt. We recommend that programs that use Qt also acknowledge
- these contributions, and quote these license statements in an
- appendix to the documentation.
-
- See also: \l{Licenses for Fonts Used in Qt for Embedded Linux}
-
- \generatelist legalese
-
- \hr
-
- Copyright (C) 2000-2004, International Business Machines\br
- Corporation and others. All Rights Reserved.\br
- Copyright (C) 2007 Apple Inc. All rights reserved.
-
- Permission is hereby granted, free of charge, to any person obtaining a copy of this
- software and associated documentation files (the "Software"), to deal in the Software
- without restriction, including without limitation the rights to use, copy, modify,
- merge, publish, distribute, and/or sell copies of the Software, and to permit persons
- to whom the Software is furnished to do so, provided that the above copyright notice(s)
- and this permission notice appear in all copies of the Software and that both the above
- copyright notice(s) and this permission notice appear in supporting documentation.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
- INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
- PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER
- OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR
- CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
- Except as contained in this notice, the name of a copyright holder shall not be used in
- advertising or otherwise to promote the sale, use or other dealings in this Software
- without prior written authorization of the copyright holder.
-
- \list
- \o Parts of WebKit used by the QtWebKit module
- \endlist
-
- \hr
-
- Copyright (c) 1998 by Bjorn Reese <breese@imada.ou.dk>
-
- Permission to use, copy, modify, and distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
- copyright notice and this permission notice appear in all copies.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
- WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
- CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
-
- \list
- \o Parts of the QCrashHandler class
- \endlist
-
- \hr
-
- Parts of the FreeType projects have been modified and put into Qt
- for use in the painting subsystem. These files are ftraster.h,
- ftraster.c, ftgrays.h and ftgrays.c. The following modifications
- has been made to these files:
-
- \list
- \i Renamed FT_ and ft_ symbols to QT_FT_ and qt_ft_ to avoid name
- conflicts in \c{qrasterdefs_p.h}.
- \i Removed parts of code not relevant when compiled with
- _STANDALONE_ defined.
- \i Changed behavior in \c{ftraster.c} to follow X polygon filling
- rules.
- \i Implemented support in \c{ftraster.c} for winding / odd even
- polygon fill rules.
- \i Replaced bitmap generation with span generation in \c{ftraster.c}.
- \i Renamed \c{ftraster.h} as \c{qblackraster_p.h}.
- \i Renamed \c{ftraster.c} as \c{qblackraster.c}.
- \i Renamed \c{ftgrays.h} as \c{qgrayraster_p.h}.
- \i Renamed \c{ftgrays.c} as \c{qgrayraster.c}.
- \endlist
-
- See \c src/3rdparty/freetype/docs/FTL.txt and \c
- src/3rdparty/freetype/docs/GPL.txt for license details.
-
- \hr
-
- Copyright (c) 1985, 1986, 1987 X Consortium
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
-
- Except as contained in this notice, the name of the X Consortium shall
- not be used in advertising or otherwise to promote the sale, use or
- other dealings in this Software without prior written authorization
- from the X Consortium.
-
- \list
- \o Parts of the Q3PolygonScanner class used in Qt for Embedded Linux
- \endlist
-
- \hr
-
- Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
- Permission to use, copy, modify, and distribute this software and its
- documentation for any purpose and without fee is hereby granted,
- provided that the above copyright notice appear in all copies and that
- both that copyright notice and this permission notice appear in
- supporting documentation, and that the name of Digital not be
- used in advertising or publicity pertaining to distribution of the
- software without specific, written prior permission.
-
- DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- SOFTWARE.
-
- \list
- \o Parts of the Q3PolygonScanner class used in Qt for Embedded Linux
- \endlist
-
- \hr
-
- Copyright 1985, 1987, 1998 The Open Group
-
- Permission to use, copy, modify, distribute, and sell this software and its
- documentation for any purpose is hereby granted without fee, provided that
- the above copyright notice appear in all copies and that both that
- copyright notice and this permission notice appear in supporting
- documentation.
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- Except as contained in this notice, the name of The Open Group shall not be
- used in advertising or otherwise to promote the sale, use or other dealings
- in this Software without prior written authorization from The Open Group.
-
- \list
- \o Parts of the internal QKeyMapper class on X11 platforms
- \endlist
-
- \hr
-
- pnmscale.c - read a portable anymap and scale it
-
- Copyright (C) 1989, 1991 by Jef Poskanzer.
-
- Permission to use, copy, modify, and distribute this software and its
- documentation for any purpose and without fee is hereby granted, provided
- that the above copyright notice appear in all copies and that both that
- copyright notice and this permission notice appear in supporting
- documentation. This software is provided "as is" without express or
- implied warranty.
-
- \list
- \o Parts of the internal QImageSmoothScaler::scale() function use code
- based on pnmscale.c by Jef Poskanzer.
- \endlist
-
- \hr
-
- jQuery JavaScript Library v1.3.2
- http://jquery.com/
-
- Copyright (c) 2009 John Resig
- Dual licensed under the MIT and GPL licenses.
- http://docs.jquery.com/License
-
- Sizzle CSS Selector Engine - v0.9.3
- Copyright 2009, The Dojo Foundation
- Released under the MIT, BSD, and GPL Licenses.
- More information: http://sizzlejs.com/
-
- \list
- \o examples/webkit/fancybrowser/jquery.min.js
- \endlist
-*/
-
-/*!
- \page licenses-fonts.html
- \title Licenses for Fonts Used in Qt for Embedded Linux
- \ingroup qt-embedded-linux
- \ingroup licensing
- \brief Information about the licenses of fonts supplied with Qt for Embedded Linux.
-
- The fonts supplied with Qt for Embedded Linux have been obtained under a
- variety of different licenses listed below.
-
- \tableofcontents
-
- See also: \l{Other Licenses Used in Qt}
-
- \section1 Adobe Helvetica
-
- Copyright 1984-1989, 1994 Adobe Systems Incorporated.
- Copyright 1988, 1994 Digital Equipment Corporation.
-
- Adobe is a trademark of Adobe Systems Incorporated which may be
- registered in certain jurisdictions.
- Permission to use these trademarks is hereby granted only in
- association with the images described in this file.
-
- Permission to use, copy, modify, distribute and sell this software
- and its documentation for any purpose and without fee is hereby
- granted, provided that the above copyright notices appear in all
- copies and that both those copyright notices and this permission
- notice appear in supporting documentation, and that the names of
- Adobe Systems and Digital Equipment Corporation not be used in
- advertising or publicity pertaining to distribution of the software
- without specific, written prior permission. Adobe Systems and
- Digital Equipment Corporation make no representations about the
- suitability of this software for any purpose. It is provided "as
- is" without express or implied warranty.
-
- \section1 Adobe Utopia
-
- Permission to use, reproduce, display and distribute the listed
- typefaces is hereby granted, provided that the Adobe Copyright notice
- appears in all whole and partial copies of the software and that the
- following trademark symbol and attribution appear in all unmodified
- copies of the software:
-
- Copyright (c) 1989 Adobe Systems Incorporated
- Utopia (R)
- Utopia is a registered trademark of Adobe Systems Incorporated
-
- The Utopia font
- Copyright (c) 1989, 1991 Adobe Systems Incorporated. All Rights
- Reserved.Utopia is a registered trademark of Adobe Systems
- Incorporated.
-
- \section1 Babelfish
-
- \snippet doc/src/snippets/code/doc_src_licenses.qdoc 1
-
- \section1 Bigelow & Holmes Luxi
-
- Luxi fonts copyright (c) 2001 by Bigelow & Holmes Inc. Luxi font
- instruction code copyright (c) 2001 by URW++ GmbH. All Rights
- Reserved. Luxi is a registered trademark of Bigelow & Holmes Inc.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of these Fonts and associated documentation files (the "Font
- Software"), to deal in the Font Software, including without
- limitation the rights to use, copy, merge, publish, distribute,
- sublicense, and/or sell copies of the Font Software, and to permit
- persons to whom the Font Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright and trademark notices and this permission notice
- shall be included in all copies of one or more of the Font Software.
-
- The Font Software may not be modified, altered, or added to, and in
- particular the designs of glyphs or characters in the Fonts may not
- be modified nor may additional glyphs or characters be added to the
- Fonts. This License becomes null and void when the Fonts or Font
- Software have been modified.
-
- THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
- OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL
- BIGELOW & HOLMES INC. OR URW++ GMBH. BE LIABLE FOR ANY CLAIM, DAMAGES
- OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT,
- INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF
- CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR
- INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT
- SOFTWARE.
-
- Except as contained in this notice, the names of Bigelow & Holmes
- Inc. and URW++ GmbH. shall not be used in advertising or otherwise to
- promote the sale, use or other dealings in this Font Software without
- prior written authorization from Bigelow & Holmes Inc. and URW++ GmbH.
-
- For further information, contact:
-
- info@urwpp.de
- or
- design@bigelowandholmes.com
-
- \section1 Bitstream Charter and Courier
-
- (c) Copyright 1989-1992, Bitstream Inc., Cambridge, MA.
-
- You are hereby granted permission under all Bitstream propriety rights
- to use, copy, modify, sublicense, sell, and redistribute the 4 Bitstream
- Charter (r) Type 1 outline fonts and the 4 Courier Type 1 outline fonts
- for any purpose and without restriction; provided, that this notice is
- left intact on all copies of such fonts and that Bitstream's trademark
- is acknowledged as shown below on all unmodified copies of the 4 Charter
- Type 1 fonts.
-
- BITSTREAM CHARTER is a registered trademark of Bitstream Inc.
-
- \section1 Bitstream Vera
-
- Copyright (c) 2003 by Bitstream, Inc.
-
- All Rights Reserved.
-
- Bitstream Vera is a trademark of Bitstream, Inc.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of the fonts accompanying this license ("Fonts") and associated
- documentation files (the "Font Software"), to reproduce and distribute
- the Font Software, including without limitation the rights to use,
- copy, merge, publish, distribute, and/or sell copies of the Font
- Software, and to permit persons to whom the Font Software is furnished
- to do so, subject to the following conditions:
-
- The above copyright and trademark notices and this permission notice
- shall be included in all copies of one or more of the Font Software
- typefaces.
-
- The Font Software may be modified, altered, or added to, and in
- particular the designs of glyphs or characters in the Fonts may be
- modified and additional glyphs or characters may be added to the
- Fonts, only if the fonts are renamed to names not containing either
- the words "Bitstream" or the word "Vera".
-
- This License becomes null and void to the extent applicable to Fonts
- or Font Software that has been modified and is distributed under the
- "Bitstream Vera" names.
-
- The Font Software may be sold as part of a larger software package but
- no copy of one or more of the Font Software typefaces may be sold by
- itself.
-
- THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
- OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL
- BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL,
- OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT
- SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
-
- Except as contained in this notice, the names of Gnome, the Gnome
- Foundation, and Bitstream Inc., shall not be used in advertising or
- otherwise to promote the sale, use or other dealings in this Font
- Software without prior written authorization from the Gnome Foundation
- or Bitstream Inc., respectively. For further information, contact:
- fonts at gnome dot org.
-
- \omit
- http://www.gnome.org/fonts/#Final_Bitstream_Vera_Fonts
- \endomit
-
- See also:
- \l{http://www.bitstream.com/font_rendering/products/dev_fonts/vera.html}{Vera Open Source Fonts}
-
- \section1 Cursor
-
- The Cursor font is distributed with the following declaration:
-
- \i{Copyright (c) 2000 XFree86, Inc.}
-
- \section1 DejaVu Fonts
-
- DejaVu fonts come with the following copyright statement:
-
- Fonts are (c) Bitstream (see below). DejaVu changes are in public domain. Glyphs imported from Arev fonts are (c) Tavmjung Bah (see below)
-
- \snippet doc/src/snippets/code/doc_src_licenses.qdoc 2
-
- \section1 Fixed Fonts
-
- The 5x7 and 6x13 fonts each contain the following copyright notice:
-
- \i{Public domain font. Share and enjoy.}
-
- \section1 IBM Courier
-
- IBM Courier - Copyright (c) IBM Corporation 1990, 1991
-
- You are hereby granted permission under the terms of the IBM/MIT X Consortium
- Courier Typefont agreement to execute, reproduce, distribute, display, market,
- sell and otherwise transfer copies of the IBM Courier font to third parties.
-
- The font is provided "AS IS" without charge. NO WARRANTIES OR INDEMNIFICATION
- ARE GIVEN, WHETHER EXPRESS OR IMPLIED INCLUDING, BUT LIMITED TO THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-
- \section1 Micro
-
- The Micro font contains the following copyright notice:
-
- \i{Public domain font. Share and enjoy.}
-
- \section1 Unifont
-
- The Unifont font was originally obtained from
- \l{http://www.czyborra.com/}{Roman Czyborra} under the following license:
-
- \i{All of my works you find here are freeware. You may freely copy, use, quote,
- modify or redistribute them as long as you properly attribute my contribution
- and have given a quick thought about whether Roman might perhaps be interested
- to read what you did with his stuff. Horizontal rules don't apply.}
-*/
diff --git a/doc/src/location.qdoc b/doc/src/location.qdoc
index 942ad595ff..8f9035e51a 100644
--- a/doc/src/location.qdoc
+++ b/doc/src/location.qdoc
@@ -61,6 +61,12 @@ data using arbitrary data sources.
\tableofcontents
+\section1 Namespace
+
+The QtMobility API's are placed into the \i{QtMobility} namespace. This is done
+to facilitate the future migration of Mobility API's into Qt. See the
+\l {Quickstart Example}{Quickstart guide} for an example on how the
+namespace impacts on application development.
\section1 Location Positioning
diff --git a/doc/src/messaging.qdoc b/doc/src/messaging.qdoc
index 38863e4abb..06e2b31d8e 100644
--- a/doc/src/messaging.qdoc
+++ b/doc/src/messaging.qdoc
@@ -55,6 +55,12 @@ or respond to an existing message.
\tableofcontents
+\section1 Namespace
+
+The QtMobility API's are placed into the \i{QtMobility} namespace. This is done
+to facilitate the future migration of Mobility API's into Qt. See the
+\l {Quickstart Example}{Quickstart guide} for an example on how the
+namespace impacts on application development.
\section1 Overview
@@ -219,5 +225,19 @@ only one thread may access the data concurrently.
The library abstracts the storage method used to store messaging data.
+\section1 Examples
+
+\section2 Keep In Touch
+
+The \l {keepintouch}{Keep In Touch} example shows how to extract useful
+information from the messages stored by the system.
+
+
+\section2 Service Actions
+
+The \l {serviceactions}{Service Actions} example is a program to demonstrate
+how to compose, send, show, query and retrieve messages, and also react to
+message store events using the Qt Mobility Messaging API.
+
*/
diff --git a/doc/src/multimedia.qdoc b/doc/src/multimedia.qdoc
index 4ac4e93baa..8d8cdf47aa 100644
--- a/doc/src/multimedia.qdoc
+++ b/doc/src/multimedia.qdoc
@@ -56,20 +56,21 @@
collection of media content.
\ingroup mobility
-\warning The camera support classes are in a technology preview state. They
-are in development and subject to change.
-
Multimedia provides a set of APIs that allow the developer to play, record
and manage a collection of media content. It is dependent on the
QtMultimedia API. This API is planned to replace Phonon at a later stage.
\tableofcontents
+\section1 Namespace
+The QtMobility API's are placed into the \i{QtMobility} namespace. This is done
+to facilitate the future migration of Mobility API's into Qt. See the
+\l {Quickstart Example}{Quickstart guide} for an example on how the
+namespace impacts on application development.
\section1 Overview
-
This library will require Qt 4.6.
This API delivers an easy to use interface to multimedia functions whether
@@ -113,9 +114,6 @@ recording application, excluding the supporting user interface code.
\section2 Video
-Support for the camera is not included in this release but will be part of
-a future update.
-
For playing and manipulating video sources the API enables us to easily
implement a player application. If we examine the \l{player}{Player}
example we see that the implementation of a simple media player requires a
diff --git a/doc/src/preview.qdoc b/doc/src/preview.qdoc
index 078e2346b8..a8ba76947a 100644
--- a/doc/src/preview.qdoc
+++ b/doc/src/preview.qdoc
@@ -49,20 +49,13 @@
\target {Management of Versit Documents}
\section1 Management of Versit Documents
-\l{Versit API}{Versit API Documentation}
+\l{Versit API (technology preview)}{Versit API Documentation}
An overview is available for the \l{versit.html}{Versit API}
Versit Classes.
\annotatedlist versit
-
-\target {Camera Support}
-\section1 Camera Support (Multimedia)
-
-\annotatedlist camera
-
-
\target {Sensor Classes}
\section1 Sensor API
diff --git a/doc/src/publ-subs.qdoc b/doc/src/publ-subs.qdoc
index 7c2ba17b82..1466058118 100644
--- a/doc/src/publ-subs.qdoc
+++ b/doc/src/publ-subs.qdoc
@@ -54,6 +54,12 @@ navigate through and subscribe to change notifications.
\tableofcontents
+\section1 Namespace
+
+The QtMobility API's are placed into the \i{QtMobility} namespace. This is done
+to facilitate the future migration of Mobility API's into Qt. See the
+\l {Quickstart Example}{Quickstart guide} for an example on how the
+namespace impacts on application development.
\section1 Overview
@@ -141,6 +147,11 @@ The Shared Memory layer has an order of 0x10000000.
\o The Symbian Settings layer provides a permanent Value Space backing store using the
Symbian OS' Properties (RProperty) as well as Central Repository files (CRepository).
The Symbian Settings layer has an order of 0.
+ \row
+ \o \l{GConf Layer}
+ \o The GConf Layer provides a permanent Value Space backing store using the
+ GConf configuration system designed for the GNOME desktop environment.
+ The GConf Layer has an order of 0 and it's the only available layer in Maemo 5.
\endtable
The Value Space has support for both client/server and peer-to-peer layer architectures. If a
@@ -236,6 +247,19 @@ QByteArray and stored as 8-bit byte form by SymbianSettingslayer. The serializat
is transparent operation to the API user but may cause interoperatibility issues with native Symbian codes
that access the same data directly. The maximum size of the bytearray is 65535 for RPropery backing store.
+\section2 GConf Layer
+
+Publish and Subscribe API can be used to access the GConf configuration system.
+
+\section3 Limitations
+
+GConf can natively store only a limited set of QVariant data types. These types are Bool, Int, Double,
+String, StringList and List. When publishing other data types the values are automatically serialized
+and stored to GConf as BASE64 encoded strings. When reading these values they are automatically
+converted back to the original data types. The serialization/deserialization is transparent operation
+to the API user but may cause interoperatibility issues with native applications that access the same
+data directly.
+
\section1 Examples
\section2 Publish and Subscribe
diff --git a/doc/src/qt.index b/doc/src/qt.index
index f55f4de421..47eac8d8dc 100644
--- a/doc/src/qt.index
+++ b/doc/src/qt.index
@@ -75925,20 +75925,6 @@
</page>
<page access="public" status="commendable" name="licensing" href="licensing.html" subtype="group" title="Licensing Information" fulltitle="Licensing Information" subtitle="" location="licenses.qdoc"/>
<page access="public" status="commendable" name="licenses.html" href="licenses.html" subtype="page" title="Other Licenses Used in Qt" fulltitle="Other Licenses Used in Qt" subtitle="" location="licenses.qdoc"/>
- <page access="public" status="commendable" name="licenses-fonts.html" href="licenses-fonts.html" subtype="page" title="Licenses for Fonts Used in Qt for Embedded Linux" fulltitle="Licenses for Fonts Used in Qt for Embedded Linux" subtitle="" location="licenses.qdoc">
- <contents name="adobe-helvetica" title="Adobe Helvetica" level="1"/>
- <contents name="adobe-utopia" title="Adobe Utopia" level="1"/>
- <contents name="babelfish" title="Babelfish" level="1"/>
- <contents name="bigelow-holmes-luxi" title="Bigelow &amp; Holmes Luxi" level="1"/>
- <contents name="bitstream-charter-and-courier" title="Bitstream Charter and Courier" level="1"/>
- <contents name="bitstream-vera" title="Bitstream Vera" level="1"/>
- <contents name="cursor" title="Cursor" level="1"/>
- <contents name="dejavu-fonts" title="DejaVu Fonts" level="1"/>
- <contents name="fixed-fonts" title="Fixed Fonts" level="1"/>
- <contents name="ibm-courier" title="IBM Courier" level="1"/>
- <contents name="micro" title="Micro" level="1"/>
- <contents name="unifont" title="Unifont" level="1"/>
- </page>
<page access="public" status="commendable" name="phonon/capabilities" href="phonon-capabilities.html" subtype="example" title="Capabilities Example" fulltitle="Capabilities Example" subtitle="" location="capabilitiesexample.qdoc">
<contents name="window-class-definition" title="Window Class Definition" level="1"/>
<contents name="window-class-implementation" title="Window Class Implementation" level="1"/>
diff --git a/doc/src/qtmobility-known-issues.qdoc b/doc/src/qtmobility-known-issues.qdoc
index 40ef8c8ce3..ccd6c1bd78 100644
--- a/doc/src/qtmobility-known-issues.qdoc
+++ b/doc/src/qtmobility-known-issues.qdoc
@@ -113,7 +113,6 @@ Of all supported Symbian platforms S60 3.2+ platforms enjoy the most comprehensi
\o Play video from local file.
\o Retrieve meta data information from currently playing media. Following tags supported: title, artist, comment, genre, year, copyright, album, composer, albumtrack, audiobitrate, videobitrate, duration, content type.
\o Media recording: audio capture to specified file from phone microphone or phone call (call needs to be started before media recording).
- \o Experimental camera support.
\endlist
@@ -186,15 +185,12 @@ Support is present for the following System Info API classes
\section2 Multimedia API
\list
- \o \bold {Camera support classes in Multimedia API is in technology preview state.}
\o S60: S60 specific play list not supported
\o S60: Device specific play list management not supported.
\o S60: Audio capture does not support currently any special features like format, encoding etc...
\o S60: seeking is not working properly
\o S60: video size does not remain constant in repeated plays
\o S60: full screen video not working OK
- \o S60: Calling QStillImageCapture::capture() with an existing file name results in Symbian:-11 error.
- \o S60: advancedsettings focus, whitebalance, exposure,etc don't work with 3.2/5.0. 3.1 Devices do not support them at all.
\o S60: 3.2.3 (E75 for example) player example don't work.
\o Windows desktop: wmp multimedia plugin does not display video with Windows Media Player 10 or 12
\endlist
diff --git a/doc/src/sensors.qdoc b/doc/src/sensors.qdoc
index fbaf8d91fe..7c3be953eb 100644
--- a/doc/src/sensors.qdoc
+++ b/doc/src/sensors.qdoc
@@ -55,6 +55,13 @@ and low-level, real-time sensors such as accelerometer data.
\tableofcontents
+\section1 Namespace
+The QtMobility API's are placed into the \i{QtMobility} namespace. This is done
+to facilitate the future migration of Mobility API's into Qt. See the
+\l {Quickstart Example}{Quickstart guide} for an example on how the
+namespace impacts on application development.
+
+
\section1 Sensor Types
On a device there can be many types of sensors. Not all of the types that the Sensors API
@@ -89,18 +96,7 @@ The life cycle of a sensor is typically:
Here is an example of creating a sensor on the heap and on the stack.
-\code
-// On the heap (deleted when this object is deleted)
-QAccelerationSensor *sensor = new QAccelerationSensor(this);
-
-// On the stack (deleted when the current scope ends)
-QOrientationSensor orient_sensor;
-\endcode
-
-The API supports sensors that poll for their data and sensors that push
-data to the app as it arrives. Each sensor will support certain update
-policies that determine how your application can receive the data from
-the sensor.
+\snippet snippets/sensors/creating.cpp Creating a sensor
\section1 Accessing sensor data in a generic fashion
@@ -122,26 +118,16 @@ For example, here is an example of how you can access a property of the accelero
This code does not require any compile-time links to \l QAccelerometer or
\l QAccelerometerReading.
-\code
-// start the sensor
-QSensor sensor;
-sensor.setType("QAccelerometer");
-sensor.start();
-
-// later
-QSensorReading *reading = sensor.reading();
-qreal x = reading->property("x").value<qreal>();
-qreal y = reading->value(1).value<qreal>();
-\endcode
+\snippet snippets/sensors/start.cpp Starting a sensor
You can discover all of this information at runtime too. The sensor_explorer example
shows you information about available sensors.
\section1 Front end, back end
-The Sensors API has a front end, for application developers to use and a backend,
+The Sensors API has a front end, for application developers to use and a back end,
where device implementors write code to access their hardware. As an application
-developer you do not need to access the backend though it may be useful to understand
+developer you do not need to access the back end though it may be useful to understand
how it works.
Commands from the application are delivered through QSensor and then down to the
@@ -149,7 +135,7 @@ device plugin. Data comes back through the QSensorReading class.
\image sensors-overview.png
-More information about the backend can be found in \l{Sensors Backend}.
+More information about the back end can be found in \l{Sensors Backend}.
\section1 Main Classes
@@ -198,7 +184,7 @@ QSensor instances talk to a backend object. Backends are usually supplied
with the QtSensors library for a specific device although third party
backends may be used as well. A backend may talk
directly to hardware or it may talk to a system service. In some instances
-it may even talk to another backend or to another device.
+it may even talk to another sensor.
An example of this is the orientation sensor backend that talks to an
accelerometer to determine the orientation.
@@ -226,33 +212,7 @@ that multiple sensor backends cannot be in a plugin.
An example follows.
-\code
-#include "mybackend.h"
-#include <qsensorplugin.h>
-#include <qsensormanager.h>
-
-class MyPluginClass : public QtMobility::QSensorPluginInterface, public QtMobility::QSensorBackendFactory
-{
- Q_OBJECT
- Q_INTERFACES(QtMobility::QSensorPluginInterface)
-public:
- void registerSensors()
- {
- QSensorManager::registerBackend(QAccelerationSensor::type, MyBackend::id, this);
- }
-
- QSensorBackend *createBackend(QSensor *sensor)
- {
- if (sensor->identifier() == MyBackend::id)
- return new MyBackend(sensor);
- return 0;
- }
-};
-
-Q_EXPORT_PLUGIN2(libmy_plugin_file_name, MyPluginClass);
-
-#include "main.moc"
-\endcode
+\snippet snippets/sensors/plugin.cpp Plugin
If you woud like to build a backend into a library or application you can use the
REGISTER_STATIC_PLUGIN() macro although it may not work in all situations as it
diff --git a/doc/src/sf.qdoc b/doc/src/sf.qdoc
index 8d7b809fa2..d5fbe3abcd 100644
--- a/doc/src/sf.qdoc
+++ b/doc/src/sf.qdoc
@@ -65,6 +65,13 @@ arbitrary services.
\tableofcontents
+\section1 Namespace
+
+The QtMobility API's are placed into the \i{QtMobility} namespace. This is done
+to facilitate the future migration of Mobility API's into Qt. See the
+\l {Quickstart Example}{Quickstart guide} for an example on how the
+namespace impacts on application development.
+
\section1 Introduction
@@ -180,6 +187,9 @@ utilised by introspecting the object, using Qt's meta object system.
However in some use cases it may be more convenient to
directly interact with the service object by including the service header
and/or linking against the service provider. The main advantage is compile time checking.
+Its disdvantage is that client and service must share the implementation of the service object via a library
+they link against or via a common header file. Note that such sharing breaks the fundamental ServiceFramework
+principle of separating clients from service as changes of the service type may require changes to both, services and clients.
The subsequent code snippet demonstrates how this may look like:
diff --git a/doc/src/si.qdoc b/doc/src/si.qdoc
index 833b476e50..ece40e753c 100644
--- a/doc/src/si.qdoc
+++ b/doc/src/si.qdoc
@@ -64,6 +64,13 @@
The System Information API provides a set of APIs to discover system
related information and capabilities.
+\section1 Namespace
+
+The QtMobility API's are placed into the \i{QtMobility} namespace. This is done
+to facilitate the future migration of Mobility API's into Qt. See the
+\l {Quickstart Example}{Quickstart guide} for an example on how the
+namespace impacts on application development.
+
\section1 Overview
The System Information API returns the system information related to a
number of categories.
@@ -125,14 +132,10 @@ If the NetworkManager backend is required run qmake as follows:
The backend selection is expected to disappear once the API is integrated into Qt.
-\section1 Reference documentation
+\section1 Examples
-\section2 Examples
+\section2 System Information Example
-\list
- \o \l{File Manager Plugin Example}
- \o \l{Bluetooth Transfer Plugin Example}
- \o \l{Service Browser Example}
-\endlist
+The \l{sysinfo}{System Information} example demonstrates how an application can very easily access the system information of the device.
*/
diff --git a/doc/src/snippets/code/doc_src_gpl.qdoc b/doc/src/snippets/code/doc_src_gpl.qdoc
deleted file mode 100644
index dbd9ce8fdc..0000000000
--- a/doc/src/snippets/code/doc_src_gpl.qdoc
+++ /dev/null
@@ -1,720 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//! [GPL v3]
- You may use, distribute and copy the Qt GUI Toolkit under the terms of
- GNU General Public License version 3, which is displayed below.
-
- GNU GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users. We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors. You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights. Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received. You must make sure that they, too, receive
-or can get the source code. And you must show them these terms so they
-know their rights.
-
- Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
- For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software. For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
- Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so. This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software. The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable. Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products. If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
- Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary. To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
-
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
- Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
- Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Use with the GNU Affero General Public License.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
- If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
- <program> Copyright (C) <year> <name of author>
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
- You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<http://www.gnu.org/licenses/>.
-
- The GNU General Public License does not permit incorporating your program
-into proprietary programs. If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License. But first, please read
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
-//! [GPL v3]
diff --git a/doc/src/snippets/code/doc_src_licenses.qdoc b/doc/src/snippets/code/doc_src_licenses.qdoc
deleted file mode 100644
index cd3f096a2f..0000000000
--- a/doc/src/snippets/code/doc_src_licenses.qdoc
+++ /dev/null
@@ -1,149 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//! [1]
- [utopiafonts] 1999 free font
- ----------------------------------------------------
-
- this font is provided free for personal or commercial use,
- it can be redistributed however it may not be sold.
- ----------------------------------------------------
- (C) 1999 utopiafonts. dale_thorpe@bssc.edu.au
-//! [1]
-
-
-//! [2]
- Bitstream Vera Fonts Copyright
- ------------------------------
-
- Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is
- a trademark of Bitstream, Inc.
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of the fonts accompanying this license ("Fonts") and associated
- documentation files (the "Font Software"), to reproduce and distribute the
- Font Software, including without limitation the rights to use, copy, merge,
- publish, distribute, and/or sell copies of the Font Software, and to permit
- persons to whom the Font Software is furnished to do so, subject to the
- following conditions:
-
- The above copyright and trademark notices and this permission notice shall
- be included in all copies of one or more of the Font Software typefaces.
-
- The Font Software may be modified, altered, or added to, and in particular
- the designs of glyphs or characters in the Fonts may be modified and
- additional glyphs or characters may be added to the Fonts, only if the fonts
- are renamed to names not containing either the words "Bitstream" or the word
- "Vera".
-
- This License becomes null and void to the extent applicable to Fonts or Font
- Software that has been modified and is distributed under the "Bitstream
- Vera" names.
-
- The Font Software may be sold as part of a larger software package but no
- copy of one or more of the Font Software typefaces may be sold by itself.
-
- THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
- TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME
- FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
- ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE
- FONT SOFTWARE.
-
- Except as contained in this notice, the names of Gnome, the Gnome
- Foundation, and Bitstream Inc., shall not be used in advertising or
- otherwise to promote the sale, use or other dealings in this Font Software
- without prior written authorization from the Gnome Foundation or Bitstream
- Inc., respectively. For further information, contact: fonts at gnome dot
- org.
-
- Arev Fonts Copyright
- ------------------------------
-
- Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of the fonts accompanying this license ("Fonts") and
- associated documentation files (the "Font Software"), to reproduce
- and distribute the modifications to the Bitstream Vera Font Software,
- including without limitation the rights to use, copy, merge, publish,
- distribute, and/or sell copies of the Font Software, and to permit
- persons to whom the Font Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright and trademark notices and this permission notice
- shall be included in all copies of one or more of the Font Software
- typefaces.
-
- The Font Software may be modified, altered, or added to, and in
- particular the designs of glyphs or characters in the Fonts may be
- modified and additional glyphs or characters may be added to the
- Fonts, only if the fonts are renamed to names not containing either
- the words "Tavmjong Bah" or the word "Arev".
-
- This License becomes null and void to the extent applicable to Fonts
- or Font Software that has been modified and is distributed under the
- "Tavmjong Bah Arev" names.
-
- The Font Software may be sold as part of a larger software package but
- no copy of one or more of the Font Software typefaces may be sold by
- itself.
-
- THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
- OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL
- TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
- DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
- OTHER DEALINGS IN THE FONT SOFTWARE.
-
- Except as contained in this notice, the name of Tavmjong Bah shall not
- be used in advertising or otherwise to promote the sale, use or other
- dealings in this Font Software without prior written authorization
- from Tavmjong Bah. For further information, contact: tavmjong @ free
- . fr.
-
-//! [2]
diff --git a/doc/src/snippets/multimedia-snippets/player.cpp b/doc/src/snippets/multimedia-snippets/player.cpp
index 645fc19249..2942a5e70f 100644
--- a/doc/src/snippets/multimedia-snippets/player.cpp
+++ b/doc/src/snippets/multimedia-snippets/player.cpp
@@ -177,14 +177,14 @@ void Player::positionChanged(qint64 progress)
void Player::metaDataChanged()
{
- //qDebug() << "update metadata" << player->metaData(QtMedia::Title).toString();
+ //qDebug() << "update metadata" << player->metaData(QtMediaServices::Title).toString();
if (player->isMetaDataAvailable()) {
setTrackInfo(QString("%1 - %2")
- .arg(player->metaData(QtMedia::AlbumArtist).toString())
- .arg(player->metaData(QtMedia::Title).toString()));
+ .arg(player->metaData(QtMediaServices::AlbumArtist).toString())
+ .arg(player->metaData(QtMediaServices::Title).toString()));
if (coverLabel) {
- QUrl url = player->metaData(QtMedia::CoverArtUrlLarge).value<QUrl>();
+ QUrl url = player->metaData(QtMediaServices::CoverArtUrlLarge).value<QUrl>();
coverLabel->setPixmap(!url.isEmpty()
? QPixmap(url.toString())
diff --git a/doc/src/snippets/qtcontactsdocsample/qtcontactsdocsample.cpp b/doc/src/snippets/qtcontactsdocsample/qtcontactsdocsample.cpp
index f140341f8c..fca0d86ae6 100644
--- a/doc/src/snippets/qtcontactsdocsample/qtcontactsdocsample.cpp
+++ b/doc/src/snippets/qtcontactsdocsample/qtcontactsdocsample.cpp
@@ -39,6 +39,7 @@
**
****************************************************************************/
+#include "qmobilityglobal.h"
#include "qtcontacts.h"
#include "requestexample.h"
@@ -47,8 +48,13 @@
#include <QObject>
#include <QTimer>
+QTM_USE_NAMESPACE
+
+static void loadDefault();
+static void queryManagerCapabilities();
+static void contactDetailManipulation();
+static void contactManipulation();
static void addContact(QContactManager*);
-static void callContact(QContactManager*);
static void matchCall(QContactManager*, const QString&);
static void viewSpecificDetail(QContactManager*);
static void viewDetails(QContactManager*);
@@ -58,10 +64,8 @@ static void editView(QContactManager*);
static void loadManager();
static void loadManagerWithParameters();
-int main(int argc, char *argv[])
+int stopCompilerWarnings()
{
- QCoreApplication app(argc, argv);
-
// manager configuration examples
loadManager();
loadManagerWithParameters();
@@ -69,7 +73,6 @@ int main(int argc, char *argv[])
// synchronous API examples
QContactManager* cm = new QContactManager();
addContact(cm);
- callContact(cm);
matchCall(cm, "111-222-333"); // unknown number.
matchCall(cm, "12345678"); // alice's number.
viewSpecificDetail(cm);
@@ -82,12 +85,194 @@ int main(int argc, char *argv[])
RequestExample re;
re.setManager(cm);
QTimer::singleShot(10, &re, SLOT(performRequest()));
- app.exec();
delete cm;
+ // more doc snippet examples
+ loadDefault();
+ queryManagerCapabilities();
+ contactDetailManipulation();
+ contactManipulation();
+
+ // async doc snippet examples
+ AsyncRequestExample example;
+ QTimer::singleShot(10, &example, SLOT(performRequests()));
+
return 0;
}
+
+void loadDefault()
+{
+//! [Loading the default manager for the platform]
+ QContactManager stackDefaultContactManager;
+//! [Loading the default manager for the platform]
+
+//! [Loading the default manager for the platform on heap]
+ QContactManager *heapDefaultContactManager = new QContactManager;
+ // ... perform contact manipulation
+ delete heapDefaultContactManager;
+//! [Loading the default manager for the platform on heap]
+}
+
+void queryManagerCapabilities()
+{
+//! [Querying a manager for capabilities]
+ QContactManager cm;
+ qDebug() << "The default manager for the platform is:" << cm.managerName();
+ qDebug() << "It" << (cm.isRelationshipTypeSupported(QContactRelationship::HasAssistant) ? "supports" : "does not support") << "assistant relationships.";
+ qDebug() << "It" << (cm.supportedContactTypes().contains(QContactType::TypeGroup) ? "supports" : "does not support") << "groups.";
+ qDebug() << "It" << (cm.hasFeature(QContactManager::MutableDefinitions) ? "supports" : "does not support") << "mutable detail definitions.";
+//! [Querying a manager for capabilities]
+}
+
+void contactDetailManipulation()
+{
+//! [Adding a detail to a contact]
+ QContact exampleContact;
+
+ QContactName nameDetail;
+ nameDetail.setFirstName("Adam");
+ nameDetail.setLastName("Unlikely");
+
+ QContactPhoneNumber phoneNumberDetail;
+ phoneNumberDetail.setNumber("+123 4567");
+
+ exampleContact.saveDetail(&nameDetail);
+ exampleContact.saveDetail(&phoneNumberDetail);
+//! [Adding a detail to a contact]
+
+//! [Updating a detail in a contact]
+ phoneNumberDetail.setNumber("+123 9876");
+ exampleContact.saveDetail(&phoneNumberDetail); // overwrites old value on save
+//! [Updating a detail in a contact]
+
+//! [Removing a detail from a contact]
+ exampleContact.removeDetail(&phoneNumberDetail);
+//! [Removing a detail from a contact]
+}
+
+void contactManipulation()
+{
+ QContactManager m_manager("memory");
+//! [Synchronously creating a new contact in a manager]
+ QContact exampleContact;
+
+ QContactName nameDetail;
+ nameDetail.setFirstName("Adam");
+ nameDetail.setLastName("Unlikely");
+
+ QContactPhoneNumber phoneNumberDetail;
+ phoneNumberDetail.setNumber("+123 4567");
+
+ exampleContact.saveDetail(&nameDetail);
+ exampleContact.saveDetail(&phoneNumberDetail);
+
+ // save the newly created contact in the manager
+ if (!m_manager.saveContact(&exampleContact))
+ qDebug() << "Error" << m_manager.error() << "occurred whilst saving contact!";
+//! [Synchronously creating a new contact in a manager]
+
+//! [Synchronously filtering contacts from a manager]
+ QList<QContact> results = m_manager.contacts(QContactPhoneNumber::match("+123 4567"));
+//! [Synchronously filtering contacts from a manager]
+
+//! [Synchronously retrieving an existing contact from a manager]
+ QContact existing = m_manager.contact(exampleContact.localId());
+//! [Synchronously retrieving an existing contact from a manager]
+
+//! [Synchronously updating an existing contact in a manager]
+ phoneNumberDetail.setNumber("+123 9876");
+ exampleContact.saveDetail(&phoneNumberDetail);
+ m_manager.saveContact(&exampleContact);
+//! [Synchronously updating an existing contact in a manager]
+
+//! [Synchronously removing a contact from a manager]
+ m_manager.removeContact(exampleContact.localId());
+//! [Synchronously removing a contact from a manager]
+
+//! [Synchronously creating a new relationship between two contacts]
+ // first, create the group and the group member
+ QContact exampleGroup;
+ exampleGroup.setType(QContactType::TypeGroup);
+ QContactNickname groupName;
+ groupName.setNickname("Example Group");
+ exampleGroup.saveDetail(&groupName);
+
+ QContact exampleGroupMember;
+ QContactName groupMemberName;
+ groupMemberName.setFirstName("Member");
+ exampleGroupMember.saveDetail(&groupMemberName);
+
+ // second, save those contacts in the manager
+ QMap<int, QContactManager::Error> errorMap;
+ QList<QContact> saveList;
+ saveList << exampleGroup << exampleGroupMember;
+ m_manager.saveContacts(&saveList, &errorMap);
+
+ // third, create the relationship between those contacts
+ QContactRelationship groupRelationship;
+ groupRelationship.setFirst(exampleGroup.id());
+ groupRelationship.setRelationshipType(QContactRelationship::HasMember);
+ groupRelationship.setSecond(exampleGroupMember.id());
+
+ // finally, save the relationship in the manager
+ m_manager.saveRelationship(&groupRelationship);
+//! [Synchronously creating a new relationship between two contacts]
+
+//! [Synchronously retrieving relationships between contacts]
+ QList<QContactRelationship> groupRelationships = m_manager.relationships(QContactRelationship::HasMember, exampleGroup.id(), QContactRelationship::First);
+ QList<QContactRelationship> result;
+ for (int i = 0; i < groupRelationships.size(); i++) {
+ if (groupRelationships.at(i).second() == exampleGroupMember.id()) {
+ result.append(groupRelationships.at(i));
+ }
+ }
+//! [Synchronously retrieving relationships between contacts]
+
+//! [Retrieving relationships from cache]
+ exampleGroup = m_manager.contact(exampleGroup.localId()); // refresh the group contact
+ groupRelationships = exampleGroup.relationships(QContactRelationship::HasMember);
+ for (int i = 0; i < groupRelationships.size(); i++) {
+ if (groupRelationships.at(i).second() == exampleGroupMember.id()) {
+ result.append(groupRelationships.at(i));
+ }
+ }
+//! [Retrieving relationships from cache]
+
+//! [Synchronously providing a fetch hint]
+ QContactFetchHint hasMemberRelationshipsOnly;
+ hasMemberRelationshipsOnly.setRelationshipTypesHint(QStringList(QContactRelationship::HasMember));
+
+ // retrieve all contacts, with no specified sort order, requesting that
+ // HasMember relationships be included in the cache of result contacts
+ QList<QContact> allContacts = m_manager.contacts(QContactFilter(), QList<QContactSortOrder>(), hasMemberRelationshipsOnly);
+//! [Synchronously providing a fetch hint]
+
+//! [Synchronously removing a relationship]
+ m_manager.removeRelationship(groupRelationship);
+//! [Synchronously removing a relationship]
+
+//! [Synchronously querying the schema supported by a manager]
+ QMap<QString, QContactDetailDefinition> definitions = m_manager.detailDefinitions();
+ qDebug() << "This manager"
+ << (definitions.value(QContactName::DefinitionName).fields().contains(QContactName::FieldCustomLabel) ? "supports" : "does not support")
+ << "the custom label field of QContactName";
+//! [Synchronously querying the schema supported by a manager]
+
+//! [Synchronously modifying the schema supported by a manager]
+ // modify the name definition, adding a patronym field
+ QContactDetailDefinition nameDefinition = definitions.value(QContactName::DefinitionName);
+ QContactDetailFieldDefinition fieldPatronym;
+ fieldPatronym.setDataType(QVariant::String);
+ nameDefinition.insertField("Patronym", fieldPatronym);
+
+ // save the updated definition in the manager if supported...
+ if (m_manager.hasFeature(QContactManager::MutableDefinitions)) {
+ m_manager.saveDetailDefinition(nameDefinition, QContactType::TypeContact);
+ }
+//! [Synchronously modifying the schema supported by a manager]
+}
+
//! [Creating a new contact]
void addContact(QContactManager* cm)
{
@@ -106,7 +291,6 @@ void addContact(QContactManager* cm)
number.setSubTypes(QContactPhoneNumber::SubTypeMobile);
number.setNumber("12345678");
alice.saveDetail(&number);
- alice.setPreferredDetail("DialAction", number);
/* Add a second phone number */
QContactPhoneNumber number2;
@@ -122,24 +306,6 @@ void addContact(QContactManager* cm)
}
//! [Creating a new contact]
-//! [Calling an existing contact]
-void callContact(QContactManager* cm)
-{
- QList<QContactLocalId> contactIds = cm->contactIds();
- QContact a = cm->contact(contactIds.first());
-
- /* Get this contact's first phone number */
- QContactPhoneNumber phn = a.detail<QContactPhoneNumber>();
- if (!phn.isEmpty()) {
- // First, we need some way of retrieving the QObject which provides the action.
- // This may be through the (previously announced) Qt Service Framework:
- //QServiceManager* manager = new QServiceManager();
- //QObject* dialer = manager->loadInterface("com.nokia.qt.mobility.contacts.Dialer");
- //QContactAction* dialerImpl = static_cast<QContactAction*>dialer;
- //dialerImpl->invokeAction(a, phn);
- }
-}
-//! [Calling an existing contact]
//! [Filtering by definition and value]
void matchCall(QContactManager* cm, const QString& incomingCallNbr)
@@ -182,7 +348,7 @@ void viewDetails(QContactManager* cm)
for (int i = 0; i < allDetails.size(); i++) {
QContactDetail detail = allDetails.at(i);
QContactDetailDefinition currentDefinition = cm->detailDefinition(detail.definitionName());
- QMap<QString, QContactDetailDefinitionField> fields = currentDefinition.fields();
+ QMap<QString, QContactDetailFieldDefinition> fields = currentDefinition.fields();
qDebug("\tDetail #%d (%s):", i, detail.definitionName().toAscii().constData());
foreach (const QString& fieldKey, fields.keys()) {
@@ -273,9 +439,9 @@ void addPlugin(QContactManager* cm)
QContactDetailDefinition modified = definitions.value(QContactEmailAddress::DefinitionName);
/* Make our modifications: we add a "Label" field to email addresses */
- QContactDetailDefinitionField newField;
+ QContactDetailFieldDefinition newField;
newField.setDataType(QVariant::String);
- QMap<QString, QContactDetailDefinitionField> fields = modified.fields();
+ QMap<QString, QContactDetailFieldDefinition> fields = modified.fields();
fields.insert("Label", newField);
/* Update the definition with the new field included */
@@ -317,6 +483,27 @@ void editView(QContactManager* cm)
}
//! [Modifying an existing contact]
+void displayLabel()
+{
+ QContactManager *manager = new QContactManager();
+ QContactLocalId myId;
+//! [Updating the display label of a contact]
+ /* Retrieve a contact */
+ QContact c = manager->contact(myId);
+ qDebug() << "Current display label" << c.displayLabel();
+
+ /* Update some fields that might influence the display label */
+ QContactName name = c.detail<QContactName>();
+ name.setFirstName("Abigail");
+ name.setLastName("Arkansas");
+ c.saveDetail(&name);
+
+ /* Update the display label */
+ manager->synthesizeContactDisplayLabel(&c);
+ qDebug() << "Now the label is:" << c.displayLabel();
+//! [Updating the display label of a contact]
+}
+
//! [Asynchronous contact request]
void RequestExample::performRequest()
{
@@ -329,7 +516,9 @@ void RequestExample::performRequest()
// m_fetchRequest was created with m_fetchRequest = new QContactFetchRequest() in the ctor.
m_fetchRequest->setManager(this->m_manager); // m_manager is a QContactManager*.
m_fetchRequest->setFilter(dfil);
- connect(m_fetchRequest, SIGNAL(progress(QContactFetchRequest*,bool)), this, SLOT(printContacts(QContactFetchRequest*,bool)));
+ connect(m_fetchRequest, SIGNAL(resultsAvailable()), this, SLOT(printContacts()));
+ connect(m_fetchRequest, SIGNAL(stateChanged(QContactAbstractRequest::State)),
+ this, SLOT(stateChanged(QContactAbstractRequest::State)));
if (!m_fetchRequest->start()) {
qDebug() << "Unable to request contacts!";
QCoreApplication::exit(0);
@@ -338,68 +527,77 @@ void RequestExample::performRequest()
}
}
-void RequestExample::printContacts(QContactFetchRequest* request, bool appendOnly)
+void RequestExample::printContacts()
{
- QList<QContact> results = request->contacts();
- if (appendOnly) {
- // we know that the results are still in the same order; just display the new results.
- for (m_previousLastIndex += 1; m_previousLastIndex < results.size(); m_previousLastIndex++) {
- qDebug() << "Found another Alice:" << results.at(m_previousLastIndex).displayLabel();
- }
- } else {
- // the order of results has changed; display them all.
- for (m_previousLastIndex = 0; m_previousLastIndex < results.size(); m_previousLastIndex++) {
- qDebug() << "Found another Alice:" << results.at(m_previousLastIndex).displayLabel();
- }
+ QList<QContact> results = m_fetchRequest->contacts();
+ for (m_previousLastIndex = 0; m_previousLastIndex < results.size(); ++m_previousLastIndex) {
+ qDebug() << "Found an Alice:" << results.at(m_previousLastIndex).displayLabel();
}
+}
+void RequestExample::stateChanged(QContactAbstractRequest::State state)
+{
// once we've finished retrieving results, stop processing events.
- if (request->state() == QContactAbstractRequest::FinishedState || request->state() == QContactAbstractRequest::CanceledState) {
+ if (state == QContactAbstractRequest::FinishedState
+ || state == QContactAbstractRequest::CanceledState) {
qDebug() << "Finished displaying asynchronously retrieved contacts!";
QCoreApplication::exit(0);
}
}
//! [Asynchronous contact request]
-//! [Loading a specific manager backend]
-void loadManager()
+
+void shortsnippets()
{
- QContactManager* cm = new QContactManager("KABC");
- QList<QContactLocalId> contactIds = cm->contactIds();
- if (!contactIds.isEmpty()) {
- QContact a = cm->contact(contactIds.first());
- qDebug() << "This manager contains" << a.displayLabel();
- } else {
- qDebug() << "This manager contains no contacts";
+ QContact contact;
+ QContact groupContact;
+ {
+ //! [0]
+ QContactDetail detail = contact.detail(QContactName::DefinitionName);
+ //! [0]
+ //! [1]
+ QContactName name = contact.detail<QContactName>();
+ //! [1]
+ //! [2]
+ QList<QContactDetail> details = contact.details(QContactPhoneNumber::DefinitionName);
+ //! [2]
+ //! [3]
+ QList<QContactPhoneNumber> phoneNumbers = contact.details<QContactPhoneNumber>();
+ //! [3]
+ //! [4]
+ QList<QContactPhoneNumber> homePhones = contact.details<QContactPhoneNumber>("Context", "Home");
+ //! [4]
+ //! [5]
+ QList<QContactRelationship> spouseRelationships = contact.relationships(QContactRelationship::HasSpouse);
+ // For each relationship in spouseRelationships, contact.id() will either be first() or second()
+ //! [5]
+ //! [6]
+ // Who are the members of a group contact?
+ QList<QContactId> groupMembers = groupContact.relatedContacts(QContactRelationship::HasMember, QContactRelationship::Second);
+ // What groups is this contact in?
+ QList<QContactId> contactGroups = contact.relatedContacts(QContactRelationship::HasMember, QContactRelationship::First);
+ // An alternative to QContact::relationships()
+ QList<QContactId> spouses = contact.relatedContacts(QContactRelationship::HasSpouse, QContactRelationship::Either);
+ if (spouses.count() > 1) {
+ // Custom relationship type
+ QList<QContactId> therapists = contact.relatedContacts("HasTherapist", QContactRelationship::Second);
+ }
+ //! [6]
}
-
- delete cm;
}
+
+void loadManager()
+{
+//! [Loading a specific manager backend]
+ QContactManager contactManager("KABC");
//! [Loading a specific manager backend]
+}
-//! [Loading a specific manager backend with parameters]
void loadManagerWithParameters()
{
+//! [Loading a specific manager backend with parameters]
QMap<QString, QString> parameters;
parameters.insert("Settings", "~/.qcontactmanager-kabc-settings.ini");
- QContactManager* cm = new QContactManager("KABC", parameters);
- QMap<QString, QContactDetailDefinition> definitions = cm->detailDefinitions();
-
- qDebug() << "This backend currently supports the following detail definitions:";
- QList<QContactDetailDefinition> allDefinitions = definitions.values();
- foreach (const QContactDetailDefinition& defn, allDefinitions) {
- QMap<QString, QContactDetailDefinitionField> fields = defn.fields();
- foreach (const QString& fieldKey, fields.keys()) {
- QList<QVariant> allowableValues = fields.value(fieldKey).allowableValues();
- qDebug() << "\t" << fieldKey << "(" << fields.value(fieldKey).dataType() << "):";
- if (allowableValues.isEmpty()) {
- qDebug() << "\t\tAny Value Permitted";
- } else {
- qDebug() << allowableValues;
- }
- }
- }
-
- delete cm;
-}
+ QContactManager contactManager("KABC", parameters);
//! [Loading a specific manager backend with parameters]
+}
diff --git a/doc/src/snippets/qtcontactsdocsample/qtcontactsdocsample.pro b/doc/src/snippets/qtcontactsdocsample/qtcontactsdocsample.pro
index acd0c1fd1e..caab1170dd 100644
--- a/doc/src/snippets/qtcontactsdocsample/qtcontactsdocsample.pro
+++ b/doc/src/snippets/qtcontactsdocsample/qtcontactsdocsample.pro
@@ -4,19 +4,24 @@
#
######################################################################
-TEMPLATE = app
+TEMPLATE = lib
TARGET = qtcontactsdocsample
include(../../../../common.pri)
-INCLUDEPATH += ../../../../src/contacts \
- ../../../../src/contacts/requests \
- ../../../../src/contacts/filters \
- ../../../../src/contacts/details
+INCLUDEPATH += ../../../../src/global \
+ ../../../../src/contacts \
+ ../../../../src/contacts/requests \
+ ../../../../src/contacts/filters \
+ ../../../../src/contacts/details
-DESTDIR = $$QT_MOBILITY_BUILD_TREE/bin/examples
+DESTDIR = $$QT_MOBILITY_BUILD_TREE/lib
QMAKE_RPATHDIR+=$$OUTPUT_DIR/lib
-CONFIG += mobility
+CONFIG += mobility console
MOBILITY = contacts
-SOURCES += qtcontactsdocsample.cpp
+SOURCES += qtcontactsdocsample.cpp qtcontactsdocsampleasync.cpp
HEADERS += requestexample.h
+
+symbian {
+ TARGET.EPOCALLOWDLLDATA = 1
+}
diff --git a/doc/src/snippets/qtcontactsdocsample/qtcontactsdocsampleasync.cpp b/doc/src/snippets/qtcontactsdocsample/qtcontactsdocsampleasync.cpp
new file mode 100644
index 0000000000..f848e99d56
--- /dev/null
+++ b/doc/src/snippets/qtcontactsdocsample/qtcontactsdocsampleasync.cpp
@@ -0,0 +1,315 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qmobilityglobal.h"
+#include "qtcontacts.h"
+#include "requestexample.h"
+
+#include <QDebug>
+#include <QCoreApplication>
+#include <QObject>
+#include <QTimer>
+
+QTM_USE_NAMESPACE
+
+AsyncRequestExample::AsyncRequestExample()
+ : QObject()
+{
+ m_manager = new QContactManager("memory");
+}
+
+AsyncRequestExample::~AsyncRequestExample()
+{
+ delete m_manager;
+}
+
+//! [Example of an asynchronous request slot]
+void AsyncRequestExample::contactFetchRequestStateChanged(QContactAbstractRequest::State newState)
+{
+ if (newState == QContactAbstractRequest::FinishedState) {
+ QContactFetchRequest *request = qobject_cast<QContactFetchRequest*>(QObject::sender());
+ if (request->error() != QContactManager::NoError) {
+ qDebug() << "Error" << request->error() << "occurred during fetch request!";
+ return;
+ }
+
+ QList<QContact> results = request->contacts();
+ for (int i = 0; i < results.size(); i++) {
+ qDebug() << "Retrieved contact:" << results.at(i).displayLabel();
+ }
+ } else if (newState == QContactAbstractRequest::CanceledState) {
+ qDebug() << "Fetch operation canceled!";
+ }
+}
+//! [Example of an asynchronous request slot]
+
+void AsyncRequestExample::contactSaveRequestStateChanged(QContactAbstractRequest::State newState)
+{
+ if (newState == QContactAbstractRequest::FinishedState)
+ qDebug() << "Finished saving the contacts!";
+ else if (newState == QContactAbstractRequest::CanceledState)
+ qDebug() << "Save operation canceled!";
+}
+
+void AsyncRequestExample::contactRemoveRequestStateChanged(QContactAbstractRequest::State newState)
+{
+ if (newState == QContactAbstractRequest::FinishedState)
+ qDebug() << "Finished removing the contacts!";
+ else if (newState == QContactAbstractRequest::CanceledState)
+ qDebug() << "Remove operation canceled!";
+}
+
+void AsyncRequestExample::relationshipFetchRequestStateChanged(QContactAbstractRequest::State newState)
+{
+ if (newState == QContactAbstractRequest::FinishedState)
+ qDebug() << "Finished fetching the contacts!";
+ else if (newState == QContactAbstractRequest::CanceledState)
+ qDebug() << "Fetch operation canceled!";
+}
+
+void AsyncRequestExample::relationshipSaveRequestStateChanged(QContactAbstractRequest::State newState)
+{
+ if (newState == QContactAbstractRequest::FinishedState)
+ qDebug() << "Finished saving the contacts!";
+ else if (newState == QContactAbstractRequest::CanceledState)
+ qDebug() << "Save operation canceled!";
+}
+
+void AsyncRequestExample::relationshipRemoveRequestStateChanged(QContactAbstractRequest::State newState)
+{
+ if (newState == QContactAbstractRequest::FinishedState)
+ qDebug() << "Finished removing the contacts!";
+ else if (newState == QContactAbstractRequest::CanceledState)
+ qDebug() << "Remove operation canceled!";
+}
+
+void AsyncRequestExample::definitionFetchRequestStateChanged(QContactAbstractRequest::State newState)
+{
+ if (newState == QContactAbstractRequest::FinishedState)
+ qDebug() << "Finished fetching the contacts!";
+ else if (newState == QContactAbstractRequest::CanceledState)
+ qDebug() << "Fetch operation canceled!";
+}
+
+void AsyncRequestExample::definitionSaveRequestStateChanged(QContactAbstractRequest::State newState)
+{
+ if (newState == QContactAbstractRequest::FinishedState)
+ qDebug() << "Finished saving the contacts!";
+ else if (newState == QContactAbstractRequest::CanceledState)
+ qDebug() << "Save operation canceled!";
+}
+
+void AsyncRequestExample::definitionRemoveRequestStateChanged(QContactAbstractRequest::State newState)
+{
+ if (newState == QContactAbstractRequest::FinishedState)
+ qDebug() << "Finished removing the contacts!";
+ else if (newState == QContactAbstractRequest::CanceledState)
+ qDebug() << "Remove operation canceled!";
+}
+
+void AsyncRequestExample::performRequests()
+{
+//! [Creating a new contact in a manager]
+ QContact exampleContact;
+
+ QContactName nameDetail;
+ nameDetail.setFirstName("Adam");
+ nameDetail.setLastName("Unlikely");
+
+ QContactPhoneNumber phoneNumberDetail;
+ phoneNumberDetail.setNumber("+123 4567");
+
+ exampleContact.saveDetail(&nameDetail);
+ exampleContact.saveDetail(&phoneNumberDetail);
+
+ // save the newly created contact in the manager
+ connect(&m_contactSaveRequest, SIGNAL(stateChanged(QContactAbstractRequest::State)), this, SLOT(contactSaveRequestStateChanged(QContactAbstractRequest::State)));
+ m_contactSaveRequest.setManager(m_manager);
+ m_contactSaveRequest.setContacts(QList<QContact>() << exampleContact);
+ m_contactSaveRequest.start();
+//! [Creating a new contact in a manager]
+
+ m_contactSaveRequest.waitForFinished();
+
+//! [Creating a new contact in a manager waiting until finished]
+ m_contactSaveRequest.setManager(m_manager);
+ m_contactSaveRequest.setContacts(QList<QContact>() << exampleContact);
+ m_contactSaveRequest.start();
+ m_contactSaveRequest.waitForFinished();
+ QList<QContact> savedContacts = m_contactSaveRequest.contacts();
+//! [Creating a new contact in a manager waiting until finished]
+
+//! [Filtering contacts from a manager]
+ connect(&m_contactFetchRequest, SIGNAL(stateChanged(QContactAbstractRequest::State)), this, SLOT(contactFetchRequestStateChanged(QContactAbstractRequest::State)));
+ m_contactFetchRequest.setManager(m_manager);
+ m_contactFetchRequest.setFilter(QContactPhoneNumber::match("+123 4567"));
+ m_contactFetchRequest.start();
+//! [Filtering contacts from a manager]
+
+ m_contactFetchRequest.waitForFinished();
+
+//! [Retrieving an existing contact from a manager]
+ QContactLocalIdFilter idListFilter;
+ idListFilter.setIds(QList<QContactLocalId>() << exampleContact.localId());
+ m_contactFetchRequest.setManager(m_manager);
+ m_contactFetchRequest.setFilter(idListFilter);
+ m_contactFetchRequest.start();
+//! [Retrieving an existing contact from a manager]
+
+ m_contactFetchRequest.waitForFinished();
+
+//! [Updating an existing contact in a manager]
+ phoneNumberDetail.setNumber("+123 9876");
+ exampleContact.saveDetail(&phoneNumberDetail);
+ m_contactSaveRequest.setManager(m_manager);
+ m_contactSaveRequest.setContacts(QList<QContact>() << exampleContact);
+ m_contactSaveRequest.start();
+//! [Updating an existing contact in a manager]
+
+ m_contactFetchRequest.waitForFinished();
+
+//! [Removing a contact from a manager]
+ connect(&m_contactRemoveRequest, SIGNAL(stateChanged(QContactAbstractRequest::State)), this, SLOT(contactRemoveRequestStateChanged(QContactAbstractRequest::State)));
+ m_contactRemoveRequest.setManager(m_manager);
+ m_contactRemoveRequest.setContactIds(QList<QContactLocalId>() << exampleContact.localId());
+ m_contactRemoveRequest.start();
+//! [Removing a contact from a manager]
+
+ m_contactFetchRequest.waitForFinished();
+
+//! [Creating a new relationship between two contacts]
+ // first, create the group and the group member
+ QContact exampleGroup;
+ exampleGroup.setType(QContactType::TypeGroup);
+ QContactNickname groupName;
+ groupName.setNickname("Example Group");
+ exampleGroup.saveDetail(&groupName);
+
+ QContact exampleGroupMember;
+ QContactName groupMemberName;
+ groupMemberName.setFirstName("Member");
+ exampleGroupMember.saveDetail(&groupMemberName);
+
+ // second, save those contacts in the manager
+ QList<QContact> saveList;
+ saveList << exampleGroup << exampleGroupMember;
+ m_contactSaveRequest.setContacts(saveList);
+ m_contactSaveRequest.start();
+ m_contactSaveRequest.waitForFinished();
+
+ // third, create the relationship between those contacts
+ QContactRelationship groupRelationship;
+ groupRelationship.setFirst(exampleGroup.id());
+ groupRelationship.setRelationshipType(QContactRelationship::HasMember);
+ groupRelationship.setSecond(exampleGroupMember.id());
+
+ // finally, save the relationship in the manager
+ connect(&m_relationshipSaveRequest, SIGNAL(stateChanged(QContactAbstractRequest::State)), this, SLOT(relationshipSaveRequestStateChanged(QContactAbstractRequest::State)));
+ m_relationshipSaveRequest.setManager(m_manager);
+ m_relationshipSaveRequest.setRelationships(QList<QContactRelationship>() << groupRelationship);
+ m_relationshipSaveRequest.start();
+//! [Creating a new relationship between two contacts]
+
+ m_contactFetchRequest.waitForFinished();
+
+//! [Retrieving relationships between contacts]
+ connect(&m_relationshipFetchRequest, SIGNAL(stateChanged(QContactAbstractRequest::State)), this, SLOT(relationshipFetchRequestStateChanged(QContactAbstractRequest::State)));
+ m_relationshipFetchRequest.setManager(m_manager);
+ // retrieve the list of relationships between the example group contact and the example member contact
+ // where the group contact is the first contact in the relationship, and the member contact is the
+ // second contact in the relationship. In order to fetch all relationships between them, another
+ // relationship fetch must be performed with their roles reversed, and the results added together.
+ m_relationshipFetchRequest.setFirst(exampleGroup.id());
+ m_relationshipFetchRequest.setSecond(exampleGroupMember.id());
+ m_relationshipFetchRequest.start();
+//! [Retrieving relationships between contacts]
+
+ m_contactFetchRequest.waitForFinished();
+
+//! [Providing a fetch hint]
+ QContactFetchHint hasMemberRelationshipsOnly;
+ hasMemberRelationshipsOnly.setRelationshipTypesHint(QStringList(QContactRelationship::HasMember));
+
+ m_contactFetchRequest.setManager(m_manager);
+ m_contactFetchRequest.setFilter(QContactFilter()); // all contacts
+ m_contactFetchRequest.setFetchHint(hasMemberRelationshipsOnly);
+ m_contactFetchRequest.start();
+//! [Providing a fetch hint]
+
+//! [Removing a relationship]
+ connect(&m_relationshipRemoveRequest, SIGNAL(stateChanged(QContactAbstractRequest::State)), this, SLOT(relationshipRemoveRequestStateChanged(QContactAbstractRequest::State)));
+ m_relationshipRemoveRequest.setManager(m_manager);
+ m_relationshipRemoveRequest.setRelationships(QList<QContactRelationship>() << groupRelationship);
+ m_relationshipRemoveRequest.start();
+//! [Removing a relationship]
+
+ connect(&m_definitionFetchRequest, SIGNAL(stateChanged(QContactAbstractRequest::State)), this, SLOT(definitionFetchRequestStateChanged(QContactAbstractRequest::State)));
+//! [Querying the schema supported by a manager]
+ m_definitionFetchRequest.setManager(m_manager);
+ m_definitionFetchRequest.setDefinitionNames(QStringList(QContactName::DefinitionName));
+ m_definitionFetchRequest.start();
+ m_definitionFetchRequest.waitForFinished();
+ QMap<QString, QContactDetailDefinition> definitions = m_definitionFetchRequest.definitions();
+ qDebug() << "This manager"
+ << (definitions.value(QContactName::DefinitionName).fields().contains(QContactName::FieldCustomLabel) ? "supports" : "does not support")
+ << "the custom label field of QContactName";
+//! [Querying the schema supported by a manager]
+
+ connect(&m_definitionSaveRequest, SIGNAL(stateChanged(QContactAbstractRequest::State)), this, SLOT(definitionSaveRequestStateChanged(QContactAbstractRequest::State)));
+ connect(&m_definitionRemoveRequest, SIGNAL(stateChanged(QContactAbstractRequest::State)), this, SLOT(definitionRemoveRequestStateChanged(QContactAbstractRequest::State)));
+//! [Modifying the schema supported by a manager]
+ // modify the name definition, adding a patronym field
+ QContactDetailDefinition nameDefinition = definitions.value(QContactName::DefinitionName);
+ QContactDetailFieldDefinition fieldPatronym;
+ fieldPatronym.setDataType(QVariant::String);
+ nameDefinition.insertField("Patronym", fieldPatronym);
+
+ // save the updated definition in the manager if supported...
+ if (m_manager->hasFeature(QContactManager::MutableDefinitions)) {
+ m_definitionSaveRequest.setManager(m_manager);
+ m_definitionSaveRequest.setContactType(QContactType::TypeContact);
+ m_definitionSaveRequest.setDefinitions(QList<QContactDetailDefinition>() << nameDefinition);
+ m_definitionSaveRequest.start();
+ }
+//! [Modifying the schema supported by a manager]
+
+ QCoreApplication::exit(0);
+}
diff --git a/doc/src/snippets/qtcontactsdocsample/requestexample.h b/doc/src/snippets/qtcontactsdocsample/requestexample.h
index 3530ce007f..b6f2b284dc 100644
--- a/doc/src/snippets/qtcontactsdocsample/requestexample.h
+++ b/doc/src/snippets/qtcontactsdocsample/requestexample.h
@@ -55,9 +55,46 @@
//
#include <QObject>
-#include "qcontactfetchrequest.h"
+#include "qmobilityglobal.h"
+#include "qcontactrequests.h"
+//! [Class setup]
QTM_USE_NAMESPACE
+class AsyncRequestExample : public QObject
+{
+ Q_OBJECT
+
+public:
+ AsyncRequestExample();
+ ~AsyncRequestExample();
+
+public slots:
+ void performRequests();
+
+private slots:
+ void contactFetchRequestStateChanged(QContactAbstractRequest::State newState);
+ void contactSaveRequestStateChanged(QContactAbstractRequest::State newState);
+ void contactRemoveRequestStateChanged(QContactAbstractRequest::State newState);
+ void relationshipFetchRequestStateChanged(QContactAbstractRequest::State newState);
+ void relationshipSaveRequestStateChanged(QContactAbstractRequest::State newState);
+ void relationshipRemoveRequestStateChanged(QContactAbstractRequest::State newState);
+ void definitionFetchRequestStateChanged(QContactAbstractRequest::State newState);
+ void definitionSaveRequestStateChanged(QContactAbstractRequest::State newState);
+ void definitionRemoveRequestStateChanged(QContactAbstractRequest::State newState);
+
+private:
+ QContactManager *m_manager;
+ QContactFetchRequest m_contactFetchRequest;
+ QContactSaveRequest m_contactSaveRequest;
+ QContactRemoveRequest m_contactRemoveRequest;
+ QContactRelationshipFetchRequest m_relationshipFetchRequest;
+ QContactRelationshipSaveRequest m_relationshipSaveRequest;
+ QContactRelationshipRemoveRequest m_relationshipRemoveRequest;
+ QContactDetailDefinitionFetchRequest m_definitionFetchRequest;
+ QContactDetailDefinitionSaveRequest m_definitionSaveRequest;
+ QContactDetailDefinitionRemoveRequest m_definitionRemoveRequest;
+};
+//! [Class setup]
class RequestExample : public QObject
{
@@ -85,7 +122,8 @@ public:
private slots:
void performRequest();
- void printContacts(QContactFetchRequest* request, bool appendOnly);
+ void printContacts();
+ void stateChanged(QContactAbstractRequest::State state);
private:
int m_previousLastIndex;
diff --git a/doc/src/snippets/qtversitdocsample/qtversitdocsample.cpp b/doc/src/snippets/qtversitdocsample/qtversitdocsample.cpp
new file mode 100644
index 0000000000..e857181734
--- /dev/null
+++ b/doc/src/snippets/qtversitdocsample/qtversitdocsample.cpp
@@ -0,0 +1,345 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qmobilityglobal.h"
+#include "qtcontacts.h"
+#include "qcontacttag.h"
+#include "qversitreader.h"
+#include "qversitcontactimporter.h"
+#include "qversitwriter.h"
+#include "qversitcontactexporter.h"
+#include "qversitdocument.h"
+#include "qversitproperty.h"
+#include "qversitresourcehandler.h"
+#include <QCoreApplication>
+#include <QBuffer>
+#include <QList>
+#include <QFile>
+
+QTM_USE_NAMESPACE
+
+void completeExample();
+void exportExample();
+void importExample();
+
+//! [Detail handler]
+class MyDetailHandler : public QVersitContactExporterDetailHandler {
+public:
+ bool preProcessDetail(const QContact& contact, const QContactDetail& detail,
+ QVersitDocument* document) {
+ Q_UNUSED(contact) Q_UNUSED(detail) Q_UNUSED(document)
+ return false;
+ }
+ bool postProcessDetail(const QContact& contact, const QContactDetail& detail,
+ bool alreadyProcessed, QVersitDocument* document) {
+ Q_UNUSED(contact) Q_UNUSED(document)
+ if (!alreadyProcessed)
+ mUnknownDetails.append(detail);
+ return false;
+ }
+ QList<QContactDetail> mUnknownDetails;
+};
+//! [Detail handler]
+
+//! [Property handler]
+class MyPropertyHandler : public QVersitContactImporterPropertyHandler {
+public:
+ bool preProcessProperty(const QVersitDocument& document, const QVersitProperty& property,
+ int contactIndex, QContact* contact) {
+ Q_UNUSED(document) Q_UNUSED(property) Q_UNUSED(contactIndex) Q_UNUSED(contact)
+ return false;
+ }
+ bool postProcessProperty(const QVersitDocument& document, const QVersitProperty& property,
+ bool alreadyProcessed, int contactIndex, QContact* contact) {
+ Q_UNUSED(document) Q_UNUSED(contactIndex) Q_UNUSED(contact)
+ if (!alreadyProcessed)
+ mUnknownProperties.append(property);
+ return false;
+ }
+ QList<QVersitProperty> mUnknownProperties;
+};
+//! [Property handler]
+
+//! [Resource handler]
+class MyResourceHandler : public QVersitDefaultResourceHandler {
+public:
+ bool saveResource(const QByteArray& contents, const QVersitProperty& property,
+ QString* location) {
+ Q_UNUSED(property)
+ *location = QString::number(qrand());
+ QFile file(*location);
+ file.open(QIODevice::WriteOnly);
+ file.write(contents); // In a real implementation, consider when this file will be deleted.
+ return true;
+ }
+ bool loadResource(const QString& location, QByteArray* contents, QString* mimeType)
+ {
+ return QVersitDefaultResourceHandler::loadResource(location, contents, mimeType);
+ }
+};
+//! [Resource handler]
+
+#if 0
+int main(int argc, char *argv[])
+{
+ Q_UNUSED(argc)
+ Q_UNUSED(argv)
+ completeExample();
+ exportExample();
+ importExample();
+}
+#endif
+
+void completeExample()
+{
+ //! [Complete example]
+ // Create the input vCard
+ QBuffer input;
+ input.open(QBuffer::ReadWrite);
+ QByteArray inputVCard =
+ "BEGIN:VCARD\r\nVERSION:2.1\r\nFN:John Citizen\r\nN:Citizen;John;Q;;\r\nEND:VCARD\r\n";
+ input.write(inputVCard);
+ input.seek(0);
+
+ // Parse the input into QVersitDocuments
+ // Note: we could also use the more convenient QVersitReader(QByteArray) constructor.
+ QVersitReader reader;
+ reader.setDevice(&input);
+ reader.startReading(); // Remember to check the return value
+ reader.waitForFinished();
+
+ // Convert the QVersitDocuments to QContacts
+ QList<QVersitDocument> inputDocuments = reader.results();
+ QVersitContactImporter importer;
+ if (!importer.importDocuments(inputDocuments))
+ return;
+ QList<QContact> contacts = importer.contacts();
+ // Note that the QContacts are not saved yet.
+ // Use QContactManager::saveContacts() for saving if necessary
+
+ // Export the QContacts back to QVersitDocuments
+ QVersitContactExporter exporter;
+ if (!exporter.exportContacts(contacts, QVersitDocument::VCard30Type))
+ return;
+ QList<QVersitDocument> outputDocuments = exporter.documents();
+
+ // Encode the QVersitDocument back to a vCard
+ // Note: we could also use the more convenient QVersitWriter(QByteArray*) constructor.
+ QBuffer output;
+ output.open(QBuffer::ReadWrite);
+ QVersitWriter writer;
+ writer.setDevice(&output);
+ writer.startWriting(outputDocuments); // Remember to check the return value
+ writer.waitForFinished();
+
+ // Read the vCard back to a QByteArray
+ output.seek(0);
+ QByteArray outputVCard(output.readAll());
+ //! [Complete example]
+}
+
+void exportExample()
+{
+ //! [Export example]
+ QVersitContactExporter contactExporter;
+
+ MyDetailHandler detailHandler;
+ contactExporter.setDetailHandler(&detailHandler);
+
+ QContact contact;
+ // Create a name
+ QContactName name;
+ name.setFirstName(QString::fromAscii("John"));
+ contact.saveDetail(&name);
+
+ if (!contactExporter.exportContacts(QList<QContact>() << contact, QVersitDocument::VCard30Type))
+ return;
+ QList<QVersitDocument> versitDocuments = contactExporter.documents();
+
+ // detailHandler.mUnknownDetails now contains the list of unknown details
+ //! [Export example]
+}
+
+void importExample()
+{
+ //! [Import example]
+ QVersitContactImporter importer;
+
+ MyPropertyHandler propertyHandler;
+ importer.setPropertyHandler(&propertyHandler);
+
+ QVersitDocument document;
+
+ QVersitProperty property;
+ property.setName(QString::fromAscii("N"));
+ property.setValue("Citizen;John;Q;;");
+ document.addProperty(property);
+
+ property.setName(QString::fromAscii("X-UNKNOWN-PROPERTY"));
+ property.setValue("some value");
+ document.addProperty(property);
+
+ if (importer.importDocuments(QList<QVersitDocument>() << document)) {
+ QList<QContact> contactList = importer.contacts();
+ // contactList.first() now contains the "N" property as a QContactName
+ // propertyHandler.mUnknownProperties contains the list of unknown properties
+ }
+ //! [Import example]
+}
+
+//! [Import relationship example]
+/*! Adds contacts in \a newContacts into \a manager, converting categories specified
+ with tags into group membership relationships. Note that this implementation uses the
+ synchronous API of QContactManager for clarity. It is recommended that the asynchronous
+ API is used in practice.
+
+ Relationships are added so that if a contact, A, has a tag "b", then a HasMember relationship is
+ created between a group contact in the manager, B with display label "b", and contact A. If there
+ does not exist a group contact with display label "b", one is created.
+ */
+void insertWithGroups(const QList<QContact>& newContacts, QContactManager* manager)
+{
+ // Cache map from group names to QContactIds
+ QMap<QString, QContactId> groupMap;
+
+ foreach (QContact contact, newContacts) {
+ if (!manager->saveContact(&contact))
+ continue; // In practice, better error handling may be required
+ foreach (const QContactTag& tag, contact.details<QContactTag>()) {
+ QString groupName = tag.tag();
+ QContactId groupId;
+ if (groupMap.contains(groupName)) {
+ // We've already seen a group with the right name
+ groupId = groupMap.value(groupName);
+ } else {
+ QContactDetailFilter groupFilter;
+ groupFilter.setDetailDefinitionName(QContactType::DefinitionName);
+ groupFilter.setValue(QLatin1String(QContactType::TypeGroup));
+ groupFilter.setMatchFlags(QContactFilter::MatchExactly);
+ // In practice, some detail other than the display label could be used
+ QContactDetailFilter nameFilter = QContactDisplayLabel::match(groupName);
+ QList<QContactLocalId> matchingGroups = manager->contactIds(groupFilter & nameFilter);
+ if (!matchingGroups.isEmpty()) {
+ // Found an existing group in the manager
+ QContactId groupId;
+ groupId.setManagerUri(manager->managerUri());
+ groupId.setLocalId(matchingGroups.first());
+ groupMap.insert(groupName, groupId);
+ }
+ else {
+ // Make a new group
+ QContact groupContact;
+ QContactName name;
+ name.setCustomLabel(groupName);
+ // Beware that not all managers support custom label
+ groupContact.saveDetail(&name);
+ if (!manager->saveContact(&groupContact))
+ continue; // In practice, better error handling may be required
+ groupId = groupContact.id();
+ groupMap.insert(groupName, groupId);
+ }
+ }
+ // Add the relationship
+ QContactRelationship rel;
+ rel.setFirst(groupId);
+ rel.setRelationshipType(QContactRelationship::HasMember);
+ rel.setSecond(contact.id());
+ manager->saveRelationship(&rel);
+ }
+ }
+}
+//! [Import relationship example]
+
+//! [Export relationship example]
+/*! Adds QContactTag details to the \a contacts, based on the \a relationships.
+
+ Tags are created such that if a group contact, B with display label "b", has a HasMember
+ relationship with a contact, A, then a QContactTag, "b", is added to A.
+
+ Group contacts can be passed in with the \a contacts list. If a contact is part of a group which
+ is not in \a contacts, the \a manager is queried to find them.
+ */
+void createTagsFromGroups(QList<QContact>* contacts,
+ const QList<QContactRelationship>& relationships,
+ const QContactManager* manager)
+{
+ // Map from QContactIds to group names
+ QMap<QContactId, QString> groupMap;
+
+ // Map from QContactIds to indices into the contacts list
+ QMap<QContactId, int> indexMap;
+ // Build up groupMap and indexMap
+ for (int i = 0; i < contacts->size(); ++i) {
+ QContact contact = contacts->at(i);
+ if (contact.type() == QContactType::TypeGroup) {
+ // In practice, you may want to check that there aren't two distinct groups with the
+ // same name, and you may want to use a field other than display label.
+ groupMap.insert(contact.id(), contact.displayLabel());
+ }
+ indexMap.insert(contact.id(), i);
+ }
+
+ // Now add all the tags specified by the group relationships
+ foreach (const QContactRelationship& rel, relationships) {
+ if (rel.relationshipType() == QContactRelationship::HasMember
+ && indexMap.contains(rel.second())) {
+ QString groupName = groupMap.value(rel.first()); // Have we seen the group before?
+ if (groupName.isEmpty()) {
+ // Try and find the group in the manager
+ QContactId groupId = rel.second();
+ QContactFetchHint fetchHint;
+ fetchHint.setDetailDefinitionsHint(QStringList(QContactDisplayLabel::DefinitionName));
+ QContact contact = manager->contact(groupId.localId(), fetchHint);
+ if (!contact.isEmpty()) {
+ groupName = contact.displayLabel();
+ groupMap.insert(groupId, groupName); // Cache the group id/name
+ }
+ }
+ if (!groupName.isEmpty()) {
+ // Add the tag
+ QContactTag tag;
+ tag.setTag(groupName);
+ (*contacts)[indexMap.value(rel.second())].saveDetail(&tag);
+ }
+ }
+ }
+}
+//! [Export relationship example]
diff --git a/doc/src/snippets/qtversitdocsample/qtversitdocsample.pro b/doc/src/snippets/qtversitdocsample/qtversitdocsample.pro
new file mode 100644
index 0000000000..d5c70a69cf
--- /dev/null
+++ b/doc/src/snippets/qtversitdocsample/qtversitdocsample.pro
@@ -0,0 +1,27 @@
+######################################################################
+#
+# Simple example of how to use the versit API
+#
+######################################################################
+
+TEMPLATE = lib
+TARGET = qtversitdocsample
+include(../../../../common.pri)
+INCLUDEPATH += ../../../../src/global \
+ ../../../../src/contacts \
+ ../../../../src/contacts/requests \
+ ../../../../src/contacts/filters \
+ ../../../../src/contacts/details \
+ ../../../../src/versit
+
+DESTDIR = $$QT_MOBILITY_BUILD_TREE/lib
+QMAKE_RPATHDIR+=$$OUTPUT_DIR/lib
+
+CONFIG += mobility console
+MOBILITY = contacts versit
+
+SOURCES += qtversitdocsample.cpp
+
+symbian {
+ TARGET.EPOCALLOWDLLDATA = 1
+}
diff --git a/doc/src/snippets/sensors/creating.cpp b/doc/src/snippets/sensors/creating.cpp
new file mode 100644
index 0000000000..c5a107cae7
--- /dev/null
+++ b/doc/src/snippets/sensors/creating.cpp
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QWidget>
+#include <qaccelerometer.h>
+#include <qorientationsensor.h>
+
+QTM_USE_NAMESPACE
+
+class MyWidget : public QWidget
+{
+ void create();
+};
+
+void MyWidget::create()
+{
+//! [Creating a sensor]
+// On the heap (deleted when this object is deleted)
+QAccelerometer *sensor = new QAccelerometer(this);
+
+// On the stack (deleted when the current scope ends)
+QOrientationSensor orient_sensor;
+//! [Creating a sensor]
+
+ Q_UNUSED(sensor)
+ Q_UNUSED(orient_sensor);
+}
+
diff --git a/doc/src/snippets/sensors/main.cpp b/doc/src/snippets/sensors/main.cpp
new file mode 100644
index 0000000000..c20aa671cc
--- /dev/null
+++ b/doc/src/snippets/sensors/main.cpp
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+int main(int /*argc*/, char ** /*argv*/)
+{
+ return 0;
+}
+
diff --git a/doc/src/snippets/sensors/mybackend.h b/doc/src/snippets/sensors/mybackend.h
new file mode 100644
index 0000000000..e4a918a12a
--- /dev/null
+++ b/doc/src/snippets/sensors/mybackend.h
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef MYBACKEND_H
+#define MYBACKEND_H
+
+#include <qaccelerometer.h>
+#include <qsensorbackend.h>
+
+QTM_USE_NAMESPACE
+
+class MyBackend : public QSensorBackend
+{
+public:
+ MyBackend(QSensor *sensor) : QSensorBackend(sensor) {}
+ void stop() {}
+ void start() {}
+ void poll() {}
+
+ static const char *id;
+};
+
+#endif
diff --git a/doc/src/snippets/sensors/plugin.cpp b/doc/src/snippets/sensors/plugin.cpp
new file mode 100644
index 0000000000..6a69e35c7d
--- /dev/null
+++ b/doc/src/snippets/sensors/plugin.cpp
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "mybackend.h"
+#include <qsensorplugin.h>
+#include <qsensormanager.h>
+
+const char *MyBackend::id = "mybackend";
+
+//! [Plugin]
+class MyPluginClass : public QObject, QSensorPluginInterface, public QSensorBackendFactory
+{
+ Q_OBJECT
+ Q_INTERFACES(QtMobility::QSensorPluginInterface)
+public:
+ void registerSensors()
+ {
+ QSensorManager::registerBackend(QAccelerometer::type, MyBackend::id, this);
+ }
+
+ QSensorBackend *createBackend(QSensor *sensor)
+ {
+ if (sensor->identifier() == MyBackend::id)
+ return new MyBackend(sensor);
+ return 0;
+ }
+};
+//! [Plugin]
+
+//Q_EXPORT_PLUGIN2(libmy_plugin_file_name, MyPluginClass);
+#include "plugin.moc"
diff --git a/doc/src/snippets/sensors/sensors.pro b/doc/src/snippets/sensors/sensors.pro
new file mode 100644
index 0000000000..ee425c5ca6
--- /dev/null
+++ b/doc/src/snippets/sensors/sensors.pro
@@ -0,0 +1,13 @@
+TEMPLATE=app
+TARGET=sensors
+include(../../../../common.pri)
+INCLUDEPATH += ../../../../src/sensors
+SOURCES+=main.cpp\
+ creating.cpp\
+ start.cpp\
+ plugin.cpp
+HEADERS+=mybackend.h
+LIBS+=-rdynamic
+CONFIG+=mobility
+MOBILITY+=sensors
+CONFIG+=strict_flags
diff --git a/doc/src/snippets/sensors/start.cpp b/doc/src/snippets/sensors/start.cpp
new file mode 100644
index 0000000000..2b91297e7e
--- /dev/null
+++ b/doc/src/snippets/sensors/start.cpp
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qsensor.h>
+
+QTM_USE_NAMESPACE
+
+void start()
+{
+//! [Starting a sensor]
+// start the sensor
+QSensor sensor("QAccelerometer");
+sensor.start();
+
+// later
+QSensorReading *reading = sensor.reading();
+qreal x = reading->property("x").value<qreal>();
+qreal y = reading->value(1).value<qreal>();
+//! [Starting a sensor]
+
+ Q_UNUSED(x)
+ Q_UNUSED(y)
+}
diff --git a/doc/src/snippets/snippets.pro b/doc/src/snippets/snippets.pro
index 18f0092716..30a08593b3 100644
--- a/doc/src/snippets/snippets.pro
+++ b/doc/src/snippets/snippets.pro
@@ -2,5 +2,6 @@ include(../../../staticconfig.pri)
TEMPLATE = subdirs
contains(mobility_modules,contacts): SUBDIRS += qtcontactsdocsample
-
contains(mobility_modules,location): SUBDIRS += qtlandmarksdocsample
+contains(mobility_modules,versit): SUBDIRS += qtversitdocsample
+contains(mobility_modules,sensors): SUBDIRS += sensors
diff --git a/doc/src/versit.qdoc b/doc/src/versit.qdoc
index a646602483..4ae289648a 100644
--- a/doc/src/versit.qdoc
+++ b/doc/src/versit.qdoc
@@ -51,7 +51,14 @@ under development and subject to change.
\tableofcontents
-\section1 Overview
+\section1 Namespace
+
+The QtMobility API's are placed into the \i{QtMobility} namespace. This is done
+to facilitate the future migration of Mobility API's into Qt. See the
+\l {Quickstart Example}{Quickstart guide} for an example on how the
+namespace impacts on application development.
+
+\section1 Overview
Versit API provides a set of methods to parse/read (\l{QVersitReader}) and
encode/write (\l{QVersitWriter}) Versit \reg documents such as vCards
(\l http://www.imc.org/pdi/).
@@ -59,49 +66,13 @@ Currently \l{QVersitReader} and \l{QVersitWriter} support
reading and writing vCard 2.1 and 3.0 formats.
Versit API also provides utilities to import (\l{QVersitContactImporter})
-QContacts from versit documents and export (\l{QVersitContactExporter})
-QContacts to versit documents.
+QContacts from Versit documents and export (\l{QVersitContactExporter})
+QContacts to Versit documents.
Versit \reg is a trademark of the Internet Mail Consortium.
\section1 Usage
-\code
-// Create the input vCard
-QBuffer input;
-input.open(QBuffer::ReadWrite);
-QByteArray inputVCard =
- "BEGIN:VCARD\r\nVERSION:2.1\r\nFN:John Citizen\r\nN:Citizen;John;Q;;\r\nEND:VCARD\r\n";
-input.write(inputVCard);
-input.seek(0);
-
-// Parse the input into QVersitDocument(s)
-QVersitReader reader;
-reader.setDevice(&input);
-reader.readAll(); // Remember to check the return value
-
-// Import the QVersitDocument to a QContact
-QVersitDocument inputDocument = reader.result().takeFirst();
-QVersitContactImporter importer;
-QContact contact = importer.importContact(inputDocument);
-// Note that the QContact is not saved yet.
-// Use QContactManager::saveContact() for saving if necessary
-
-// Export the QContact back to a QVersitDocument
-QVersitContactExporter exporter;
-QVersitDocument outputDocument = exporter.exportContact(contact);
-
-// Encode the QVersitDocument back to a vCard
-QBuffer output;
-output.open(QBuffer::ReadWrite);
-QVersitWriter writer;
-writer.setDevice(&output);
-writer.setVersitDocument(outputDocument);
-writer.writeAll(); // Remember to check the return value
-
-// Read the vCard back to a QByteArray
-output.seek(0);
-QByteArray outputVCard(output.readAll());
-\endcode
+\snippet ../../doc/src/snippets/qtversitdocsample/qtversitdocsample.cpp Complete example
\section1 Classes
\list
@@ -116,11 +87,8 @@ QByteArray outputVCard(output.readAll());
\section1 Mapping the vCard constants
vCard properties are mapped to QContactDetails as follows:
-\snippet ../../src/versit/qversitdefs.h Property name mappings
+\snippet ../../src/versit/qversitdefs_p.h Property name mappings
vCard type parameters are mapped to subtypes in QContactDetails as follows:
-\snippet ../../src/versit/qversitdefs.h Property type parameter mappings
-
-File extensions in vCards are mapped to the file system file extensions as follows:
-\snippet ../../src/versit/qversitdefs.h File extension mappings
+\snippet ../../src/versit/qversitdefs_p.h Property type parameter mappings
*/