Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-release > by-pkgid > 50facae208d4a6f280e44a513b104320 > files > 507

qt-mobility-doc-1.2.0-13.mga5.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- messaging.qdoc -->
  <title>Qt Mobility 1.2: Messaging</title>
  <link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="content"> 
    <a href="index.html" class="qtref"><span>QtMobility Reference Documentation</span></a>
  </div>
  <div class="breadcrumb toolblock">
    <ul>
      <li class="first"><a href="index.html">Home</a></li>
      <!--  Breadcrumbs go here -->
<li>Messaging</li>
    </ul>
  </div>
</div>
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#namespace">Namespace</a></li>
<li class="level1"><a href="#overview">Overview</a></li>
<li class="level1"><a href="#reference-documentation">Reference documentation</a></li>
<li class="level2"><a href="#main-classes">Main classes</a></li>
<li class="level1"><a href="#composition-and-manipulation-of-messages">Composition and Manipulation of Messages</a></li>
<li class="level1"><a href="#message-accounts">Message Accounts</a></li>
<li class="level1"><a href="#sorting-and-filtering-functionality">Sorting and Filtering Functionality</a></li>
<li class="level2"><a href="#using-the-ordering-functions">Using the Ordering Functions</a></li>
<li class="level2"><a href="#using-the-filter-functions">Using the Filter Functions</a></li>
<li class="level1"><a href="#messaging-services">Messaging Services</a></li>
<li class="level1"><a href="#concurrent-access-to-messaging-data">Concurrent Access to Messaging Data</a></li>
<li class="level1"><a href="#abstraction-of-messaging-data-storage-mechanism">Abstraction of Messaging Data Storage Mechanism</a></li>
<li class="level1"><a href="#qml-messaging-elements">QML Messaging Elements</a></li>
<li class="level1"><a href="#examples">Examples</a></li>
<li class="level2"><a href="#keep-in-touch">Keep In Touch</a></li>
<li class="level2"><a href="#service-actions">Service Actions</a></li>
</ul>
</div>
<h1 class="title">Messaging</h1>
<span class="subtitle"></span>
<!-- $$$messaging.html-description -->
<div class="descr"> <a name="details"></a>
<p>The Qt Messaging API enables access to messaging services to search and sort messages, send messages, retrieve message data, and launch the preferred messaging client on the system to either display an existing message, compose a new message, or respond to an existing message.</p>
<a name="namespace"></a>
<h2>Namespace</h2>
<p>The QtMobility APIs are placed into the <i>QtMobility</i> namespace. This is done to facilitate the future migration of QtMobility APIs into Qt. See the <a href="quickstart.html">Quickstart guide</a> for an example on how the namespace impacts on application development.</p>
<a name="overview"></a>
<h2>Overview</h2>
<p>The messaging library provides a set of APIs for accessing messaging data. Interfaces are provided to retrieve and query messages, folders and accounts, also interfaces to create, modify, and store messages are provided. A unified interface for manipulation and storage of SMS, MMS, MIME Email and TNEF Email messages is provided. Handling of messages that have only been partially retrieved is supported.</p>
<p>An API to access messaging services to send messages and retrieve message data is provided, as well as messaging services to compose, reply to, forward and show messages using a native application.</p>
<p>Notifications of addition, removal and updating of stored messages can be enabled.</p>
<p>The library provides unified access to the messaging data on a device including concurrent access to messaging data by multiple applications, and independence from the mechanism used to store the messaging data on the device.</p>
<p>On Microsoft Windows, MAPI header files are required to be installed, we recommend installing Visual Studio Express for this purpose.</p>
<p>On Linux QMF 2010W41 or newer is required to be installed and the QMF_INCLUDEDIR and QMF_LIBDIR environment variables set to the messagingframework/src/libraries/qmfclient and build/messagingframework/image/lib directories respectively, and for the LD_LIBRARY_PATH to include the build/messagingframework/image/lib directory.</p>
<a name="reference-documentation"></a>
<h2>Reference documentation</h2>
<a name="main-classes"></a>
<h3>Main classes</h3>
<table class="annotated">
<tr class="odd topAlign"><td class="tblName"><p><a href="qmessage.html">QMessage</a></p></td><td class="tblDescr"><p>Convenient interface for working with messages</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qmessageaccount.html">QMessageAccount</a></p></td><td class="tblDescr"><p>Represents a messaging account in the messaging store</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qmessageaccountfilter.html">QMessageAccountFilter</a></p></td><td class="tblDescr"><p>Defines the parameters used for querying a subset of all available accounts from the messaging store</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qmessageaccountid.html">QMessageAccountId</a></p></td><td class="tblDescr"><p>Unique identifier for a QMessageAccount messaging account, within the scope of the messaging store</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qmessageaccountsortorder.html">QMessageAccountSortOrder</a></p></td><td class="tblDescr"><p>Defines the parameters used for sorting a subset of queried accounts from the messaging store</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qmessageaddress.html">QMessageAddress</a></p></td><td class="tblDescr"><p>Interface for a message address</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qmessagecontentcontainer.html">QMessageContentContainer</a></p></td><td class="tblDescr"><p>Interface for internet media (MIME) and Transport Neutral Encapsulation Format (TNEF) content that is possibly only partially retrieved</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qmessagecontentcontainerid.html">QMessageContentContainerId</a></p></td><td class="tblDescr"><p>Unique identifier for QMessageContentContainer internet media (MIME) type entities, within the scope of the containing message</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qmessagedatacomparator.html">QMessageDataComparator</a></p></td><td class="tblDescr"><p>Contains types used in specifying the comparison of MessageStore objects with user-defined values</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qmessagefilter.html">QMessageFilter</a></p></td><td class="tblDescr"><p>Defines the parameters used for querying a subset of all available messages from the messaging store</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qmessagefolder.html">QMessageFolder</a></p></td><td class="tblDescr"><p>Interface for folders containing messages in the messaging store</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qmessagefolderfilter.html">QMessageFolderFilter</a></p></td><td class="tblDescr"><p>Defines the parameters used for querying a subset of all available folders from the messaging store</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qmessagefolderid.html">QMessageFolderId</a></p></td><td class="tblDescr"><p>Unique identifier for a QMessageFolder message folder, within the scope of the messaging store</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qmessagefoldersortorder.html">QMessageFolderSortOrder</a></p></td><td class="tblDescr"><p>Defines the parameters used for sorting a subset of queried folders from the messaging store</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qmessageid.html">QMessageId</a></p></td><td class="tblDescr"><p>Unique identifier for a QMessage message within the scope of the messaging store</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qmessagemanager.html">QMessageManager</a></p></td><td class="tblDescr"><p>Represents the main interface for storage and retrieval of messages, folders and accounts in the system message store</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qmessageservice.html">QMessageService</a></p></td><td class="tblDescr"><p>The interface for requesting messaging service operations</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qmessagesortorder.html">QMessageSortOrder</a></p></td><td class="tblDescr"><p>Defines the parameters used for sorting a subset of queried messages from the messaging store</p></td></tr>
</table>
<a name="composition-and-manipulation-of-messages"></a>
<h2>Composition and Manipulation of Messages</h2>
<p>The library provides a number of classes to assist with the composition and manipulation of message data. Messages of all supported types are represented uniformly. Messages can be composed of multiple parts.</p>
<p>Classes to assist with composition and manipulation of messages:</p>
<table class="generic">
<thead><tr class="qt-style"><th >Class</th><th >Description</th></tr></thead>
<tr valign="top" class="odd"><td ><a href="qmessageid.html">QMessageId</a></td><td >Represents the messaging store identifiers for messages.</td></tr>
<tr valign="top" class="even"><td ><a href="qmessage.html">QMessage</a></td><td >Convenient interface for working with messages.</td></tr>
<tr valign="top" class="odd"><td ><a href="qmessagecontentcontainer.html">QMessageContentContainer</a></td><td >Interface for an internet media (MIME) entity.</td></tr>
<tr valign="top" class="even"><td ><a href="qmessageaddress.html">QMessageAddress</a></td><td >Interface for manipulating message address strings.</td></tr>
</table>
<a name="message-accounts"></a>
<h2>Message Accounts</h2>
<p>The library provides classes for accessing information about messaging accounts both outgoing and incoming.</p>
<p>Classes relating to messaging accounts:</p>
<table class="generic">
<thead><tr class="qt-style"><th >Class</th><th >Description</th></tr></thead>
<tr valign="top" class="odd"><td ><a href="qmessageaccountid.html">QMessageAccountId</a></td><td >Represents the messaging store identifiers for accounts.</td></tr>
<tr valign="top" class="even"><td ><a href="qmessageaccount.html">QMessageAccount</a></td><td >Stores attributes for a messaging account.</td></tr>
<tr valign="top" class="odd"><td ><a href="qmessagefolderid.html">QMessageFolderId</a></td><td >Represents the messaging store identifiers for folders.</td></tr>
<tr valign="top" class="even"><td ><a href="qmessagefolder.html">QMessageFolder</a></td><td >Represents a folder of messages on the messaging store.</td></tr>
</table>
<a name="sorting-and-filtering-functionality"></a>
<h2>Sorting and Filtering Functionality</h2>
<p>The library provides a number of sort and filter functions to aid in selecting a useful view of data. This reduces the burden on the client of the library for managing the messaging data, as well as allowing better use of the underlying storage mechanism.</p>
<p>Sorting is accomplished by providing a sorting object, specifying the sort order, and the message property upon which to order.</p>
<p>Filtering is accomplished by providing a filtering condition, specifying a value, the property to match, and the desired relation between the value and the property.</p>
<p>Filters can be combined using boolean operators to produce filters of arbitrary complexity.</p>
<p>Classes to assist with sorting and filtering messages:</p>
<table class="generic">
<thead><tr class="qt-style"><th >Class</th><th >Description</th></tr></thead>
<tr valign="top" class="odd"><td ><a href="qmessagemanager.html">QMessageManager</a></td><td >Represents the main interface for storage and retrieval of messages, folders and accounts from the messaging store.</td></tr>
<tr valign="top" class="even"><td ><a href="qmessagefilter.html">QMessageFilter</a></td><td >Defines the parameters used for querying a subset of all available messages from the messaging store.</td></tr>
<tr valign="top" class="odd"><td ><a href="qmessagesortorder.html">QMessageSortOrder</a></td><td >Defines the parameters used for sorting messages queried from the messaging store.</td></tr>
<tr valign="top" class="even"><td ><a href="qmessagefolderfilter.html">QMessageFolderFilter</a></td><td >Defines the parameters used for querying a subset of all available message folders from the messaging store.</td></tr>
<tr valign="top" class="odd"><td ><a href="qmessagefoldersortorder.html">QMessageFolderSortOrder</a></td><td >Defines the parameters used for sorting message folders queried from the messaging store.</td></tr>
<tr valign="top" class="even"><td ><a href="qmessageaccountfilter.html">QMessageAccountFilter</a></td><td >Defines the parameters used for querying a subset of all available accounts from the messaging store.</td></tr>
<tr valign="top" class="odd"><td ><a href="qmessageaccountsortorder.html">QMessageAccountSortOrder</a></td><td >Defines the parameters used for sorting accounts queried from the messaging store.</td></tr>
</table>
<a name="using-the-ordering-functions"></a>
<h3>Using the Ordering Functions</h3>
<p>An example of the use of Ordering functions can be found in the Send Message example.</p>
<pre class="cpp"> <span class="type">QMessageIdList</span> ids <span class="operator">=</span> <span class="type"><a href="qmessagemanager.html">QMessageManager</a></span>()<span class="operator">.</span>queryMessages(<span class="type"><a href="qmessagefilter.html">QMessageFilter</a></span>()<span class="operator">,</span>
     <span class="type"><a href="qmessagesortorder.html">QMessageSortOrder</a></span><span class="operator">::</span>byReceptionTimeStamp(<span class="type"><a href="http://qt.nokia.com/doc/4.7/qt.html">Qt</a></span><span class="operator">::</span>DescendingOrder)<span class="operator">,</span> <span class="number">100</span><span class="operator">,</span> <span class="number">0</span>);</pre>
