diff options
| author | abcd <qt-info@nokia.com> | 2010-06-11 11:15:52 +1000 |
|---|---|---|
| committer | abcd <qt-info@nokia.com> | 2010-06-11 11:15:52 +1000 |
| commit | 65a0ce6e97a40e848dd60ba7d7931e4d77d66fe3 (patch) | |
| tree | 05d04c19aade52d54e7f3e10067dee6305f0e66f /doc/src | |
| parent | 84c09aedc7052c35d3d2f29d392310b3f206a36f (diff) | |
| parent | b1e64744dcae67e79e59807d18963080315577eb (diff) | |
Merge branch 'master' of scm.dev.nokia.troll.no:qtmobility/qtmobility
Conflicts:
doc/html/annotated.html
doc/html/classes.html
doc/html/functions.html
doc/html/hierarchy.html
doc/html/location-overview.html
doc/html/qt-mobility-project-library.dcf
doc/html/qt-mobility-project-library.index
doc/html/qtmobility.qhp
examples/examples.pro
src/global/qmobilityglobal.h
Diffstat (limited to 'doc/src')
48 files changed, 1950 insertions, 345 deletions
diff --git a/doc/src/bearermanagement.qdoc b/doc/src/bearermanagement.qdoc index 6a7360b46b..3aa9252e99 100644 --- a/doc/src/bearermanagement.qdoc +++ b/doc/src/bearermanagement.qdoc @@ -233,7 +233,7 @@ closed via \l{QNetworkSession::close()}, respectively. If the session is \l{QNetworkSession::Disconnected}{disconnected} at the time of the \l{QNetworkSession::open()}{open()} call the underlying interface is started; otherwise only the reference counter against the global session is -incremeted. The opposite behavior can be observed when using +incremented. The opposite behavior can be observed when using \l{QNetworkSession::close()}{close()}. In some use cases it may be necessary to turn the interface off despite of diff --git a/doc/src/contacts.qdoc b/doc/src/contacts.qdoc index 28174bbfe9..1b973b9419 100644 --- a/doc/src/contacts.qdoc +++ b/doc/src/contacts.qdoc @@ -69,8 +69,8 @@ applications. \section1 Overview -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 +The QtMobility APIs are placed into the \i{QtMobility} namespace. This is done +to facilitate the future migration of Mobility APIs into Qt. See the \l {Quickstart Example}{Quickstart guide} for an example on how the namespace impacts on application development. @@ -154,7 +154,7 @@ 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 +supported detail definition for that leaf class and modify its behavior accordingly (for example, if the \c CustomLabel field of the QContactName leaf detail is not supported in a particular manager). @@ -256,7 +256,7 @@ 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. +responsive user interface. The synchronous API is offered through the QContactManager class, and includes manipulation of \l{QContact}{contacts}, @@ -310,7 +310,7 @@ To build the library, see the Qt Mobility installation instructions. Several subclasses of \l{QContactDetail} are provided as part of the Qt Mobility Project Contacts API. They are general in design but are intended -to fulfil specific use-cases. Please note that certain backends may +to fulfill specific use-cases. Please note that certain backends may choose not to support one or more of these subclasses as they appear here; they may offer their own which provide similar functionality. diff --git a/doc/src/contactsengines.qdoc b/doc/src/contactsengines.qdoc index d29c58e96a..b920440f0c 100644 --- a/doc/src/contactsengines.qdoc +++ b/doc/src/contactsengines.qdoc @@ -99,41 +99,24 @@ The in-memory engine supports the default schema, and provides all functionality the Qt Mobility Contacts API; however, all data is stored in-memory and is not persisted in any way. -\section3 Symbian 3.1 Engine +\section3 Symbian Engine -The Symbian 3.1 engine identifies itself as the "symbian" engine, but is only available on the -Symbian 3.1 platform. +The Symbian engine identifies itself as the "symbian" engine, and is only available on the +Symbian S60 3.1, S60 3.2, S60 5.0 and Symbian^3 platforms. -The Symbian 3.1 engine supports a modified version of the default schema. -\list - \o TODO: what is the schema supported by this engine. - \o TODO: what functionality is supported by this engine. - \o TODO: is there anything else that clients may need to know? -\endlist - -\section3 Symbian 3.2 Engine +The Symbian engine supports a modified version of the default schema. The schema supported +by the Symbian engine depends on which version of the platform is being used. -The Symbian 3.2 engine identifies itself as the "symbian" engine, but is only available on the -Symbian 3.2 platform. - -The Symbian 3.2 engine supports a modified version of the default schema. -\list - \o TODO: what is the schema supported by this engine. - \o TODO: what functionality is supported by this engine. - \o TODO: is there anything else that clients may need to know? -\endlist +The symbian engine allows clients to use both the asynchronous and synchronous interfaces, +and supports various different relationships, supports setting the self-contact, and +persists all saved data to the system addressbook. -\section3 Symbian 5.0 Engine +\section3 Symbian Sim Engine -The Symbian 5.0 engine identifies itself as the "symbian" engine, but is only available on the -Symbian 5.0 platform. - -The Symbian 5.0 engine supports a modified version of the default schema. -\list - \o TODO: what is the schema supported by this engine. - \o TODO: what functionality is supported by this engine. - \o TODO: is there anything else that clients may need to know? -\endlist +The Symbian Sim engine identifies itself as the "symbiansim" engine, and is only available +on Symbian platforms. It is an extremely limited engine which supports a very small +subset of the default schema, and can be constructed with a "store" parameter to set which contact +store to interact with. The value of the "store" parameter may be either "ADN", "FDN" or "SDN". \section3 Maemo 5 (Fremantle) Engine @@ -170,17 +153,13 @@ The Maemo 5 (Fremantle) engine supports asynchronous and synchronous requests, b group contacts or relationships of any kind. It does not allow clients to set a particular contact as the "self" contact. It persists all data in the system addressbook. -\section3 libQtTracker Engine +\section3 Windows CE Engine -The libQtTracker Engine identifies itself as "qtcontacts-tracker", and is available on any -platform which supports the required libqttracker libraries of the correct version. +The Windows CE engine identifies itself as the "wince" engine, and is only available +on the Windows Mobile 6.0 platform. -The libQtTracker engine supports a modified version of the default schema. -\list - \o TODO: what is the schema supported by this engine. - \o TODO: what functionality is supported by this engine. - \o TODO: is there anything else that clients may need to know? -\endlist +It supports a subset of the default schema, and supports both the asynchronous and synchronous +interfaces to the datastore. It persists saved data to the system addressbook. \section1 Information For Engine Implementors @@ -281,7 +260,7 @@ It may also choose to implement the "single contact" functions: \o QContactManagerEngine::removeContact() \endlist If it does not, the default implementation of those functions will use the batch (plural) versions -of those functions to implement the required behaviour. +of those functions to implement the required behavior. If the engine supports modification of its schema (that is, extension of its definitions at run-time), it must report that it supports the \c QContactManager::MutableDefinitions feature diff --git a/doc/src/contactsschema.qdoc b/doc/src/contactsschema.qdoc index 11bc5ad5e1..3b03898f35 100644 --- a/doc/src/contactsschema.qdoc +++ b/doc/src/contactsschema.qdoc @@ -51,7 +51,7 @@ The \l{Contacts}{Qt Contacts API} makes use of detail leaf classes which provide certain well-known functionality. In order to develop a backend engine which -can service clients or provide synchronisation to other backends, the schema must be +can service clients or provide synchronization to other backends, the schema must be known. \section1 Schema Definition diff --git a/doc/src/contactssync.qdoc b/doc/src/contactssync.qdoc index 840e00bdb0..cafd9ce807 100644 --- a/doc/src/contactssync.qdoc +++ b/doc/src/contactssync.qdoc @@ -52,7 +52,7 @@ 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. +to perform simple requests where performance or user interface 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 @@ -101,7 +101,7 @@ A contact is identified by its QContactId. This id consists of two parts: a URI 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: +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 @@ -234,10 +234,10 @@ datastores. 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 +We assume the existence of a specialized 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 +definition identified by the "Name" identifier. These specialized 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. @@ -246,7 +246,7 @@ supported by a particular definition. \section2 Filtering by detail definition and value -The client utilises a default manager and asks for any contacts with a +The client utilizes 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). diff --git a/doc/src/contactsusage.qdoc b/doc/src/contactsusage.qdoc index fd700b834a..8d8a493c0a 100644 --- a/doc/src/contactsusage.qdoc +++ b/doc/src/contactsusage.qdoc @@ -41,7 +41,7 @@ /*! -\page contactsusagehtml +\page contactsusage.html \title Contacts API Usage diff --git a/doc/src/examples.qdoc b/doc/src/examples.qdoc index 57509934ed..a1a5f3366d 100644 --- a/doc/src/examples.qdoc +++ b/doc/src/examples.qdoc @@ -78,10 +78,11 @@ \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 diff --git a/doc/src/examples/battery-charge.qdoc b/doc/src/examples/battery-charge.qdoc index 24ec5f7b91..1679d471f6 100644 --- a/doc/src/examples/battery-charge.qdoc +++ b/doc/src/examples/battery-charge.qdoc @@ -58,7 +58,7 @@ \image battery-publisher.png The second program, battery-subscriber, is implemented in QML with some C++ code to display the - QML and make QValueSpaceSubscriber available from within QML. + QML and makes QValueSpaceSubscriber available from within QML. The user interface of the battery subscriber program is described in QML. It has the following features: A rectangular area representing the percent charge of the battery. It indicates a @@ -69,26 +69,28 @@ \section2 Battery Subscriber - The first step is to make QValueSpaceSubscriber available from within QML so that our QML code - can access the keys published by the battery-publisher. This is achieved by using the - QML_DECLARE_TYPE() and QML_DEFINE_TYPE() macros. The following code makes - QValueSpaceSubscriber available from within QML as ValueSpaceSubscriber. + The QValueSpaceSubscriber class is available from within QML through the use of a plugin which + is parsed by the QML engine. This means that simply using the QML element 'ValueSpaceSubscriber' + allows access to the valuespace, which is demonstrated below. - \snippet battery-charge/battery-subscriber/main.cpp 0 \section3 QML + Firstly, import the plugin library that provides the ValueSpaceSubscriber QML element. + + \snippet battery-charge/battery-subscriber/battery-subscriber.qml 4 + Two ValueSpaceSubscriber instances are created, one for each of the battery values. We give each object a unique id so that we can reference it from elsewhere in the QML. We set the \i path properties to the Value Space path of the keys. Finally we set the \i notify properties to true to enable the emission of change notification signals. - \snippet battery-charge/battery-subscriber/battery-meter.qml 0 + \snippet battery-charge/battery-subscriber/battery-subscriber.qml 0 The default state of the rectangle used to visualize the battery charge uses the \i charge property of our BatteryCharge class in the expression for its height. - \snippet battery-charge/battery-subscriber/battery-meter.qml 1 + \snippet battery-charge/battery-subscriber/battery-subscriber.qml 1 When the battery charge changes the height of the rectangle will automatically change. @@ -96,10 +98,10 @@ drops below 25% and the battery is not being recharged. When in this state the color is set to red. - \snippet battery-charge/battery-subscriber/battery-meter.qml 2 + \snippet battery-charge/battery-subscriber/battery-subscriber.qml 2 The \i charging state is entered when the battery is being recharged. When in this state a particle effect animation is enabled. - \snippet battery-charge/battery-subscriber/battery-meter.qml 3 + \snippet battery-charge/battery-subscriber/battery-subscriber.qml 3 */ diff --git a/doc/src/examples/declarative-sfw-dialer.qdoc b/doc/src/examples/declarative-sfw-dialer.qdoc index 52668a05c0..f97e4c71cd 100644 --- a/doc/src/examples/declarative-sfw-dialer.qdoc +++ b/doc/src/examples/declarative-sfw-dialer.qdoc @@ -46,11 +46,12 @@ \bold {Explanation:} -This example should demonstrate how to use the Service Framework and -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 +This example should demonstrate how to use the Service Framework to +access a list of services in a QML context. A library plugin provides QML with elements +that can reference a single service or a list of services, called 'Service' and +'ServiceList' respectively. + +An 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 @@ -59,35 +60,16 @@ The GUI looks like following picture: \image DialerServiceGUI.png "GUI" - -The following steps outline how to make a QML based application -using the Service Framework technology. -It is assumed that Qt Mobility has been -successfully built and environment variables have been set +The following steps outline how to make a QML based application using the Service Framework technology. +It is assumed that Qt Mobility has been successfully built and environment variables have been set as per \l {Installation Guide}. -\bold {The main function:} - -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 service framework type registrations - \o Include the QML canvas to be displayed -\endlist +\bold {Service Framework in QML:} -Step is shown below: -\snippet declarative-sfw-dialer/sfwexample/main.cpp 0 +To included the Service Framework QML plugin to our QML file we need to import it as follows: -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 +\snippet declarative-sfw-dialer/declarative-sfw-dialer/content/DialerList.qml 4 -This allows us to import our new types in QML by: -\snippet declarative-sfw-dialer/sfwexample/content/DialerList.qml 4 - -We are using QDeclarativeView to load and show our QML content -\snippet declarative-sfw-dialer/sfwexample/main.cpp 2 \bold {The Services:} @@ -106,14 +88,12 @@ 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 the registration class -accompanying the main function: -\snippet declarative-sfw-dialer/sfwexample/sfwexample.cpp 0 +In our example this will be done manually by using the servicefw tool. Refer to the project +README for further details. 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 -Service Framework enviroment. +Service Framework environment. For more information please read more about the Qt Service Framework \l {service-frameworks.html#adding-and-removing-of-services}{XML Format} @@ -130,7 +110,7 @@ In our case we only need to overwrite the virtual function createInstance. As you can see the createInstance function create the appropriate dialer object and returns it. -The Q_EXPORT_PLUGIN2 macro provides the neccessary implementation for a plugin. +The Q_EXPORT_PLUGIN2 macro provides the necessary implementation for a plugin. See \l{How to Create Qt Plugins} for more details. The last thing we need to provide in our services are @@ -140,29 +120,6 @@ want to access in out QML script later. \target 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-sfw-dialer/sfwexample/qdeclarativeservice.h 0 - -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-sfw-dialer/sfwexample/qdeclarativeservice.h 1 - -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-sfw-dialer/sfwexample/qdeclarativeservice.cpp 0 - -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} @@ -172,28 +129,28 @@ The QML elements are implemented in 4 different qml scripting files 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 +\snippet declarative-sfw-dialer/declarative-sfw-dialer/content/DialerList.qml 5 In the DialerList.qml file the services property is assigned to the ListView model property. -\snippet declarative-sfw-dialer/sfwexample/content/DialerList.qml 0 +\snippet declarative-sfw-dialer/declarative-sfw-dialer/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-sfw-dialer/sfwexample/content/DialerList.qml 1 +\snippet declarative-sfw-dialer/declarative-sfw-dialer/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. +You can access inside 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 DialerList_qml_2 -\snippet declarative-sfw-dialer/sfwexample/content/DialerList.qml 2 +\snippet declarative-sfw-dialer/declarative-sfw-dialer/content/DialerList.qml 2 Another component can be created for highliting a list item: -\snippet declarative-sfw-dialer/sfwexample/content/DialerList.qml 3 +\snippet declarative-sfw-dialer/declarative-sfw-dialer/content/DialerList.qml 3 \bold {Service signals and function calls on the QML site} @@ -203,21 +160,21 @@ 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-dialer/sfwexample/sfwexample.qml 0 +\snippet declarative-sfw-dialer/declarative-sfw-dialer/declarative-sfw-dialer.qml 0 In DialScreen.qml the dial and the hangup signals are defined. -The hangup signal will be emited if the HangUpButton was clicked: +The hangup signal will be emitted if the HangUpButton was clicked: -\snippet declarative-sfw-dialer/sfwexample/content/DialScreen.qml 1 +\snippet declarative-sfw-dialer/declarative-sfw-dialer/content/DialScreen.qml 1 -The dial signal will be emited if the CallButton was clicked: +The dial signal will be emitted if the CallButton was clicked: -\snippet declarative-sfw-dialer/sfwexample/content/DialScreen.qml 2 +\snippet declarative-sfw-dialer/declarative-sfw-dialer/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 our main declarative file: -\snippet declarative-sfw-dialer/sfwexample/sfwexample.qml 1 +\snippet declarative-sfw-dialer/declarative-sfw-dialer/declarative-sfw-dialer.qml 1 The DialScreen.currentDialer is assigned during a ListView item click in the \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 index 7234b0f356..4eced1f681 100644 --- a/doc/src/examples/declarative-sfw-notes.qdoc +++ b/doc/src/examples/declarative-sfw-notes.qdoc @@ -47,29 +47,27 @@ 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. +user-interface tools. 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. +The QServiceManager and QServiceInterfaceDescriptor API are provided to QML through the use +of a plugin-based system. The resulting class is referred to as QDeclarativeService, which +provides users with the ability of accessing services by loading the interfaces specified +using the QML element 'Service'. 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 +application, using a combination of declarative elements and Javascript in the QML file. To run +the application refer to the README file supplied which +includes instructions on how to setup and run the QML file demonstrating service framework +capabilities. + +There is also another service framework example that demonstrates how to use the QML library +plugin 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 +The section below explains how QML can be used to emulate to exact functionality of the alternate Qt/C++ example. @@ -82,7 +80,7 @@ Now to obtain the default service with a specific interface name from within QML 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 +In most cases we will need the service to be available 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 diff --git a/doc/src/examples/publish-subscribe.qdoc b/doc/src/examples/publish-subscribe.qdoc index 9d091c4696..3fbd2c2242 100644 --- a/doc/src/examples/publish-subscribe.qdoc +++ b/doc/src/examples/publish-subscribe.qdoc @@ -46,11 +46,11 @@ The Publish and Subscribe example shows how to use the Qt Publish and Subscribe API to publish and retrieve values from the platforms Publish and Subscribe system. - This example program can act either a publisher of Value Space content, a subscriber of a Value - Space content or both. It can also optionally act as the Value Space Manager. The behavior - is selected by passing a combination of three optional command line parameters when starting - the program. If no parameters are supplied the program defaults to acting as both a publisher - and subscriber. + This example program can act as either a publisher of Value Space content, a subscriber of + Value Space content or both. It can also optionally act as the Value Space Manager. The + behavior is selected by passing a combination of three optional command line parameters when + starting the program. If no parameters are supplied the program defaults to acting as both a + publisher and a subscriber. \table \header @@ -75,11 +75,12 @@ When acting as a publisher of Value Space content the program creates a PublisherDialog. This dialog contains a widget for setting the base path of the QValueSpacePublisher and - widgets for setting the value of the two fixed attributes 'intValue' and 'stringValue'. + widgets for setting the value of the three fixed attributes 'intValue', 'stringValue' and + 'byteArrayValue'. \image publish-subscribe-publisher.png - We declare three slots which we will use to respond to user input in the dialog. + We declare the slots which we will use to respond to user input in the dialog. \snippet publish-subscribe/publisherdialog.h 0 @@ -87,10 +88,10 @@ \snippet publish-subscribe/publisherdialog.cpp 1 - To publish values in the Value Space we first need to create a QValueSpacePublisher. We do - this in the \c {createNewObject()} slot, which is also used to handle changes in the base path. + To publish values in the Value Space we first need to create a QValueSpacePublisher. This is + done in the \c {createNewObject()} slot, which is also used to handle changes in the base path. After the object is constructed we publish the initial values by explicitly calling the other - two slots. + slots. \snippet publish-subscribe/publisherdialog.cpp 2 @@ -119,7 +120,8 @@ To read values from the Value Space we first create a QValueSpaceSubscriber and connect to the \c {contentsChanged()} signal. - We explicitly call our \c {itemChanged()} slot to populate the table with the initial values. + We explicitly call our \c {subscriberChanged()} slot to populate the table with the initial + values. \snippet publish-subscribe/subscriberdialog.cpp 0 diff --git a/doc/src/examples/quickstart.qdoc b/doc/src/examples/quickstart.qdoc index 7a050e9ebf..6b250c03aa 100644 --- a/doc/src/examples/quickstart.qdoc +++ b/doc/src/examples/quickstart.qdoc @@ -108,16 +108,30 @@ corresponding values that can be assigned to \c MOBILITY. \o \l {Qt Service Framework} {Service Framework} \o serviceframework \row + \o \l {Sensor API} + \o sensors +\row \o \l {System Information} \o systeminfo \row - \o \l {Future Additional APIs}{Versit} + \o \l {Versit API}{Versit} \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: +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. +This can be achieved with a line such as the following: + +\code + TARGET.CAPABILITIES = CAPABILITY_A CABAPILITY_B +\endcode + +CAPABILITY_A and CAPABILITY_B are place holders for the appropriate Symbian capabilities. A complete list of all Symbian +capabilities and their availability to application developers can be found in the +\l {http://developer.symbian.org/wiki/index.php/Capabilities_(Symbian_Signed)}{Symbian capability documentation}. -\snippet quickstart/quickstart.pro 1 +The subsequent table provides an overview of possibily required capabilities for each Mobility library. +Note that not all capabilities are always required when using a particular API. The exact list depends +on which parts of an API is utilized by an application. \table \header @@ -128,7 +142,7 @@ When developing on Symbian we will also need to add the required capabilites to \o ReadUserData NetworkServices (NetworkControl for QNetworkSession::stop()) \row \o \l {Contacts} - \o ReadUserData WriteUserData SwEvent ReadDeviceData WriteDeviceData + \o ReadUserData WriteUserData \row \o \l {Location} \o Location @@ -140,14 +154,19 @@ When developing on Symbian we will also need to add the required capabilites to \o LocalServices ReadUserData WriteUserData NetworkServices UserEnvironment ReadDeviceData WriteDeviceData \row \o \l {Publish And Subscribe} - \o ReadDeviceData WriteDeviceData + \o Capability depends on P&S value being read/written. API itself doesn't require any capability. \row \o \l {Qt Service Framework} {Service Framework} \o No capabilities requried by itself, the plugins may have capability requirements. \row + \o \l {Sensor API} + \o ReadDeviceData +\row \o \l {System Information} - \o LocalServices ReadUserData WriteUserData NetworkServices UserEnvironment Location TrustedUI ReadDeviceData + \o LocalServices ReadUserData WriteUserData NetworkServices UserEnvironment Location ReadDeviceData \row + \o \l {Versit API} + \o No additional capabilities required. \endtable The complete list of all Symbian capabilities and how they can be obtained can be found in the \l {http://developer.symbian.org/wiki/index.php/Capabilities_(Symbian_Signed)#Which_capabilities_can_I_access.3F}{Symbian developer documentation}. diff --git a/doc/src/examples/samplephonebook.qdoc b/doc/src/examples/samplephonebook.qdoc index d1bd7fe7c3..be84b60731 100644 --- a/doc/src/examples/samplephonebook.qdoc +++ b/doc/src/examples/samplephonebook.qdoc @@ -115,7 +115,7 @@ In particular: \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 + asynchronous API is the preferred interface to use as it does not block the GUI 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 diff --git a/doc/src/examples/serviceactions.qdoc b/doc/src/examples/serviceactions.qdoc index 8077a14a30..324898250b 100644 --- a/doc/src/examples/serviceactions.qdoc +++ b/doc/src/examples/serviceactions.qdoc @@ -56,13 +56,13 @@ message bodies (attachments for email accounts) can be entered by the user via corresponding UI elements. A QMessage is constructed using these details: - \snippet ../../examples/serviceactions/mainwindow.cpp construct-message + \snippet ../../demos/serviceactions/mainwindow.cpp construct-message The message is then passed to the QMessageService::compose() or QMessageService::send() service actions to initiate sending of the message by the platform, or trigger display by the platforms' message composer with the QMessage contents: - \snippet ../../examples/serviceactions/mainwindow.cpp send-compose-message + \snippet ../../demos/serviceactions/mainwindow.cpp send-compose-message \section1 Show @@ -73,20 +73,20 @@ The last 50 messages (incoming/outgoing) are queried from the store using the QMessageService::queryMessages() service request: - \snippet ../../examples/serviceactions/mainwindow.cpp load-message + \snippet ../../demos/serviceactions/mainwindow.cpp load-message Once the results of the query are returned via the QMessageService::messagesFound() signal, the widget loads each of the returned messages in turn and populates it's list with message subjects. - \snippet ../../examples/serviceactions/mainwindow.cpp process-results + \snippet ../../demos/serviceactions/mainwindow.cpp process-results - \snippet ../../examples/serviceactions/mainwindow.cpp process-results2 + \snippet ../../demos/serviceactions/mainwindow.cpp process-results2 Selecting "Show" from the action menu will display the selected message using the platforms' message viewer via the QMessageService::show() service action. - \snippet ../../examples/serviceactions/mainwindow.cpp show-message + \snippet ../../demos/serviceactions/mainwindow.cpp show-message \section1 Query and Retrieve @@ -99,17 +99,17 @@ QMessageContentContainer::isContentAvailable function. If the message body is partially downloaded, a download link is displayed. - \snippet ../../examples/serviceactions/mainwindow.cpp partial-message-check + \snippet ../../demos/serviceactions/mainwindow.cpp partial-message-check When the download link is clicked, the message body is retrieved using the QMessageService::retrieveBody() service action. - \snippet ../../examples/serviceactions/mainwindow.cpp retrieve-message-body + \snippet ../../demos/serviceactions/mainwindow.cpp retrieve-message-body \section1 Store Signals This example displays the activities of the QMessageManager in a QListWidget by connecting to QMessageManager::message(Added/Updated/Removed) signals. - \snippet ../../examples/serviceactions/mainwindow.cpp store-signals + \snippet ../../demos/serviceactions/mainwindow.cpp store-signals */ diff --git a/doc/src/examples/sysinfo.qdoc b/doc/src/examples/sysinfo.qdoc index f29781b63e..d51d093b5e 100644 --- a/doc/src/examples/sysinfo.qdoc +++ b/doc/src/examples/sysinfo.qdoc @@ -86,9 +86,9 @@ 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() + list of features. When a listed feature is selected the getFeature() function is called with the index which is handled by applying a test to - the corresponding feaure. + the corresponding feature. \snippet ../../examples/sysinfo/dialog.cpp feature \dots diff --git a/doc/src/examples/undocumented.qdoc b/doc/src/examples/undocumented.qdoc index d8efd18df8..2d0909ce28 100644 --- a/doc/src/examples/undocumented.qdoc +++ b/doc/src/examples/undocumented.qdoc @@ -79,7 +79,7 @@ \title Radio Example */ -/*! +/* \example recorder \title Recorder Example */ diff --git a/doc/src/future.qdoc b/doc/src/future.qdoc index e9168ba083..d232652b60 100644 --- a/doc/src/future.qdoc +++ b/doc/src/future.qdoc @@ -46,16 +46,6 @@ \brief Additional APIs under development. - -\target {Management of Versit Documents} -\section1 Management of Versit Documents - -\l{Versit API}{Versit API Documentation} - -Versit Classes. -\annotatedlist versit - - */ diff --git a/doc/src/images/publish-subscribe-publisher.png b/doc/src/images/publish-subscribe-publisher.png Binary files differindex 2f6e193b84..a8c3fc5305 100644 --- a/doc/src/images/publish-subscribe-publisher.png +++ b/doc/src/images/publish-subscribe-publisher.png diff --git a/doc/src/images/publish-subscribe-subscriber.png b/doc/src/images/publish-subscribe-subscriber.png Binary files differindex ed4eb432dd..ba56fd4474 100644 --- a/doc/src/images/publish-subscribe-subscriber.png +++ b/doc/src/images/publish-subscribe-subscriber.png diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc index e9ceb7043d..30e1048d4b 100644 --- a/doc/src/index.qdoc +++ b/doc/src/index.qdoc @@ -74,12 +74,15 @@ \section2 Introducing the New Qt APIs + Qt Mobility covers a wide range of features and technologies so it best + to regard it not as a single API but as a collection of APIs or frameworks. + This release contains the following APIs: \annotatedlist mobility - These APIs give the developer a wide range of desirable functions for a - mobile platform, but these now become possible on platforms not + These APIs give the developer a range of desirable functions for a + mobile platform, but now these functions become possible on platforms not traditionally associated with some of the features. A mobile device using the Qt Mobility Project API would be able to \list @@ -101,15 +104,17 @@ irrespective of whether the platform is mobile or not. This means that there is the possibility of easy transfer of user experience from PC to phone or vice versa. - + \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. + The QtMobility APIs are placed into the \i{QtMobility} namespace, with + the important exception of Multimedia. This is done to facilitate the + future migration of Mobility APIs into Qt. + + See the \l {Quickstart Example}{Quickstart guide} for an example on how + the namespace impacts on application development. - \section2 Getting Started + \section1 Getting Started To get started with Qt Mobility see the \list \o \l {Installation Guide} @@ -125,16 +130,17 @@ For a list of known issues and an additional details on feature supported see \l {Release Notes of the QtMobility Project}. - For a overview of Platform Compatability see \l {Platform Compatability}. + For a overview of Platform Compatibility see \l {Platform Compatibility}. \section1 The New Qt APIs \section2 Bearer Management Although not a network manager, this component manages the connectivity - state to the network. So it does not manage network configurations, which - are the role of the platform provider, but it does allow the user to start - or stop network interfaces. Some higher level management of the connection - session may also be possible as well depending on the platform. + state of the device to the network. So it does not manage network + configurations, which are the role of the platform provider, but it does + allow the user to start or stop network interfaces. Some higher level + management of the connection session may also be possible as well + depending on the platform. Some platforms can have a set of grouped access points perhaps based on a common purpose. Bearer Management allows comparison and prioritization @@ -215,9 +221,6 @@ and managing of an FM radio. This includes the typical functionality you would find on a music and video player, combined with an FM radio. - \note The Multimedia API, together with QtMultimedia, is intended to - eventually replace the Phonon API. - For more details see the \l {Multimedia} {Multimedia API overview}. \section2 Sensors @@ -262,12 +265,13 @@ \section1 The QtMobility Namespace - The QtMobility API's are placed into the 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 QtMobility APIs are placed into the QtMobility namespace. This is + done to facilitate the future migration of Mobility APIs into Qt. See + the \l {Quickstart Example}{Quickstart guide} for an example on how the namespace impacts on application development. - \section1 Platform Compatability + \section1 Platform Compatibility \raw HTML @@ -350,7 +354,7 @@ <td bgcolor="green"></td> <td bgcolor="green"></td> <td bgcolor="green"></td> - <td bgcolor="yellow"></td> + <td bgcolor="green"></td> <td bgcolor="green"></td> <td bgcolor="green"></td> <td bgcolor="green"></td> @@ -386,10 +390,10 @@ <td bgcolor="green"></td> </tr> <tr> - <td>Contacts*</td> + <td>Contacts</td> <td>FINAL</td> - <td bgcolor="yellow"></td> + <td bgcolor="green"></td> <td bgcolor="green"></td> <td bgcolor="green"></td> <td bgcolor="green"></td> @@ -414,8 +418,8 @@ <td bgcolor="green"></td> </tr> <tr> - <td>Multimedia**</td> - <td>BETA</td> + <td>Multimedia</td> + <td>FINAL</td> <td bgcolor="green"></td> <td bgcolor="green"></td> @@ -442,12 +446,12 @@ <td bgcolor="green"></td> </tr> <tr> - <td>Sensors*</td> + <td>Sensors</td> <td>FINAL</td> - <td bgcolor="yellow"></td> - <td bgcolor="lightgray"></td> - <td bgcolor="lightgray"></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 bgcolor="gray"></td> @@ -477,14 +481,9 @@ \endraw - [*] \i {These APIs are considered FINAL however there are some known - issues with Symbian backends. These backend issues will be resolved - in a future release. } \raw HTML <p> \endraw - [**] \i {These APIs are considered BETA pending final API reviews. We - anticipate moving the status to Final in a future release.} \section1 Feedback and bug reports Email any inquiries and feedback about Qt Mobility to qt-mobility-feedback@trolltech.com diff --git a/doc/src/installation.qdoc b/doc/src/installation.qdoc index cc2ba15bfe..132bfa634c 100644 --- a/doc/src/installation.qdoc +++ b/doc/src/installation.qdoc @@ -46,7 +46,7 @@ \tableofcontents \section1 Get the Qt Mobility API Package -To begin, obtain the most recent distrubution package from +To begin, obtain the most recent distribution package from \l {http://get.qt.nokia.com} \section1 Pre-requisites & Dependencies @@ -110,7 +110,7 @@ these domains have dependencies and these are outlined below: \o Y \row \o Multimedia - \o On all platforms, QtMedia depends on QtMultimedia and QtNetwork. + \o On all platforms, QtMultimediaKit depends on QtGui and QtNetwork. On all platforms, QML elements for sound effects and music and video playing are exported if QtDeclarative (auto-detected) is available. @@ -119,17 +119,19 @@ these domains have dependencies and these are outlined below: \o \row \o Multimedia mediaservice plugins - \o The audioengine plugin for Unix depends on QtMultimedia. + \o The audioengine plugin for Unix depends on QtMultimediaKit. - The dsengine plugin for desktop Windows depends on QtMultimedia. + The dsengine plugin for desktop Windows depends on QtMultimediaKit. 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 mmf plugin 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). + 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: + AudioRoutingAPI, Tuner Utility (only for 3rd FP1), Radio Utility API (for 3rd FP2 and 5th ed). + + Multimedia also includes audio and video (from 1.0.1 onwards) and in Symbian we need MMFDevSound API-SDK plugin to compile/link API. This is also available in Forum Nokia as a supplementary pack. + \o Y \o N \row @@ -162,7 +164,7 @@ these domains have dependencies and these are outlined below: although System Information will compile without them, there will be reduced functionality. It also depends on QtGui. On Mac, it depends on CoreWLAN (auto-detected) if the Mac OS X 10.6 SDK is available. It will compile - with older SDK's but there will be reduced functionality. + with older SSDKsbut there will be reduced functionality. On Maemo, it depends on QtDBus (auto-detected). QtDBus is used to communicate with HAL, and functionality will be reduced if either is unavailable. \o N(Y) @@ -200,7 +202,7 @@ platform have been met before building. If Qt is installed for multiple platforms it is also important to ensure that the correct version of \c{qmake} is being used. -bold{Note:} Static builds of Qt are not supported by Qt Mobility. +\bold{Note:} Static builds of Qt are not supported by Qt Mobility. \section2 Building On Unix @@ -271,8 +273,8 @@ mobility libraries into $PWD/install. \section2 Building For Windows CE The process is much the same as for Windows, although it is - important to run the \c{setcepaths} script from the \c{bin} - directory of the Qt for Windows CE installation to ensure that + important to run the \c{setcepaths} script from the \c{bin} + directory of the Qt for Windows CE installation to ensure that the correct headers and libraries are used. \section2 Building For Symbian On Windows diff --git a/doc/src/location.qdoc b/doc/src/location.qdoc index b770785952..061fba6a48 100644 --- a/doc/src/location.qdoc +++ b/doc/src/location.qdoc @@ -63,8 +63,8 @@ data using arbitrary data sources. \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 +The QtMobility APIs are placed into the \i{QtMobility} namespace. This is done +to facilitate the future migration of Mobility APIs into Qt. See the \l {Quickstart Example}{Quickstart guide} for an example on how the namespace impacts on application development. @@ -249,7 +249,7 @@ Here are the key methods in the class implementation: The example includes a \c ClientApplication class that requests updates -from the \c LogFilePositionSource class. Run the exaple to see the data +from the \c LogFilePositionSource class. Run the example to see the data that is received by \c ClientApplication. Before running the example, make sure you have done both \tt make diff --git a/doc/src/messaging.qdoc b/doc/src/messaging.qdoc index 86f025bccd..72ed7256e8 100644 --- a/doc/src/messaging.qdoc +++ b/doc/src/messaging.qdoc @@ -57,8 +57,8 @@ or respond to an existing message. \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 +The QtMobility APIs are placed into the \i{QtMobility} namespace. This is done +to facilitate the future migration of Mobility APIs into Qt. See the \l {Quickstart Example}{Quickstart guide} for an example on how the namespace impacts on application development. diff --git a/doc/src/multimedia.qdoc b/doc/src/multimedia.qdoc index 4cc661f86d..2046dc299d 100644 --- a/doc/src/multimedia.qdoc +++ b/doc/src/multimedia.qdoc @@ -58,74 +58,148 @@ collection of media content. 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. +QtMultimediaKit module. This API is planned to replace Phonon at a later stage. \tableofcontents -\section1 Namespace +\section1 No Special 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. +Unlike the other APIs in Qt Mobility, the Multimedia API is \i not in the +\i QtMobility namespace. \section1 Overview This library will require Qt 4.6. -This API delivers an easy to use interface to multimedia functions whether -the developer wants to show an image, a video, record sound or play a +This API delivers an easy to use interface to multimedia functions. The +developer can use the API to display an image, or a video, record sound or play a multimedia stream. -There are several benefits from that this API brings to Qt. Firstly, the +There are several benefits this API brings to Qt. Firstly, the developer can now implement fundamental multimedia functions with minimal code, mostly because they are already implemented. Also there is a great -deal of flexibility with the source or generated multimedia. The source file -does not need to be local to the device, it could be streamed from a remote -location and identified by a URL. Many different codecs are supported 'out +deal of flexibility with the media source or the generated multimedia. The +source file does not need to be local to the device, it could be streamed from a remote location and identified by a URL. Finally, many different codecs are supported 'out of the box'. The supplied examples give a good idea at the ease of use of the API. When the supporting user interface code is ignored we can see that functionality -is immediately available with minimal code. +is immediately available with minimal effort. \section2 Audio -Looking at the Audio Recorder example we see that by creating a QMediaRecorder -object that is initialized with a newly created QAudioCaptureSource object -we can now perform all the core actions necessary to record a sound source. +The Audio Recorder example is a good introduction to the basic use of the API. We will use snippets from this example to illustrate how to use the +API to quickly build functionality. -To initialize the objects we create a QAudioCaptureSource object. This will -have a list of available devices to choose from so that we can identify the -origin of the audio data. We then use the capture source object to -initialize a QMediaRecorder object +The first step is to demonstrate recording audio to a file. When recording from an audio source there are a number of things we may want to control beyond the essential user interface. We may want a particular encoding of the file, MP3 or Ogg Vorbis for instance, or select a different input source. The user may modify the bitrate, number of channels, quality and sample rate. Here the example will only modify the codec and the source device, since they are essential. -\snippet snippets/multimedia-snippets/audiorecorder.cpp create-objs-1 +To begin, the developer sets up a source and a recorder object. A +\l{QAudioCaptureSource} object is created and used to initialize a \l{QMediaRecorder} object. The output file name is then set for the \l{QMediaRecorder} object. -The API now allows us to discover available devices and codecs as shown in -the example. To actually do the recording we merely have to call the -\l{QMediaRecorder::record()}{record()} function, and to stop call the -\l{QMediaRecorder::stop()}{stop()} function. Saving to a file is done simply by -calling QMediaRecorder::setOutputLocation() before starting to record. +\code + audiosource = new QAudioCaptureSource; + capture = new QMediaRecorder(audiosource); + + capture->setOutputLocation(QUrl("test.raw")); +\endcode + +A list of devices is needed so that an input can be selected in the user interface + +\code + for(int i = 0; i < audiosource->deviceCount(); i++) + deviceBox->addItem(audiosource->name(i)); +\endcode + +and a list of the supported codecs for the user to select a codec, + +\code + QStringList codecs = capture->supportedAudioCodecs(); + for(int i = 0; i < codecs.count(); i++) + codecsBox->addItem(codecs.at(i)); +\endcode + +To set the selected device or codec just use the index of the device or codec by calling the setter in \i {audiosource} or \i {capture} as appropriate, for example, + +\code + audiosource->setSelectedDevice(i); + ... + capture->setAudioCodec(codecIdx); +\endcode + +Now start recording by using the \l {QMediaRecorder}{record()} function from the new \l{QMediaRecorder} object + +\code + capture->record(); +\endcode + +And stop recording by calling the matching function \l {QMediaRecorder::stop()}{stop()} in \l{QMediaRecorder}. + +\code + capture->stop(); +\endcode + +How then would this audio file be played? The \l {QMediaPlayer} class will be +used as a generic player. Since the player can play both video and audio files the interface will be more complex, but for now the example will concentrate on the audio aspect. + +Playing the file is simple: create a player object, pass in the filename, set +the volume or other parameters, then play. Not forgetting that the code will +need to be hooked up to the user interface. + +\code + QMediaPlayer *player = new QMediaPlayer; + ... + player->setMedia(QUrl::fromLocalFile("test.raw")); + player->setVolume(50); + player->play(); +\endcode + +The filename does not have to be a local file. It could be a URL to a +remote resource. Also by using the \l{QMediaPlaylist} class from this API +we can play a list of local or remote files. The \l{QMediaPlaylist} +class supports constructing, managing and playing playlists. + +\code + player = new QMediaPlayer; + + playlist = new QMediaPlaylist(player); + playlist->append(QUrl("http://example.com/myfile1.mp3")); + playlist->append(QUrl("http://example.com/myfile2.mp3")); + ... + playlist->setCurrentPosition(1); + player->play(); +\endcode + +To manipulate the playlist there are the usual management functions (which are in fact slots): previous, next, setCurrentPosition and shuffle. Playlists can be built, saved and loaded using the API. -With a handful of functions and two classes we can implement a sound -recording application, excluding the supporting user interface code. \section2 Video -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 -QMediaPlayer object, which is used to initialize a QMediaPlaylist object. +Continuing with the example discussed for an Audio recorder/player, we can use this to show how to play video files with little change to the code. -\snippet snippets/multimedia-snippets/player.cpp create-objs +Moving from audio to video requires few changes in the sample code. To play a +video playlist the code can be changed to include another new Mobility +Project class: \l{QVideoWidget}. This class enables control of a video +resource with signals and slots for the control of brightness, contrast, +hue, saturation and full screen mode. -To display the playing video file we need a QVideoWidget object. However, -instead of using a QVideoWidget object directly the Player example has a -VideoWidget class that inherits from QVideoWidget so that functions can be -added to go to full screen display, either on a double click or on a -particular keypress. +\code + player = new QMediaPlayer; + + playlist = new QMediaPlaylist(player); + playlist->append(QUrl("http://example.com/myclip1.mp4")); + playlist->append(QUrl("http://example.com/myclip2.mp4")); + ... + widget = new QVideoWidget(player); + widget->show(); + + playlist->setCurrentPosition(1); + player->play(); +\endcode + +The \l {player}{Player} example does things a bit differently to our sample code. instead of using a QVideoWidget object directly, the Player example has a \i {VideoWidget} class that inherits from QVideoWidget. This means that functions can be added to provide functions such as full screen display, either on a double click or on a particular keypress. + +\snippet ../../demos/player/player.cpp 2 \section2 Radio @@ -136,6 +210,36 @@ implemented the developer will be able to quickly produce an application that supports the typical uses of an FM radio including tuning, volume, start, stop and various other controls. +\section1 Extending the API for Symbian and Maemo + +\section2 Adding a Media Service Provider + +The base class for creating new service providers is \l{QMediaServiceProvider}. The user must implement the \l{QMediaServiceProvider::requestService()}{requestService()} function + +\code + QMediaService* requestService(const QByteArray &type, const QMediaServiceProviderHint &hint); +\endcode + +The details of implementation will depend on the provider. Looking at the class \l QMediaServiceProvider for the default implementation. Notice that \l {QMediaServiceProvider::requestService()}{requestService()} uses the \l QMediaServiceProviderHint to look for the appropriate plugin and then to insert it into the plugin map. However, for a specific service provider there is probably no need for this approach, it will simply depend on what the developer wants to implement. + +Other methods that may be overloaded +\code + void releaseService(QMediaService *service); + + QtMediaServices::SupportEstimate hasSupport(const QByteArray &serviceType, + const QString &mimeType, + const QStringList& codecs, + int flags) const; + + QStringList supportedMimeTypes(const QByteArray &serviceType, int flags) const; + + QList<QByteArray> devices(const QByteArray &serviceType) const; + + QString deviceDescription(const QByteArray &serviceType, const QByteArray &device); +\endcode + +The choice of what needs to be done depends on what the developer wishes to do with the service. + \section1 Examples @@ -169,4 +273,12 @@ QVideoWidget classes. \annotatedlist multimedia-serv +\section2 QML multimedia elements +\list +\o \l {SoundEffect}{SoundEffect: Low Latency Sound Effects} +\o \l {Audio}{Audio: Music playback} +\o \l {Video}{Video: Video playback} +\endlist */ + + diff --git a/doc/src/publ-subs.qdoc b/doc/src/publ-subs.qdoc index d07ce5d6a0..95722ae701 100644 --- a/doc/src/publ-subs.qdoc +++ b/doc/src/publ-subs.qdoc @@ -56,8 +56,8 @@ navigate through and subscribe to change notifications. \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 +The QtMobility APIs are placed into the \i{QtMobility} namespace. This is done +to facilitate the future migration of Mobility APIs into Qt. See the \l {Quickstart Example}{Quickstart guide} for an example on how the namespace impacts on application development. diff --git a/doc/src/qt.index b/doc/src/qt.index index 47eac8d8dc..dc222c9864 100644 --- a/doc/src/qt.index +++ b/doc/src/qt.index @@ -6768,7 +6768,7 @@ <parameter left="const QString &" right="" name="filter" default=""/> </function> </class> - <class access="public" threadsafety="unspecified" status="commendable" name="QAudioOutput" href="qaudiooutput.html" location="qaudiooutput.h" bases="QObject" module="QtMultimedia"> + <class access="public" threadsafety="unspecified" status="commendable" name="QAudioOutput" href="qaudiooutput.html" location="qaudiooutput.h" bases="QObject" module="QtMultimediaKit"> <function access="public" threadsafety="unspecified" status="commendable" name="QAudioOutput" fullname="QAudioOutput::QAudioOutput" href="qaudiooutput.html#QAudioOutput" location="qaudiooutput.h" virtual="non" meta="constructor" const="false" static="false" overload="false" type="" signature="QAudioOutput(const QAudioFormat & format, QObject * parent)"> <parameter left="const QAudioFormat &" right="" name="format" default="QAudioFormat()"/> <parameter left="QObject *" right="" name="parent" default="0"/> @@ -21714,7 +21714,7 @@ <function access="public" threadsafety="unspecified" status="commendable" name="error" fullname="QSystemSemaphore::error" href="qsystemsemaphore.html#error" location="qsystemsemaphore.h" virtual="non" meta="plain" const="true" static="false" overload="false" type="SystemSemaphoreError" signature="error() const"/> <function access="public" threadsafety="unspecified" status="commendable" name="errorString" fullname="QSystemSemaphore::errorString" href="qsystemsemaphore.html#errorString" location="qsystemsemaphore.h" virtual="non" meta="plain" const="true" static="false" overload="false" type="QString" signature="errorString() const"/> </class> - <class access="public" threadsafety="unspecified" status="commendable" name="QAudioDeviceInfo" href="qaudiodeviceinfo.html" location="qaudiodeviceinfo.h" bases="QObject" module="QtMultimedia"> + <class access="public" threadsafety="unspecified" status="commendable" name="QAudioDeviceInfo" href="qaudiodeviceinfo.html" location="qaudiodeviceinfo.h" bases="QObject" module="QtMultimediaKit"> <function access="public" threadsafety="unspecified" status="commendable" name="QAudioDeviceInfo" fullname="QAudioDeviceInfo::QAudioDeviceInfo" href="qaudiodeviceinfo.html#QAudioDeviceInfo" location="qaudiodeviceinfo.h" virtual="non" meta="constructor" const="false" static="false" overload="false" type="" signature="QAudioDeviceInfo(const QAudioDeviceId & id, QObject * parent)"> <parameter left="const QAudioDeviceId &" right="" name="id" default=""/> <parameter left="QObject *" right="" name="parent" default="0"/> @@ -45576,7 +45576,7 @@ <parameter left="QDebug" right="" name="debug" default=""/> <parameter left="const QSourceLocation &" right="" name="sourceLocation" default=""/> </function> - <class access="public" threadsafety="unspecified" status="commendable" name="QAudioDeviceId" href="qaudiodeviceid.html" location="qaudiodeviceid.h" bases="" module="QtMultimedia"> + <class access="public" threadsafety="unspecified" status="commendable" name="QAudioDeviceId" href="qaudiodeviceid.html" location="qaudiodeviceid.h" bases="" module="QtMultimediaKit"> <function access="public" threadsafety="unspecified" status="commendable" name="QAudioDeviceId" fullname="QAudioDeviceId::QAudioDeviceId" href="qaudiodeviceid.html#QAudioDeviceId" location="qaudiodeviceid.h" virtual="non" meta="constructor" const="false" static="false" overload="false" type="" signature="QAudioDeviceId()"/> <function access="public" threadsafety="unspecified" status="commendable" name="QAudioDeviceId" fullname="QAudioDeviceId::QAudioDeviceId" href="qaudiodeviceid.html#QAudioDeviceId-2" location="qaudiodeviceid.h" virtual="non" meta="constructor" const="false" static="false" overload="true" overload-number="2" type="" signature="QAudioDeviceId(const QAudioDeviceId & other)"> <parameter left="const QAudioDeviceId &" right="" name="other" default=""/> @@ -52345,7 +52345,7 @@ <function access="protected" threadsafety="unspecified" status="commendable" name="stepEnabled" fullname="QAbstractSpinBox::stepEnabled" href="qabstractspinbox.html#stepEnabled" location="qabstractspinbox.h" virtual="impure" meta="plain" const="true" static="false" overload="false" type="StepEnabled" signature="stepEnabled() const"/> <function access="public" threadsafety="unspecified" status="commendable" name="editingFinished" fullname="QAbstractSpinBox::editingFinished" href="qabstractspinbox.html#editingFinished" location="qabstractspinbox.h" virtual="non" meta="signal" const="false" static="false" overload="false" type="void" signature="editingFinished()"/> </class> - <class access="public" threadsafety="unspecified" status="commendable" name="QAudioFormat" href="qaudioformat.html" location="qaudioformat.h" bases="" module="QtMultimedia"> + <class access="public" threadsafety="unspecified" status="commendable" name="QAudioFormat" href="qaudioformat.html" location="qaudioformat.h" bases="" module="QtMultimediaKit"> <enum access="public" threadsafety="unspecified" status="commendable" name="SampleType" fullname="QAudioFormat::SampleType" href="qaudioformat.html#SampleType-enum" location="qaudioformat.h"> <value name="Unknown" value="0"/> <value name="SignedInt" value="1"/> @@ -52716,7 +52716,7 @@ <parameter left="QWidget *" right="" name="w" default=""/> </function> </class> - <class access="public" threadsafety="unspecified" status="commendable" name="QAudioInput" href="qaudioinput.html" location="qaudioinput.h" bases="QObject" module="QtMultimedia"> + <class access="public" threadsafety="unspecified" status="commendable" name="QAudioInput" href="qaudioinput.html" location="qaudioinput.h" bases="QObject" module="QtMultimediaKit"> <function access="public" threadsafety="unspecified" status="commendable" name="QAudioInput" fullname="QAudioInput::QAudioInput" href="qaudioinput.html#QAudioInput" location="qaudioinput.h" virtual="non" meta="constructor" const="false" static="false" overload="false" type="" signature="QAudioInput(const QAudioFormat & format, QObject * parent)"> <parameter left="const QAudioFormat &" right="" name="format" default="QAudioFormat()"/> <parameter left="QObject *" right="" name="parent" default="0"/> diff --git a/doc/src/qtmobility-known-issues.qdoc b/doc/src/qtmobility-known-issues.qdoc index ceb35803b8..868285e8fa 100644 --- a/doc/src/qtmobility-known-issues.qdoc +++ b/doc/src/qtmobility-known-issues.qdoc @@ -52,7 +52,7 @@ An up-to-date list of known issues with the release can be found via the \l {QtMobility Project Bug Tracker} on the Qt website which provides additional information about known issues and tasks related to Qt and the QtMobility Project. -The new Qt APIs are typically supported by backends for each platform. For overall summary of the completeness/compatibility of support for a given API see \l {Platform Compatability}. +The new Qt APIs are typically supported by backends for each platform. For overall summary of the completeness/compatibility of support for a given API see \l {Platform Compatibility}. \tableofcontents @@ -143,6 +143,7 @@ Support is present for the following System Info API classes \list \o Qt Mobility does not compile if Qt using a namespace. \o Not all example applications will display(fit) well on small screens. + \o Prefixed paths in includes such as \code #include <QtLibrary/MyClass> \endcode or \code #include <QtLibrary/myclass.h> \endcode do not currently work on Symbian. \endlist \section2 Contacts API @@ -154,33 +155,30 @@ Support is present for the following System Info API classes \section2 Messaging API \list - \o Messaging filtering and Sorting functions are not fully optimized. - \o Fremantle: \c {QMessageService::compose} not supported for SMS type messages. - \o Fremantle: queryMessages service action is synchronous for SMS type messages. + \o Messaging filtering and sorting functions are not fully optimized. + \o Fremantle: \c modest process must be restarted before Fremantle backend is fully operational. This can be achieved by restarting the device. \o Fremantle: \c {QMessageService::show} not supported for SMS type messages. - \o Fremantle: \c {QMessageManager::messageAdded} signal is not reported for messages in inbox when inbox is open in modest. \o Fremantle: \c {QMessageManager::updateMessage} is not supported. \o Fremantle: \c {QMessageManager::addMessage} is not supported for SMS type messages. \o Fremantle: \c {QMessageManager::addMessage} can not be used to set priority and status of email messages. - \o Fremantle and Windows: \c {QMessageServiceAction::send}: Only queues a message for sending, message may or may not be sent depending on connection status and is at the platform's disgression. + \o Fremantle and Windows: \c {QMessageServiceAction::send}: Only queues a message for sending, message may or may not be sent depending on connection status and is at the platform's discretion. \o Fremantle, S60 and Windows: \c {QMessageManager::addMessage} can not be used to set size of messages. \o Fremantle and Windows: \c {QMessageManager::addMessage} can not be used to set the date of messages. - \o S60: Exporting POP3 Message Updates from client to server is not supported. \o S60: Only one level of folders is supported <=> Symbian/S60 applications do not use nested folders \o S60: ReceptionTimeStamp is not supported in filtering <=> Symbian reports only one date for SMS & MMS which means that \c {QMessage::date()} field is used, not \c {receivedDate()}) \o S60: Local services messages, for example bluetooth, are listed/read in Inbox + \o Symbian^3: \c {QMessageService::retrieveBody} is not supported. \o Windows: \c {QMessageServiceAction::queryMessages} does not incrementally emit matching message identifiers or progress information. - \o Windows: \c {QMessageServiceAction::exportUpdates}: Performs no operation as changes are automatically synchronized with external servers when a connection is available. + \o Windows: \c {QMessageServiceAction::exportUpdates} performs no operation as changes are automatically synchronized with external servers when a connection is available. control of update progress. \o Windows desktop: \c {QMessageStore::instance} shows a blocking modal dialog if MAPI is not installed. - \o Windows mobile: \c {QMessageSerivceAction::retrieve}: Only retrieves content for messages bodies at present. Attachment retrieval + \o Windows mobile: \c {QMessageServiceAction::retrieve}: Only retrieves content for messages bodies at present. Attachment retrieval overridden by mapi/mail client settings. \o Windows mobile: \c {QMessageServiceAction::cancelOperation}: Async nature of native calls used to implement service actions means that cancelOperation will only operate on the ::retrieveBody service action. \endlist \section2 Multimedia API \list - \o \bold {Multimedia API is in beta state.} \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 diff --git a/doc/src/qtmobility.qdocconf b/doc/src/qtmobility.qdocconf index 88b23e093e..b6a3071b19 100644 --- a/doc/src/qtmobility.qdocconf +++ b/doc/src/qtmobility.qdocconf @@ -13,6 +13,7 @@ headerdirs = ../../src/bearer \ ../../src/systeminfo \ ../../src/contacts \ ../../src/multimedia \ + ../../plugins/declarative/multimedia \ ../../src/messaging \ ../../src/versit \ ../../src/sensors \ @@ -25,6 +26,7 @@ sourcedirs = ../../src/bearer \ ../../src/systeminfo \ ../../src/contacts \ ../../src/multimedia \ + ../../plugins/declarative/multimedia \ ../../src/messaging \ ../../src/versit \ ../../src/sensors \ @@ -34,6 +36,7 @@ excludedirs = ../../src/messaging/win32wce \ ../../src/publishsubscribe/symbian exampledirs = ../../examples \ + ../../demos \ ../.. \ . diff --git a/doc/src/sensors.qdoc b/doc/src/sensors.qdoc index 8dd41f4e86..bc261ec6eb 100644 --- a/doc/src/sensors.qdoc +++ b/doc/src/sensors.qdoc @@ -45,9 +45,6 @@ \brief The Sensors API provides access to sensors. \ingroup mobility -\warning This API should be considered in a beta state. It is -under development and subject to change. - The Sensors API provides access to sensors. This covers both high-level sensors such as screen orientation (portrait, landscape) @@ -56,8 +53,8 @@ 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 +The QtMobility APIs are placed into the \i{QtMobility} namespace. This is done +to facilitate the future migration of Mobility APIs into Qt. See the \l {Quickstart Example}{Quickstart guide} for an example on how the namespace impacts on application development. @@ -87,7 +84,7 @@ Where rotation around an axis is used, the rotation shall be expressed as a Righ \image sensors-coordinates3.jpg In general, sensor data is oriented to the top of the device. If values are to be displayed on -the screen the values may need to be transformed so that they match the UI orientation. A sensor +the screen the values may need to be transformed so that they match the user interface orientation. A sensor may define its data as being oriented to the UI. This will be noted in the documentation for the sensor. @@ -225,7 +222,7 @@ An example follows. \snippet snippets/sensors/plugin.cpp Plugin -If you woud like to build a backend into a library or application you can use the +If you would 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 uses static initialization. diff --git a/doc/src/sf.qdoc b/doc/src/sf.qdoc index 9b7b2a8f52..5dcc243e26 100644 --- a/doc/src/sf.qdoc +++ b/doc/src/sf.qdoc @@ -67,8 +67,8 @@ arbitrary services. \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 +The QtMobility APIs are placed into the \i{QtMobility} namespace. This is done +to facilitate the future migration of Mobility APIs into Qt. See the \l {Quickstart Example}{Quickstart guide} for an example on how the namespace impacts on application development. @@ -185,11 +185,11 @@ does not have to link against a service specific library. \section3 Typed services So far all lookup mechanism returned a QObject pointer. This pointer can be -utilised by introspecting the object, using Qt's meta object system. +utilized 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 +Its disadvantage 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. diff --git a/doc/src/si.qdoc b/doc/src/si.qdoc index 70b22c06d1..288cc412e9 100644 --- a/doc/src/si.qdoc +++ b/doc/src/si.qdoc @@ -66,8 +66,8 @@ 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 +The QtMobility APIs are placed into the \i{QtMobility} namespace. This is done +to facilitate the future migration of Mobility APIs into Qt. See the \l {Quickstart Example}{Quickstart guide} for an example on how the namespace impacts on application development. @@ -85,8 +85,8 @@ of WebKit, Qt and the Service Framework. \section3 Features (hardware) -This lists the supported hardware on the device. Feautures include items -such as the camera, bluetooth, GPS, fm radio etc. +This lists the supported hardware on the device. Features include items +such as the camera, bluetooth, GPS, FM radio etc. \section3 Network diff --git a/doc/src/snippets/multimedia-snippets/audiorecorder.cpp b/doc/src/snippets/multimedia-snippets/audiorecorder.cpp index fa1ef60d35..fd92026c6b 100644 --- a/doc/src/snippets/multimedia-snippets/audiorecorder.cpp +++ b/doc/src/snippets/multimedia-snippets/audiorecorder.cpp @@ -45,7 +45,7 @@ #include <qmediarecorder.h> #include <qmediaservice.h> -#include <QtMultimedia/qaudioformat.h> +#include <QtMultimediaKit/qaudioformat.h> #include "audiorecorder.h" diff --git a/doc/src/snippets/multimedia-snippets/player.cpp b/doc/src/snippets/multimedia-snippets/player.cpp index e2cf670969..db93734379 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(QtMediaServices::Title).toString(); + //qDebug() << "update metadata" << player->metaData(QtMultimediaKit::Title).toString(); if (player->isMetaDataAvailable()) { setTrackInfo(QString("%1 - %2") - .arg(player->metaData(QtMediaServices::AlbumArtist).toString()) - .arg(player->metaData(QtMediaServices::Title).toString())); + .arg(player->metaData(QtMultimediaKit::AlbumArtist).toString()) + .arg(player->metaData(QtMultimediaKit::Title).toString())); if (coverLabel) { - QUrl url = player->metaData(QtMediaServices::CoverArtUrlLarge).value<QUrl>(); + QUrl url = player->metaData(QtMultimediaKit::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 0aed2f32df..5dee651f9c 100644 --- a/doc/src/snippets/qtcontactsdocsample/qtcontactsdocsample.cpp +++ b/doc/src/snippets/qtcontactsdocsample/qtcontactsdocsample.cpp @@ -583,6 +583,17 @@ void shortsnippets() QList<QContactId> therapists = contact.relatedContacts("HasTherapist", QContactRelationship::Second); } //! [6] + //! [Getting all tags] + QSet<QString> tags; + foreach(const QContactTag& tag, contact.details<QContactTag>()) { + tags.insert(tag.tag()); + } + //! [Getting all tags] + //! [Checking for a specific tag] + if (contact.details<QContactTag>(QContactTag::FieldTag, "MyTag").count() > 0) { + // Do something with it + } + //! [Checking for a specific tag] } } diff --git a/doc/src/snippets/qtversitdocsample/qtversitdocsample.cpp b/doc/src/snippets/qtversitdocsample/qtversitdocsample.cpp index 12206e3c2c..257251512d 100644 --- a/doc/src/snippets/qtversitdocsample/qtversitdocsample.cpp +++ b/doc/src/snippets/qtversitdocsample/qtversitdocsample.cpp @@ -63,38 +63,98 @@ void importExample(); //! [Detail handler] class MyDetailHandler : public QVersitContactExporterDetailHandler { public: + MyDetailHandler() : detailNumber(0) {} bool preProcessDetail(const QContact& contact, const QContactDetail& detail, QVersitDocument* document) { Q_UNUSED(contact) Q_UNUSED(detail) Q_UNUSED(document) return false; } + /* eg. a detail with definition name "Detail1" and fields "Field1"="Value1" and + * "Field2"="Value2" will be exported to the vCard properties: + * G0.DETAIL1-FIELD1:Value1 + * G0.DETAIL1-FIELD2:Value2 + * And the next detail (say, "Detail2" with a field "Field3"="Value3" will generate: + * G1.DETAIL2-FIELD3:Value3 + * ie. Different details will have different vCard groups. + */ 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; + Q_UNUSED(contact) + // beware: if the base implementation exports some but not all fields, alreadyProcessed + // will be true and the unprocessed fields won't be exported + if (alreadyProcessed) + return false; + if (detail.definitionName() == QContactType::DefinitionName) + return false; // special case of an unhandled detail that we don't export + QVersitProperty property; + QVariantMap fields = detail.variantValues(); + // fields from the same detail have the same group so the importer can collate them + QString detailGroup = QLatin1String("G") + QString::number(detailNumber++); + for (QVariantMap::const_iterator it = fields.constBegin(); + it != fields.constEnd(); + it++) { + property.setGroups(QStringList(detailGroup)); + // beware: detail.definitionName and the field name will be made uppercase on export + property.setName(QLatin1String("X-QCONTACTDETAIL-") + + detail.definitionName() + + QLatin1String("-") + + it.key()); + // beware: this might not handle nonstring values properly: + property.setValue(it.value()); + document->addProperty(property); + } + return true; } - QList<QContactDetail> mUnknownDetails; +private: + int detailNumber; }; //! [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; + 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; + } + /* eg. if the document has the properties: + * G0.DETAIL-FIELD1:Value1 + * G0.DETAIL-FIELD2:Value2 + * G1.DETAIL-FIELD1:Value3 + * This will generate two details - the first with fields "FIELD1"="Value1" and + * "FIELD2"="Value2" and the second with "FIELD1"="Value3" + * ie. the vCard groups determine which properties form a single detail. + */ + bool postProcessProperty(const QVersitDocument& document, const QVersitProperty& property, + bool alreadyProcessed, int contactIndex, QContact* contact) { + Q_UNUSED(document) Q_UNUSED(contactIndex) + const QString prefix = QLatin1String("X-QCONTACTDETAIL-"); + if (alreadyProcessed) + return false; + if (!property.name().startsWith(prefix)) + return false; + QString detailAndField = property.name().mid(prefix.size()); + QStringList detailAndFieldParts = detailAndField.split(QLatin1Char('-'), + QString::SkipEmptyParts); + if (detailAndFieldParts.size() != 2) + return false; + QString definitionName = detailAndFieldParts.at(0); + QString fieldName = detailAndFieldParts.at(1); + if (property.groups().size() != 1) + return false; + QString group = property.groups().first(); + // find a detail generated from the a property with the same group + QContactDetail detail = handledDetails.value(group); + // make sure the the existing detail has the same definition name + if (detail.definitionName() != definitionName) + detail = QContactDetail(definitionName); + detail.setValue(fieldName, property.value()); + contact->saveDetail(&detail); + handledDetails.insert(group, detail); + return false; + } + QMap<QString, QContactDetail> handledDetails; // map from group name to detail }; //! [Property handler] diff --git a/doc/src/snippets/service-snippets/bluetoothtransfer.cpp b/doc/src/snippets/service-snippets/bluetoothtransfer.cpp new file mode 100644 index 0000000000..f1bbbe3475 --- /dev/null +++ b/doc/src/snippets/service-snippets/bluetoothtransfer.cpp @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** 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 <QtCore> + +#include "bluetoothtransfer.h" + +BluetoothTransfer::BluetoothTransfer(QObject *parent) + : QObject(parent) +{ +} + +//! [sendFile] +void BluetoothTransfer::sendFile(const QString &path) +{ + qDebug() << "BluetoothTransfer::sendFile()" << path; +} +//! [sendFile] diff --git a/doc/src/snippets/service-snippets/bluetoothtransfer.h b/doc/src/snippets/service-snippets/bluetoothtransfer.h new file mode 100644 index 0000000000..93faa9d21a --- /dev/null +++ b/doc/src/snippets/service-snippets/bluetoothtransfer.h @@ -0,0 +1,58 @@ +/**************************************************************************** +** +** 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 BLUETOOTHTRANSFER_H +#define BLUETOOTHTRANSFER_H + +#include <QObject> + +class BluetoothTransfer : public QObject +{ + Q_OBJECT +public: + BluetoothTransfer(QObject *parent = 0); + +public slots: + void sendFile(const QString &path); +}; + + +#endif diff --git a/doc/src/snippets/service-snippets/bluetoothtransferplugin.cpp b/doc/src/snippets/service-snippets/bluetoothtransferplugin.cpp new file mode 100644 index 0000000000..a09ae1129a --- /dev/null +++ b/doc/src/snippets/service-snippets/bluetoothtransferplugin.cpp @@ -0,0 +1,59 @@ +/**************************************************************************** +** +** 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 <qserviceinterfacedescriptor.h> +#include <qabstractsecuritysession.h> +#include <qservicecontext.h> + +#include "bluetoothtransferplugin.h" +#include "bluetoothtransfer.h" + +QObject* BluetoothTransferPlugin::createInstance(const QServiceInterfaceDescriptor& descriptor, QServiceContext* context, QAbstractSecuritySession* session) +{ + Q_UNUSED(descriptor); + Q_UNUSED(context); + Q_UNUSED(session); + //! [createinstance] + return new BluetoothTransfer(this); + //! [createinstance] +} + +Q_EXPORT_PLUGIN2(serviceframework_bluetoothtransferplugin, BluetoothTransferPlugin) diff --git a/doc/src/snippets/service-snippets/bluetoothtransferplugin.h b/doc/src/snippets/service-snippets/bluetoothtransferplugin.h new file mode 100644 index 0000000000..c8efba0190 --- /dev/null +++ b/doc/src/snippets/service-snippets/bluetoothtransferplugin.h @@ -0,0 +1,62 @@ +/**************************************************************************** +** +** 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 BLUETOOTHTRANSFERPLUGIN_H +#define BLUETOOTHTRANSFERPLUGIN_H + +#include <QObject> + +#include <qserviceplugininterface.h> + +QTM_USE_NAMESPACE + +class BluetoothTransferPlugin : public QObject, + public QServicePluginInterface +{ + Q_OBJECT + Q_INTERFACES(QtMobility::QServicePluginInterface) +public: + QObject* createInstance(const QServiceInterfaceDescriptor& descriptor, + QServiceContext* context, + QAbstractSecuritySession* session); +}; + +#endif diff --git a/doc/src/snippets/service-snippets/filemanagerplugin.cpp b/doc/src/snippets/service-snippets/filemanagerplugin.cpp new file mode 100644 index 0000000000..a9d72e91f6 --- /dev/null +++ b/doc/src/snippets/service-snippets/filemanagerplugin.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 <qserviceinterfacedescriptor.h> +#include <qabstractsecuritysession.h> +#include <qservicecontext.h> + +#include "filemanagerplugin.h" +#include "filemanagerstorage.h" +#include "filemanagertransfer.h" + +//! [createinstance-sig] +QObject* FileManagerPlugin::createInstance(const QServiceInterfaceDescriptor& descriptor, QServiceContext* context, QAbstractSecuritySession* session) +//! [createinstance-sig] +{ + Q_UNUSED(context); + Q_UNUSED(session); +//! [createinstance] + if (descriptor.interfaceName() == "com.nokia.qt.examples.FileStorage") + return new FileManagerStorage(this); + else if (descriptor.interfaceName() == "com.nokia.qt.examples.FileTransfer") + return new FileManagerTransfer(this); + else + return 0; +//! [createinstance] +} + +Q_EXPORT_PLUGIN2(serviceframework_filemanagerplugin, FileManagerPlugin) diff --git a/doc/src/snippets/service-snippets/filemanagerplugin.h b/doc/src/snippets/service-snippets/filemanagerplugin.h new file mode 100644 index 0000000000..a4431add71 --- /dev/null +++ b/doc/src/snippets/service-snippets/filemanagerplugin.h @@ -0,0 +1,62 @@ +/**************************************************************************** +** +** 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 FILEMANAGERPLUGIN_H +#define FILEMANAGERPLUGIN_H + +#include <QObject> + +#include <qserviceplugininterface.h> + +QTM_USE_NAMESPACE + +class FileManagerPlugin : public QObject, + public QServicePluginInterface +{ + Q_OBJECT + Q_INTERFACES(QtMobility::QServicePluginInterface) +public: + QObject* createInstance(const QServiceInterfaceDescriptor& descriptor, + QServiceContext* context, + QAbstractSecuritySession* session); +}; + +#endif diff --git a/doc/src/snippets/service-snippets/filemanagerstorage.cpp b/doc/src/snippets/service-snippets/filemanagerstorage.cpp new file mode 100644 index 0000000000..018c86b9d0 --- /dev/null +++ b/doc/src/snippets/service-snippets/filemanagerstorage.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 <QtCore> + +#include "filemanagerstorage.h" + +FileManagerStorage::FileManagerStorage(QObject *parent) + : QObject(parent) +{ + directory = QCoreApplication::applicationDirPath(); +} + +void FileManagerStorage::setWorkingDirectory(const QString &path) +{ + directory = path; + emit workingDirectoryChanged(path); +} + +QString FileManagerStorage::workingDirectory() const +{ + return directory; +} + +void FileManagerStorage::copyFile(const QString ¤tPath, const QString &newPath) +{ + qDebug() << "FileManagerStorage::copyFile() from" << currentPath << "to" << newPath; +} diff --git a/doc/src/snippets/service-snippets/filemanagertransfer.cpp b/doc/src/snippets/service-snippets/filemanagertransfer.cpp new file mode 100644 index 0000000000..c6a02bb588 --- /dev/null +++ b/doc/src/snippets/service-snippets/filemanagertransfer.cpp @@ -0,0 +1,59 @@ +/**************************************************************************** +** +** 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 <QtCore> + +#include "filemanagertransfer.h" + +FileManagerTransfer::FileManagerTransfer(QObject *parent) + : QObject(parent) +{ +} + +void FileManagerTransfer::invokableMethod() +{ + qDebug() << "FileManagerTransfer::invokableMethod()"; +} + +void FileManagerTransfer::sendFile(const QString &path) +{ + qDebug() << "FileManagerTransfer::sendFile()" << path; +} diff --git a/doc/src/snippets/service-snippets/filemanagertransfer.h b/doc/src/snippets/service-snippets/filemanagertransfer.h new file mode 100644 index 0000000000..ee6697d4ae --- /dev/null +++ b/doc/src/snippets/service-snippets/filemanagertransfer.h @@ -0,0 +1,59 @@ +/**************************************************************************** +** +** 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 FILEMANAGERTRANSFER_H +#define FILEMANAGERTRANSFER_H + +#include <QObject> + +class FileManagerTransfer : public QObject +{ + Q_OBJECT +public: + FileManagerTransfer(QObject *parent = 0); + + Q_INVOKABLE void invokableMethod(); + +public slots: + void sendFile(const QString &path); +}; + +#endif diff --git a/doc/src/snippets/sysinfo-snippets/dialog.cpp b/doc/src/snippets/sysinfo-snippets/dialog.cpp new file mode 100644 index 0000000000..cee619a9ef --- /dev/null +++ b/doc/src/snippets/sysinfo-snippets/dialog.cpp @@ -0,0 +1,774 @@ +/**************************************************************************** +** +** 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 "dialog.h" +#include <QMessageBox> +#include <QTimer> + +Dialog::Dialog() : + QWidget(), + saver(NULL), systemInfo(NULL), di(NULL), ni(NULL) +{ + setupUi(this); + setupGeneral(); + + connect(tabWidget,SIGNAL(currentChanged(int)),this,SLOT(tabChanged(int))); + connect(versionComboBox,SIGNAL(activated(int)), this,SLOT(getVersion(int))); + connect(featureComboBox,SIGNAL(activated(int)), this,SLOT(getFeature(int))); + updateDeviceLockedState(); + QTimer *timer = new QTimer(this); + connect(timer, SIGNAL(timeout()), this, SLOT(updateDeviceLockedState())); + timer->start(1000); +} + +Dialog::~Dialog() +{ + delete systemInfo; + delete di; + delete saver; +} + +void Dialog::changeEvent(QEvent *e) +{ + QWidget::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + retranslateUi(this); + break; + default: + break; + } +} + +void Dialog::tabChanged(int index) +{ +#ifdef QTM_EXAMPLES_SMALL_SCREEN + switch(index) { + case 0: + setupGeneral(); + break; + case 1: + setupGeneral(); + break; + case 2: + setupDevice(); + break; + case 3: + setupDevice(); + break; + case 4: + setupDevice(); + break; + case 5: + setupDisplay(); + break; + case 6: + setupStorage(); + break; + case 7: + setupNetwork(); + break; + case 8: + setupNetwork(); + break; + case 9: + setupNetwork(); + break; + case 10: + setupSaver(); + break; + }; +#else + switch(index) { + case 0: + setupGeneral(); + break; + case 1: + setupDevice(); + break; + case 2: + setupDisplay(); + break; + case 3: + setupStorage(); + break; + case 4: + setupNetwork(); + break; + case 5: + setupSaver(); + break; + }; +#endif +} + +void Dialog::setupGeneral() +{ + delete systemInfo; +//! [lang] + systemInfo = new QSystemInfo(this); + curLanguageLineEdit->setText( systemInfo->currentLanguage()); +//! [lang] + languagesComboBox->clear(); + languagesComboBox->insertItems(0,systemInfo->availableLanguages()); + countryCodeLabel->setText(systemInfo->currentCountryCode()); +} + +void Dialog::setupDevice() +{ + delete di; +//! [createdi] + di = new QSystemDeviceInfo(this); +//! [createdi] +//! [batteryLevel] + batteryLevelBar->setValue(di->batteryLevel()); +//! [batteryLevel] + +//! [sig batteryLevelChanged] + connect(di,SIGNAL(batteryLevelChanged(int)), + this,SLOT(updateBatteryStatus(int))); +//! [sig batteryLevelChanged] + + connect(di,SIGNAL(batteryStatusChanged(QSystemDeviceInfo::BatteryStatus)), + this,SLOT(displayBatteryStatus(QSystemDeviceInfo::BatteryStatus))); + + connect(di,SIGNAL(powerStateChanged(QSystemDeviceInfo::PowerState)), + this,SLOT(updatePowerState(QSystemDeviceInfo::PowerState))); + + ImeiLabel->setText(di->imei()); + imsiLabel->setText(di->imsi()); +//! [manuf-id] + manufacturerLabel->setText(di->manufacturer()); +//! [manuf-id] + modelLabel->setText(di->model()); +//! [productName] + productLabel->setText(di->productName()); +//! [productName] + + deviceLockPushButton->setChecked(di->isDeviceLocked()); + + updateSimStatus(); + updateProfile(); + + connect(di, SIGNAL(currentProfileChanged(QSystemDeviceInfo::Profile)), + this, SLOT(updateProfile(QSystemDeviceInfo::Profile))); + + if(di->currentPowerState() == QSystemDeviceInfo::BatteryPower) { + radioButton_2->setChecked(true); + } else if(di->currentPowerState() == QSystemDeviceInfo::WallPower) { + radioButton_3->setChecked(true); + } else if(di->currentPowerState() == QSystemDeviceInfo::WallPowerChargingBattery) { + radioButton_4->setChecked(true); + } else { + radioButton->setChecked(true); + } + +//! [inputMethod flags] + QSystemDeviceInfo::InputMethodFlags methods = di->inputMethodType(); + QStringList inputs; + if((methods & QSystemDeviceInfo::Keys)){ + inputs << "Keys"; + } + if((methods & QSystemDeviceInfo::Keypad)) { + inputs << "Keypad"; + } +//! [inputMethod flags] + if((methods & QSystemDeviceInfo::Keyboard)) { + inputs << "Keyboard"; + } + if((methods & QSystemDeviceInfo::SingleTouch)) { + inputs << "Touch Screen"; + } + if((methods & QSystemDeviceInfo::MultiTouch)) { + inputs << "Multi touch"; + } + if((methods & QSystemDeviceInfo::Mouse)){ + inputs << "Mouse"; + } + + inputMethodLabel->setText(inputs.join(" ")); +} + +void Dialog::updateDeviceLockedState() +{ + if (di) + deviceLockPushButton->setChecked(di->isDeviceLocked()); +} + +void Dialog::updateProfile(QSystemDeviceInfo::Profile /*profile*/) +{ + updateProfile(); +} + + +void Dialog::setupDisplay() +{ + QSystemDisplayInfo di; + brightnessLineEdit->setText(QString::number(di.displayBrightness(0))); + colorDepthLineEdit->setText(QString::number(di.colorDepth((0)))); + +} + +void Dialog::setupStorage() +{ + QSystemStorageInfo mi; + storageTreeWidget->clear(); + storageTreeWidget->header()->setResizeMode(QHeaderView::ResizeToContents); + + QStringList vols = mi.logicalDrives(); + foreach(QString volName, vols) { + QString type; + QSystemStorageInfo::DriveType volType; + volType = mi.typeForDrive(volName); + if(volType == QSystemStorageInfo::InternalDrive) { + type = "Internal"; + } + + if(volType == QSystemStorageInfo::RemovableDrive) { + type = "Removable"; + } + if(volType == QSystemStorageInfo::CdromDrive) { + type = "Cdrom"; + } + if(volType == QSystemStorageInfo::RemoteDrive) { + type = "Network"; + } + QStringList items; + items << volName; + items << type; + items << QString::number(mi.totalDiskSpace(volName)); + items << QString::number(mi.availableDiskSpace(volName)); + QTreeWidgetItem *item = new QTreeWidgetItem(items); + storageTreeWidget->addTopLevelItem(item); + } +} + +void Dialog::setupNetwork() +{ + delete ni; +//! [networkInfo] + ni = new QSystemNetworkInfo(this); +//! [networkInfo] + + connect(netStatusComboBox,SIGNAL(activated(int)), + this, SLOT(netStatusComboActivated(int))); + +//! [sig strength] + connect(ni,SIGNAL(networkSignalStrengthChanged(QSystemNetworkInfo::NetworkMode, int)), + this,SLOT(networkSignalStrengthChanged(QSystemNetworkInfo::NetworkMode,int))); +//! [sig strength] + + connect(ni,SIGNAL(networkNameChanged(QSystemNetworkInfo::NetworkMode,QString)), + this,SLOT(networkNameChanged(QSystemNetworkInfo::NetworkMode,QString))); + + connect(ni,SIGNAL(networkStatusChanged(QSystemNetworkInfo::NetworkMode,QSystemNetworkInfo::NetworkStatus)), + this,SLOT(networkStatusChanged(QSystemNetworkInfo::NetworkMode,QSystemNetworkInfo::NetworkStatus))); + + connect(ni,SIGNAL(networkModeChanged(QSystemNetworkInfo::NetworkMode)), + this,SLOT(networkModeChanged(QSystemNetworkInfo::NetworkMode))); + + cellIdLabel->setText(QString::number(ni->cellId())); + locationAreaCodeLabel->setText(QString::number(ni->locationAreaCode())); + currentMMCLabel->setText(ni->currentMobileCountryCode()); + currentMNCLabel->setText(ni->currentMobileNetworkCode()); + + homeMMCLabel->setText(ni->homeMobileCountryCode()); + homeMNCLabel->setText(ni->homeMobileNetworkCode()); + + networkModeChanged(ni->currentMode()); + +} +void Dialog::netStatusComboActivated(int index) +{ + QString status; + int reIndex = index; + + displayNetworkStatus(ni->networkStatus((QSystemNetworkInfo::NetworkMode)reIndex)); + + macAddressLabel->setText(ni->macAddress((QSystemNetworkInfo::NetworkMode)reIndex)); + + int strength = ni->networkSignalStrength((QSystemNetworkInfo::NetworkMode)reIndex); + if(strength < 0) + strength = 0; + signalLevelProgressBar->setValue(strength); + + InterfaceLabel->setText(ni->interfaceForMode((QSystemNetworkInfo::NetworkMode)reIndex).humanReadableName()); + + operatorNameLabel->setText(ni->networkName((QSystemNetworkInfo::NetworkMode)reIndex)); +} + +void Dialog::getVersion(int index) +{ + QSystemInfo::Version version; + switch(index) { + case 0: + versionLineEdit->setText(""); + break; + case 1: +//! [OS ver] + version = QSystemInfo::Os; +//! [OS ver] + break; + case 2: +//! [Qt ver] + version = QSystemInfo::QtCore; +//! [Qt ver] + break; + case 3: +//! [Firm ver] + version = QSystemInfo::Firmware; +//! [Firm ver] + break; + }; + + QSystemInfo si; + versionLineEdit->setText(si.version(version)); +} + +void Dialog::getFeature(int index) +{ +//! [feature] + QSystemInfo::Feature feature; + switch(index) { +//! [feature] + case 0: + return; + break; +//! [feature-bluetooth] + case 1: + feature = QSystemInfo::BluetoothFeature; +//! [feature-bluetooth] + break; + case 2: + feature = QSystemInfo::CameraFeature; + break; + case 3: + feature = QSystemInfo::FmradioFeature; + break; + case 4: + feature = QSystemInfo::IrFeature; + break; + case 5: + feature = QSystemInfo::LedFeature; + break; + case 6: + feature = QSystemInfo::MemcardFeature; + break; + case 7: + feature = QSystemInfo::UsbFeature; + break; + case 8: + feature = QSystemInfo::VibFeature; + break; + case 9: + feature = QSystemInfo::WlanFeature; + break; + case 10: + feature = QSystemInfo::SimFeature; + break; + case 11: + feature = QSystemInfo::LocationFeature; + break; + case 12: + feature = QSystemInfo::VideoOutFeature; + break; + case 13: + feature = QSystemInfo::HapticsFeature; + break; + }; +//! [feature test] + QSystemInfo si; + featuresLineEdit->setText((si.hasFeatureSupported(feature) ? "true":"false" )); +//! [feature test] +} + +void Dialog::setupSaver() +{ + if (!saver) { + saver = new QSystemScreenSaver(this); + } + + bool saverEnabled = saver->screenSaverInhibited(); + + + connect( saverInhibitedCheckBox, SIGNAL(clicked(bool)), + this,SLOT(setSaverEnabled(bool))); + + saverInhibitedCheckBox->setChecked(saverEnabled); +} + + +void Dialog::setSaverEnabled(bool b) +{ + if (b) { + if (!saver) { + saver = new QSystemScreenSaver(this); + } + if(saver->setScreenSaverInhibit()) { + } + } else { + delete saver; + saver = NULL; + } +} + + +void Dialog::updateBatteryStatus(int level) +{ + batteryLevelBar->setValue(level); +} + +void Dialog::updatePowerState(QSystemDeviceInfo::PowerState newState) +{ + + switch (newState) { + case QSystemDeviceInfo::BatteryPower: + { + radioButton_2->setChecked(true); + } + break; + case QSystemDeviceInfo::WallPower: + { + radioButton_3->setChecked(true); + } + break; + case QSystemDeviceInfo::WallPowerChargingBattery: + { + radioButton_4->setChecked(true); + } + break; + case QSystemDeviceInfo::NoBatteryLevel: + { + radioButton->setChecked(true); + } + break; + }; +} + +void Dialog::displayBatteryStatus(QSystemDeviceInfo::BatteryStatus status) +{ + // this wont annoy users will it? + QString msg; +// if(di->isBatteryCharging()) { + switch(status) { + case QSystemDeviceInfo::BatteryCritical: + { + msg = " Battery is Critical (4% or less), please save your work or plug in the charger."; + QMessageBox::critical(this,"QSystemInfo",msg); + } + break; + case QSystemDeviceInfo::BatteryVeryLow: + { + msg = "Battery is Very Low (10%), please plug in the charger soon"; + QMessageBox::warning(this,"QSystemInfo",msg); + } + break; + case QSystemDeviceInfo::BatteryLow: + { + msg = "Battery is Low (40% or less)"; + QMessageBox::information(this,"QSystemInfo",msg); + + } + break; + case QSystemDeviceInfo::BatteryNormal: + { + msg = "Battery is Normal (greater than 40%)"; + QMessageBox::information(this,"QSystemInfo",msg); + } + break; + case QSystemDeviceInfo::NoBatteryLevel: + { + + } + break; + }; + // } + +} + +void Dialog::networkSignalStrengthChanged(QSystemNetworkInfo::NetworkMode mode , int strength) +{ + if(mode == QSystemNetworkInfo::WlanMode) { + if(netStatusComboBox->currentText() == "Wlan") { + signalLevelProgressBar->setValue(strength); + } + } + + if(mode == QSystemNetworkInfo::EthernetMode) { + if(netStatusComboBox->currentText() == "Ethernet") { + signalLevelProgressBar->setValue(strength); + } + } + + if(mode == QSystemNetworkInfo::GsmMode) { + if(netStatusComboBox->currentText() == "Gsm") { + signalLevelProgressBar->setValue(strength); + } + } + + if(mode == QSystemNetworkInfo::CdmaMode) { + if(netStatusComboBox->currentText() == "Cdma") { + signalLevelProgressBar->setValue(strength); + } + } + + if(mode == QSystemNetworkInfo::WcdmaMode) { + if(netStatusComboBox->currentText() == "Wcdma") { + signalLevelProgressBar->setValue(strength); + } + } + +} + +void Dialog::networkNameChanged(QSystemNetworkInfo::NetworkMode mode,const QString &text) +{ + if(mode == QSystemNetworkInfo::WlanMode) { + if(netStatusComboBox->currentText() == "Wlan") { + operatorNameLabel->setText(text); + } + } + + if(mode == QSystemNetworkInfo::EthernetMode) { + if(netStatusComboBox->currentText() == "Ethernet") { + operatorNameLabel->setText(text); + } + } + + if(mode == QSystemNetworkInfo::GsmMode) { + if(netStatusComboBox->currentText() == "Gsm") { + operatorNameLabel->setText(text); + } + } + + if(mode == QSystemNetworkInfo::CdmaMode) { + if(netStatusComboBox->currentText() == "Cdma") { + operatorNameLabel->setText(text); + } + } + + if(mode == QSystemNetworkInfo::WcdmaMode) { + if(netStatusComboBox->currentText() == "Wcdma") { + operatorNameLabel->setText(text); + } + } + +} + +void Dialog::networkStatusChanged(QSystemNetworkInfo::NetworkMode mode , QSystemNetworkInfo::NetworkStatus status) +{ + if(mode == QSystemNetworkInfo::WlanMode) { + if(netStatusComboBox->currentText() == "Wlan") { + displayNetworkStatus(status); + } + } + + if(mode == QSystemNetworkInfo::EthernetMode) { + if(netStatusComboBox->currentText() == "Ethernet") { + displayNetworkStatus(status); + } + } + + if(mode == QSystemNetworkInfo::GsmMode) { + if(netStatusComboBox->currentText() == "Gsm") { + displayNetworkStatus(status); + } + } + + if(mode == QSystemNetworkInfo::CdmaMode) { + if(netStatusComboBox->currentText() == "Cdma") { + displayNetworkStatus(status); + } + } + + if(mode == QSystemNetworkInfo::WcdmaMode) { + if(netStatusComboBox->currentText() == "Wcdma") { + displayNetworkStatus(status); + } + } + +} + +void Dialog::networkModeChanged(QSystemNetworkInfo::NetworkMode mode) +{ + if(mode == QSystemNetworkInfo::WlanMode) { + primaryModeLabel->setText("Wlan"); + } + + if(mode == QSystemNetworkInfo::EthernetMode) { + primaryModeLabel->setText("Ethernet"); + } + + if(mode == QSystemNetworkInfo::GsmMode) { + primaryModeLabel->setText("Gsm"); + } + + if(mode == QSystemNetworkInfo::CdmaMode) { + primaryModeLabel->setText("Cdma"); + } + + if(mode == QSystemNetworkInfo::WcdmaMode) { + primaryModeLabel->setText("Wcdma"); + } + if(mode == QSystemNetworkInfo::UnknownMode) { + primaryModeLabel->setText("None"); + } +} + + +void Dialog::displayNetworkStatus(QSystemNetworkInfo::NetworkStatus status) +{ + QString stat; + switch(status) { + case QSystemNetworkInfo::UndefinedStatus: + stat = "Undefined"; + break; + case QSystemNetworkInfo::NoNetworkAvailable: + stat = "No Network Available"; + break; + case QSystemNetworkInfo::EmergencyOnly: + stat = "Emergency Only"; + break; + case QSystemNetworkInfo::Searching: + stat = "Searching or Connecting"; + break; + case QSystemNetworkInfo::Busy: + stat = "Busy"; + break; + case QSystemNetworkInfo::Connected: + stat = "Connected"; + break; + case QSystemNetworkInfo::HomeNetwork: + stat = "Home Network"; + break; + case QSystemNetworkInfo::Denied: + stat = "Denied"; + break; + case QSystemNetworkInfo::Roaming: + stat = "Roaming"; + break; + }; + cellNetworkStatusLabel->setText(stat); +} + +void Dialog::updateProfile() +{ + if(di) { + QString profilestring; + switch(di->currentProfile()) { + case QSystemDeviceInfo::UnknownProfile: + { + profilestring = "Unknown"; + } + break; + case QSystemDeviceInfo::SilentProfile: + { + profilestring = "Silent"; + } + break; + case QSystemDeviceInfo::NormalProfile: + { + profilestring = "Normal"; + } + break; + case QSystemDeviceInfo::LoudProfile: + { + profilestring = "Loud"; + } + break; + case QSystemDeviceInfo::VibProfile: + { + profilestring = "Vibrate"; + } + break; + case QSystemDeviceInfo::OfflineProfile: + { + profilestring = "Offline"; + } + break; + case QSystemDeviceInfo::PowersaveProfile: + { + profilestring = "Powersave"; + } + break; + case QSystemDeviceInfo::CustomProfile: + { + profilestring = "custom"; + } + break; + }; + profileLabel->setText(profilestring); + } +} + + +void Dialog::updateSimStatus() +{ + if(di) { + QString simstring; + switch(di->simStatus()) { + case QSystemDeviceInfo::SimLocked: + { + simstring = "Sim Locked"; + } + break; + case QSystemDeviceInfo::SimNotAvailable: + { + simstring = "Sim not available"; + } + break; + case QSystemDeviceInfo::SingleSimAvailable: + { + simstring = "Single Sim Available"; + + } + break; + case QSystemDeviceInfo::DualSimAvailable: + { + simstring = "Dual Sim available"; + } + break; + + }; + simStatusLabel->setText(simstring); + } +} + + diff --git a/doc/src/snippets/sysinfo-snippets/dialog.h b/doc/src/snippets/sysinfo-snippets/dialog.h new file mode 100644 index 0000000000..67afb7f2cd --- /dev/null +++ b/doc/src/snippets/sysinfo-snippets/dialog.h @@ -0,0 +1,105 @@ +/**************************************************************************** +** +** 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 DIALOG_H +#define DIALOG_H + +#include <QWidget> +#include <qsysteminfo.h> + +#ifdef QTM_EXAMPLES_PREFER_LANDSCAPE +#include "ui_dialog_landscape.h" +#else //QTM_EXAMPLES_PREFER_LANDSCAPE +#ifdef Q_OS_SYMBIAN +#include "ui_dialog_s60.h" +#else //Q_OS_SYMBIAN +#include "ui_dialog.h" +#endif //Q_OS_SYMBIAN +#endif //QTM_EXAMPLES_PREFER_LANDSCAPE +QTM_USE_NAMESPACE + +class Dialog : public QWidget, public Ui_Dialog +{ + Q_OBJECT +public: + Dialog(); + ~Dialog(); + +protected: + void changeEvent(QEvent *e); + +private: + void setupGeneral(); + void setupDevice(); + void setupDisplay(); + void setupStorage(); + void setupNetwork(); + void setupSaver(); + + QSystemScreenSaver *saver; + QSystemInfo *systemInfo; + QSystemDeviceInfo *di; + QSystemNetworkInfo *ni; + +private slots: + void tabChanged(int index); + void getVersion(int index); + void getFeature(int index); + void setSaverEnabled(bool b); + void updateDeviceLockedState(); + + void netStatusComboActivated(int); + void updateBatteryStatus(int); + void updatePowerState(QSystemDeviceInfo::PowerState); + void displayBatteryStatus(QSystemDeviceInfo::BatteryStatus); + void updateProfile(QSystemDeviceInfo::Profile profile); + void updateSimStatus(); + void updateProfile(); + + void displayNetworkStatus(QSystemNetworkInfo::NetworkStatus); + void networkStatusChanged(QSystemNetworkInfo::NetworkMode, QSystemNetworkInfo::NetworkStatus); + void networkSignalStrengthChanged(QSystemNetworkInfo::NetworkMode, int); + void networkNameChanged(QSystemNetworkInfo::NetworkMode,const QString &); + void networkModeChanged(QSystemNetworkInfo::NetworkMode); + +}; + +#endif // DIALOG_H diff --git a/doc/src/snippets/sysinfo-snippets/main.cpp b/doc/src/snippets/sysinfo-snippets/main.cpp new file mode 100644 index 0000000000..ec465a50c9 --- /dev/null +++ b/doc/src/snippets/sysinfo-snippets/main.cpp @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** 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 <QtGui/QApplication> +#include "dialog.h" + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + Dialog w; + +#ifdef Q_OS_SYMBIAN + w.showMaximized(); +#else + w.show(); +#endif + + return a.exec(); +} diff --git a/doc/src/versit.qdoc b/doc/src/versit.qdoc index 4960714f77..43b0458c0f 100644 --- a/doc/src/versit.qdoc +++ b/doc/src/versit.qdoc @@ -50,8 +50,8 @@ \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 +The QtMobility APIs are placed into the \i{QtMobility} namespace. This is done +to facilitate the future migration of Mobility APIs into Qt. See the \l {Quickstart Example}{Quickstart guide} for an example on how the namespace impacts on application development. @@ -71,7 +71,7 @@ Versit \reg is a trademark of the Internet Mail Consortium. \section1 Usage \snippet ../../doc/src/snippets/qtversitdocsample/qtversitdocsample.cpp Complete example -\section1 Classes +\section1 Main Classes \list \o \l{QVersitProperty} \o \l{QVersitDocument} @@ -80,12 +80,4 @@ Versit \reg is a trademark of the Internet Mail Consortium. \o \l{QVersitContactImporter} \o \l{QVersitContactExporter} \endlist - -\section1 Mapping the vCard constants - -vCard properties are mapped to QContactDetails as follows: -\snippet ../../src/versit/qversitdefs_p.h Property name mappings - -vCard type parameters are mapped to subtypes in QContactDetails as follows: -\snippet ../../src/versit/qversitdefs_p.h Property type parameter mappings */ |
