Sophie

Sophie

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

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" />
<!-- qdeclarativemessagemodel.cpp -->
  <title>Qt Mobility 1.2: QML MessageModel Element</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><a href="http://qt.nokia.com/doc/4.7/qdeclarativeelements.html">QML Elements</a></li>
<li>QML MessageModel Element</li>
    </ul>
  </div>
</div>
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#signal-handlers">Signal Handlers</a></li>
<li class="level1"><a href="#methods">Methods</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QML MessageModel Element</h1>
<span class="subtitle"></span>
<!-- $$$MessageModel-brief -->
<p>The MessageModel element provides access to messages. <a href="#details">More...</a></p>
<!-- @@@MessageModel -->
<p>This element was introduced in  Mobility 1.1.</p>
<ul>
<li><a href="qml-messagemodel-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="properties"></a>
<h2>Properties</h2>
<ul>
<li class="fn"><b><b><a href="qml-messagemodel.html#count-prop">count</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-messagemodel.html#filter-prop">filter</a></b></b> : MessageFilter</li>
<li class="fn"><b><b><a href="qml-messagemodel.html#limit-prop">limit</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-messagemodel.html#sortBy-prop">sortBy</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-messagemodel.html#sortOrder-prop">sortOrder</a></b></b> : enumeration</li>
</ul>
<a name="signal-handlers"></a>
<h2>Signal Handlers</h2>
<ul>
<li class="fn"><b><b><a href="qml-messagemodel.html#messageAdded-signal">messageAdded</a></b></b></li>
</ul>
<a name="methods"></a>
<h2>Methods</h2>
<ul>
<li class="fn"><b><b><a href="qml-messagemodel.html#removeMessage-method">removeMessage</a></b></b></li>
<li class="fn"><b><b><a href="qml-messagemodel.html#showMessage-method">showMessage</a></b></b></li>
</ul>
<!-- $$$MessageModel-description -->
<a name="details"></a>
<h2>Detailed Description</h2>
<p>This element is part of the <b>QtMobility.messaging 1.1</b> module.</p>
<p>MessageModel provides a model of messages from the message store. The contents of the model can be specified via a <a href="qml-messagemodel.html#filter-prop">filter</a>, and sorted via the <a href="qml-messagemodel.html#sortBy-prop">sortBy</a> and <a href="qml-messagemodel.html#sortOrder-prop">sortOrder</a> properties. The model is automatically updated if the contents of the store change.</p>
<p>The following roles are supported by the model:</p>
<table class="generic">
<thead><tr class="qt-style"><th >Role</th><th >type</th></tr></thead>
<tr valign="top" class="odd"><td >subject</td><td >string</td></tr>
<tr valign="top" class="even"><td >type</td><td >enumeration<ul>
<li><a href="qml-messagefilter.html">MessageFilter</a>.Mms</li>
<li><a href="qml-messagefilter.html">MessageFilter</a>.Sms</li>
<li><a href="qml-messagefilter.html">MessageFilter</a>.Email</li>
<li><a href="qml-messagefilter.html">MessageFilter</a>.InstantMessage</li>
</ul>
</td></tr>
<tr valign="top" class="odd"><td >size</td><td >int</td></tr>
<tr valign="top" class="even"><td >sender</td><td >string</td></tr>
<tr valign="top" class="odd"><td >to</td><td >List&lt;string&gt;</td></tr>
<tr valign="top" class="even"><td >date</td><td >Date</td></tr>
<tr valign="top" class="odd"><td >receivedDate</td><td >Date</td></tr>
<tr valign="top" class="even"><td >priority</td><td >enumeration<ul>
<li><a href="qml-messagefilter.html">MessageFilter</a>.HighPriority</li>
<li><a href="qml-messagefilter.html">MessageFilter</a>.NormalPriority</li>
<li><a href="qml-messagefilter.html">MessageFilter</a>.LowPriority</li>
</ul>
</td></tr>
<tr valign="top" class="odd"><td >body</td><td >string</td></tr>
<tr valign="top" class="even"><td >ready</td><td >bool</td></tr>
</table>
<p><b>Note</b>: since the body can be large and may need to be fetched from the server it is recommended that viewing the body be a user action, and the body role not be bound to until needed. If the body has not yet been downloaded, it will be requested. <tt>body</tt> will remain undefined until it has been retrieved.</p>
<p>The <tt>ready</tt> role is true if the message meta data has been retrieved; otherwise false. Since MessageModel threaded, all messages are initially not ready, and will become ready once the data is available.</p>
<p>The following example displays the subject, sender and date of all messages sorted in descending order by timestamp:</p>
<pre class="qml"> import Qt 4.7
 import QtMobility.messaging 1.1

 <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-rectangle.html">Rectangle</a></span> {
     <span class="name">width</span>: <span class="number">320</span>
     <span class="name">height</span>: <span class="number">480</span>
     <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-listview.html">ListView</a></span> {
         <span class="name">id</span>: <span class="name">list</span>
         <span class="name">anchors</span>.fill: <span class="name">parent</span>
         <span class="name">model</span>: <span class="name">MessageModel</span> {
             <span class="name">sortBy</span>: <span class="name">MessageModel</span>.<span class="name">Timestamp</span>
             <span class="name">sortOrder</span>: <span class="name">MessageModel</span>.<span class="name">DescendingOrder</span>
         }
         <span class="name">delegate</span>: <span class="name">Item</span> {
             <span class="name">id</span>: <span class="name">wrapper</span>
             <span class="name">height</span>: <span class="number">32</span>; <span class="name">width</span>: <span class="name">list</span>.<span class="name">width</span>
             <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-text.html">Text</a></span> { <span class="name">id</span>: <span class="name">subjText</span>; <span class="name">text</span>: <span class="name">subject</span>; <span class="name">font</span>.pixelSize: <span class="number">13</span>; <span class="name">x</span>: <span class="number">3</span> }
             <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-text.html">Text</a></span> {
                 <span class="name">text</span>: <span class="name">sender</span>; <span class="name">color</span>: <span class="string">&quot;gray&quot;</span>; <span class="name">font</span>.pixelSize: <span class="number">9</span>
                 <span class="name">x</span>: <span class="number">3</span>; <span class="name">width</span>: <span class="name">parent</span>.<span class="name">width</span><span class="operator">-</span><span class="number">100</span>;
                 <span class="name">anchors</span>.top: <span class="name">subjText</span>.<span class="name">bottom</span>; <span class="name">anchors</span>.topMargin: <span class="number">3</span>
                 <span class="name">elide</span>: <span class="name">Text</span>.<span class="name">ElideRight</span>
             }
             <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-text.html">Text</a></span> {
                 <span class="name">text</span>: <span class="name">date</span>; <span class="name">color</span>: <span class="string">&quot;gray&quot;</span>; <span class="name">font</span>.pixelSize: <span class="number">9</span>
                 <span class="name">anchors</span>.right: <span class="name">parent</span>.<span class="name">right</span>
                 <span class="name">anchors</span>.top: <span class="name">subjText</span>.<span class="name">bottom</span>; <span class="name">anchors</span>.topMargin: <span class="number">3</span>
             }
         }
     }
 }</pre>