<a name="using-the-filter-functions"></a>
<h3>Using the Filter Functions</h3>
<p>The following code is taken from the Keep In Touch example, it demonstrates the use of filters to achieve desired effects. You can also see how the filters once constructed can be operated on by typical boolean operators, in the same way you would manipulate bit settings in C. In this way we can build more complex conditions.</p>
<pre class="cpp"> <span class="type"><a href="qmessagefilter.html">QMessageFilter</a></span> includeFilter(<span class="type"><a href="qmessagefilter.html">QMessageFilter</a></span><span class="operator">::</span>byTimeStamp(minimumDate<span class="operator">,</span>
         <span class="type"><a href="qmessagedatacomparator.html">QMessageDataComparator</a></span><span class="operator">::</span>GreaterThanEqual));
 <span class="type"><a href="qmessagefilter.html">QMessageFilter</a></span> excludeFilter(<span class="type"><a href="qmessagefilter.html">QMessageFilter</a></span><span class="operator">::</span>byTimeStamp(maximumDate<span class="operator">,</span>
         <span class="type"><a href="qmessagedatacomparator.html">QMessageDataComparator</a></span><span class="operator">::</span>GreaterThanEqual));
 <span class="type"><a href="qmessagefilter.html">QMessageFilter</a></span> outgoingFilter(<span class="type"><a href="qmessagefilter.html">QMessageFilter</a></span><span class="operator">::</span>byStatus(<span class="type"><a href="qmessage.html">QMessage</a></span><span class="operator">::</span>Incoming<span class="operator">,</span>
         <span class="type"><a href="qmessagedatacomparator.html">QMessageDataComparator</a></span><span class="operator">::</span>Excludes));

 <span class="comment">// Search for messages containing addresses to exclude</span>
 service<span class="operator">.</span>queryMessages(outgoingFilter <span class="operator">&amp;</span> excludeFilter);

 <span class="comment">// Create the filter needed to locate messages to search for addresses</span>
 inclusionFilter <span class="operator">=</span> (outgoingFilter <span class="operator">&amp;</span> includeFilter <span class="operator">&amp;</span> <span class="operator">~</span>excludeFilter);</pre>
<a name="messaging-services"></a>
<h2>Messaging Services</h2>
<p>The library provides the <a href="qmessageservice.html">QMessageService</a> class, which provides an interface to communicate with the system's native messaging services, including sending messages, retrieving message data, and composing or showing a message using a native application.</p>
<p>Service actions communciate their operational status by emitting signals.</p>
<p>Functions outside the <a href="qmessageservice.html">QMessageService</a> class should not invoke network activity. That is, only <a href="qmessageservice.html">QMessageService</a> functions should be responsible for initiating network activity (Note: this is not true for the Windows desktop and mobile platforms, where network activity can occur outside the client's control).</p>
<a name="concurrent-access-to-messaging-data"></a>
<h2>Concurrent Access to Messaging Data</h2>
<p>The library provides a level of concurrent access to messaging data by multiple clients.</p>
<p>The concurrent access does guarantee that data won't be corrupted by concurrent access, however it does not give any guarantees as to performance of messaging data access if accessed concurrently by multiple clients.</p>
<p>A single client may access the messaging data from multiple threads, but only one thread may access the data concurrently.</p>
<a name="abstraction-of-messaging-data-storage-mechanism"></a>
<h2>Abstraction of Messaging Data Storage Mechanism</h2>
<p>The library abstracts the storage method used to store messaging data.</p>
<a name="qml-messaging-elements"></a>
<h2>QML Messaging Elements</h2>
<ul>
<li><a href="qml-messagemodel.html">MessageModel</a></li>
<li><a href="qml-messagefilter.html">MessageFilter</a></li>
<li><a href="qml-messageunionfilter.html">MessageUnionFilter</a></li>
<li><a href="qml-messageintersectionfilter.html">MessageIntersectionFilter</a></li>
</ul>
<a name="examples"></a>
<h2>Examples</h2>
<a name="keep-in-touch"></a>
<h3>Keep In Touch</h3>
<p>The <a href="keepintouch.html">Keep In Touch</a> example shows how to extract useful information from the messages stored by the system.</p>
<a name="service-actions"></a>
<h3>Service Actions</h3>
<p>The <a href="serviceactions.html">Service Actions</a> example is a program to demonstrate how to compose, send, show, query and retrieve messages, and also react to message store events using the QtMobility Messaging API.</p>
</div>
<!-- @@@messaging.html -->
  <div class="ft">
    <span></span>
  </div>
</div> 
<div class="footer">
  <p>
     <acronym title="Copyright">&copy;</acronym> 2008-2011 Nokia Corporation and/or its
     subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation 
     in Finland and/or other countries worldwide.</p>
  <p>
     All other trademarks are property of their respective owners. <a title="Privacy Policy"
     href="http://qt.nokia.com/about/privacy-policy">Privacy Policy</a></p>
  <br />
  <p>
    Licensees holding valid Qt Commercial licenses may use this document in accordance with the    Qt Commercial License Agreement provided with the Software or, alternatively, in accordance    with the terms contained in a written agreement between you and Nokia.</p>
  <p>
    Alternatively, this document may be used under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU
    Free Documentation License version 1.3</a>
    as published by the Free Software Foundation.</p>
</div>
</body>
</html>