<p><b>See also </b><a href="qml-messagefilter.html">MessageFilter</a>.</p>
<!-- @@@MessageModel -->
<h2>Property Documentation</h2>
<!-- $$$count -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="count-prop"></a><span class="qmlreadonly">read-only</span><span class="name">count</span> : <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-int.html">int</a></span></p></td></tr></table></div><div class="qmldoc"><p>Holds the number of messages matching the filter.</p>
<p>If <a href="qml-messagemodel.html#limit-prop">limit</a> is set then there will be at most <a href="qml-messagemodel.html#limit-prop">limit</a> messages.</p>
<p>This property group was introduced in  Mobility 1.1.</p>
</div></div><!-- @@@count -->
<br/>
<!-- $$$filter -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="filter-prop"></a><span class="name">filter</span> : <span class="type"><a href="qml-messagefilter.html">MessageFilter</a></span></p></td></tr></table></div><div class="qmldoc"><p>The <a href="qml-messagefilter.html">MessageFilter</a> specifying the messages to provide.</p>
<p>This property group was introduced in  Mobility 1.1.</p>
</div></div><!-- @@@filter -->
<br/>
<!-- $$$limit -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="limit-prop"></a><span class="name">limit</span> : <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-int.html">int</a></span></p></td></tr></table></div><div class="qmldoc"><p>Holds the maximum number of messages to retrieve.</p>
<p>A value of zero (default) will retrieve all messages.</p>
<p>This property group was introduced in  Mobility 1.1.</p>
</div></div><!-- @@@limit -->
<br/>
<!-- $$$sortBy -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="sortBy-prop"></a><span class="name">sortBy</span> : <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-enumeration.html">enumeration</a></span></p></td></tr></table></div><div class="qmldoc"><p>Specifies the role to sort by:</p>
<ul>
<li><a href="qml-messagemodel.html">MessageModel</a>.Priority</li>
<li><a href="qml-messagemodel.html">MessageModel</a>.Sender</li>
<li><a href="qml-messagemodel.html">MessageModel</a>.Size</li>
<li><a href="qml-messagemodel.html">MessageModel</a>.StatusRead</li>
<li><a href="qml-messagemodel.html">MessageModel</a>.StatusIncoming</li>
<li><a href="qml-messagemodel.html">MessageModel</a>.Subject</li>
<li><a href="qml-messagemodel.html">MessageModel</a>.Timestamp (default)</li>
<li><a href="qml-messagemodel.html">MessageModel</a>.ReceptionTimestamp</li>
<li><a href="qml-messagemodel.html">MessageModel</a>.Recipients</li>
<li><a href="qml-messagemodel.html">MessageModel</a>.Type</li>
</ul>
<p>This property group was introduced in  Mobility 1.1.</p>
</div></div><!-- @@@sortBy -->
<br/>
<!-- $$$sortOrder -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="sortOrder-prop"></a><span class="name">sortOrder</span> : <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-enumeration.html">enumeration</a></span></p></td></tr></table></div><div class="qmldoc"><p>Specifies the sort order:</p>
<ul>
<li><a href="qml-messagemodel.html">MessageModel</a>.AscendingOrder</li>
<li><a href="qml-messagemodel.html">MessageModel</a>.DescendingOrder</li>
</ul>
<p>This property group was introduced in  Mobility 1.1.</p>
</div></div><!-- @@@sortOrder -->
<br/>
<h2>Signal Handler Documentation</h2>
<!-- $$$messageAdded -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="messageAdded-signal"></a>MessageModel::<span class="name">messageAdded</span> ()</p></td></tr></table></div><div class="qmldoc"><p>This handler is called when a message that matches the filter criteria is added to the store. The model will be updated shortly and will include the new message.</p>
<p>This documentation was introduced in  Mobility 1.1.</p>
</div></div><!-- @@@messageAdded -->
<br/>
<h2>Method Documentation</h2>
<!-- $$$removeMessage -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="removeMessage-method"></a>MessageModel::<span class="name">removeMessage</span> ( <span class="type">index</span> )</p></td></tr></table></div><div class="qmldoc"><p>Remove the message at <i>index</i> from the mail store and the originating server (if applicable).</p>
<p>This documentation was introduced in  Mobility 1.1.</p>
</div></div><!-- @@@removeMessage -->
<br/>
<!-- $$$showMessage -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="showMessage-method"></a>MessageModel::<span class="name">showMessage</span> ( <span class="type">index</span> )</p></td></tr></table></div><div class="qmldoc"><p>Displays the message at <i>index</i> using the system message client.</p>
<p>This documentation was introduced in  Mobility 1.1.</p>
</div></div><!-- @@@showMessage -->
<br/>
  <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>