Sophie

Sophie

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

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" />
<!-- qml-contacts.qdoc -->
  <title>Qt Mobility 1.2: Contacts QML Plugin</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>Contacts QML Plugin</li>
    </ul>
  </div>
</div>
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#overview">Overview</a></li>
<li class="level2"><a href="#contactmodel-element">ContactModel element</a></li>
<li class="level2"><a href="#contact-element">Contact element</a></li>
<li class="level1"><a href="#contacts-elements">Contacts Elements</a></li>
</ul>
</div>
<h1 class="title">Contacts QML Plugin</h1>
<span class="subtitle"></span>
<!-- $$$qml-contacts.html-description -->
<div class="descr"> <a name="details"></a>
<a name="overview"></a>
<h2>Overview</h2>
<p>The identifying string for this component is <i>&quot;QtMobility.contacts&quot;</i>. Use this in the QML <i>import</i> statement.</p>
<p>The Contacts QML plugin supplies filters to search for contacts with particular values for various properties in the contact details. The Contact itself is represented by a model called a <a href="qml-contactmodel.html">ContactModel</a>. This model supplies a rich selection of properties to display or to use as filter criteria. We can also construct a series of filters and combine them using the <a href="qml-intersectionfilter.html">IntersectionFilter</a> and <a href="qml-unionfilter.html">UnionFilter</a> to represent a logical 'and' and 'or' of the results. Other properties also give control over the filter logic, such as <a href="qml-detailrangefilter.html#rangeFlags-prop">RangeFlags</a> and the <a href="qml-detailfilter.html#matchFlags-prop">MatchFlags</a>.</p>
<a name="contactmodel-element"></a>
<h3>ContactModel element</h3>
<p>The <a href="qml-contactmodel.html">ContactModel</a> element is used to perform the requests on a contacts store. As an example consider the follow QML code which has a <a href="qml-contactmodel.html">ContactModel</a> element containing a filter and a list of sort orders. The contacts will be restricted to those living in Australia who are either male or born between 1970 and 1984.</p>
<p>The list of contacts in this <a href="qml-contactmodel.html">ContactModel</a> will firstly sort on the contacts' organization name and then sort on the contacts' first name.</p>
<pre class="cpp"> import <span class="type">QtMobility</span><span class="operator">.</span>contacts <span class="number">1.1</span>

 <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>

 model: ContactModel {

     filter: IntersectionFilter {
         DetailFilter {
             detail:ContactDetail<span class="operator">.</span>Address
             field: Address<span class="operator">.</span>Country
             value: <span class="string">&quot;Australia&quot;</span>
         }
         UnionFilter {
             DetailRangeFilter {
                 detail:ContactDetail<span class="operator">.</span>Birthday
                 field:Birthday<span class="operator">.</span>Birthday
                 min: <span class="char">'1970-01-01'</span>
                 max: <span class="char">'1984-12-31'</span>
             }
             DetailFilter {
                 detail:ContactDetail<span class="operator">.</span>Gender
                 field:Gender<span class="operator">.</span>Gender
                 value:Gender<span class="operator">.</span>Male
             }
         }
     }
     sortOrders: <span class="operator">[</span>
        SortOrder {
           detail:ContactDetail<span class="operator">.</span>Organization
           field:Organization<span class="operator">.</span>Name
           direction:<span class="type"><a href="http://qt.nokia.com/doc/4.7/qt.html">Qt</a></span><span class="operator">.</span>AscendingOrder
        }<span class="operator">,</span>
        SortOrder {
           detail:ContactDetail<span class="operator">.</span>Name
           field:Name<span class="operator">.</span>FirstName
           direction:<span class="type"><a href="http://qt.nokia.com/doc/4.7/qt.html">Qt</a></span><span class="operator">.</span>AscendingOrder
        }
     <span class="operator">]</span>
 }</pre>
<a name="contact-element"></a>
<h3>Contact element</h3>
<p>The <a href="qml-contact.html">Contact</a> element represents a single contact instance from a the contacts store. All contact details are organized as group properties. The following snippet shows how you can construct a Contact object in QML:</p>
<pre class="cpp"> Rectangle {
     id: topItem
     width: <span class="number">360</span>
     height: <span class="number">640</span>
     x: <span class="number">0</span>
     y: <span class="number">0</span>

     Contact {
         id: myContact
         Name {
             firstName:<span class="string">&quot;John&quot;</span>
             lastName:<span class="string">&quot;Gates&quot;</span>
         }

         EmailAddress {
             emailAddress:<span class="string">&quot;john@example.com&quot;</span>
         }
         EmailAddress {
             emailAddress:<span class="string">&quot;mygmailaccount@gmail.com&quot;</span>
         }

         address<span class="operator">.</span>street:<span class="string">&quot;53 Mysteet St&quot;</span>
         address<span class="operator">.</span>locality: <span class="string">&quot;My City&quot;</span>
         address<span class="operator">.</span>region: <span class="string">&quot;My Region&quot;</span>
         address<span class="operator">.</span>postcode:<span class="string">&quot;1111&quot;</span>
         address<span class="operator">.</span>country:<span class="string">&quot;My Country&quot;</span>
         address<span class="operator">.</span>subTypes:<span class="operator">[</span>Address<span class="operator">.</span>Postal<span class="operator">,</span> Address<span class="operator">.</span>Domestic<span class="operator">]</span>
         address<span class="operator">.</span>postOfficeBox:<span class="string">&quot;1111&quot;</span>

         Nickname {
             nickname:<span class="string">&quot;John&quot;</span>
         }

         PhoneNumber {
             number: <span class="string">&quot;1111111111&quot;</span>
             subTypes:<span class="operator">[</span>PhoneNumber<span class="operator">.</span>Mobile<span class="operator">]</span>
         }

         PhoneNumber {
             number: <span class="string">&quot;2222222222&quot;</span>
             subTypes:<span class="operator">[</span>PhoneNumber<span class="operator">.</span>Fax<span class="operator">]</span>
         }

         PhoneNumber {
             number: <span class="string">&quot;3333333333&quot;</span>
             subTypes:<span class="operator">[</span>PhoneNumber<span class="operator">.</span>Landline<span class="operator">]</span>
         }
     }


     Column {
         spacing:<span class="number">4</span>

         <span class="comment">//access the same property with different syntaxes</span>
         Text { text:<span class="string">&quot;Name(from property name):&quot;</span> <span class="operator">+</span> myContact<span class="operator">.</span>name<span class="operator">.</span>firstName <span class="operator">+</span> <span class="string">&quot; &quot;</span> <span class="operator">+</span> myContact<span class="operator">.</span>name<span class="operator">.</span>lastName }
         Text { text:<span class="string">&quot;Name(from detail type):&quot;</span> <span class="operator">+</span> myContact<span class="operator">.</span>detail(ContactDetail<span class="operator">.</span>Name)<span class="operator">.</span>firstName <span class="operator">+</span> <span class="string">&quot; &quot;</span> <span class="operator">+</span> myContact<span class="operator">.</span>name<span class="operator">.</span>lastName }
         Text { text:<span class="string">&quot;Name(from detail name):&quot;</span> <span class="operator">+</span> myContact<span class="operator">.</span>detail(<span class="string">&quot;Name&quot;</span>)<span class="operator">.</span>firstName <span class="operator">+</span> <span class="string">&quot; &quot;</span> <span class="operator">+</span> myContact<span class="operator">.</span>name<span class="operator">.</span>lastName }

         Text { text:<span class="string">&quot;Address:&quot;</span> <span class="operator">+</span> myContact<span class="operator">.</span>address<span class="operator">.</span>street <span class="operator">+</span> <span class="string">&quot; &quot;</span> <span class="operator">+</span> myContact<span class="operator">.</span>address<span class="operator">.</span>locality <span class="operator">+</span> <span class="string">&quot; &quot;</span> <span class="operator">+</span> myContact<span class="operator">.</span>address<span class="operator">.</span>region <span class="operator">+</span> <span class="string">&quot; &quot;</span> <span class="operator">+</span> myContact<span class="operator">.</span>address<span class="operator">.</span>postcode }

         <span class="comment">//If a contact contains multiple details for the same detail type, you can access them with the dynamic property names.</span>
         Text { text:<span class="string">&quot;How many email accounts?:&quot;</span> <span class="operator">+</span> myContact<span class="operator">.</span>emails<span class="operator">.</span>length }
         Text { text:<span class="string">&quot;Email[0]:&quot;</span> <span class="operator">+</span> myContact<span class="operator">.</span>emails<span class="operator">[</span><span class="number">0</span><span class="operator">]</span><span class="operator">.</span>emailAddress }

         Text { text:<span class="string">&quot;How many phone numbers?:&quot;</span> <span class="operator">+</span> myContact<span class="operator">.</span>phoneNumbers<span class="operator">.</span>length }
         Text { text:<span class="string">&quot;phone number[0]:&quot;</span> <span class="operator">+</span> myContact<span class="operator">.</span>phoneNumbers<span class="operator">[</span><span class="number">0</span><span class="operator">]</span><span class="operator">.</span>number }
         Text { text:<span class="string">&quot;phone number[1]:&quot;</span> <span class="operator">+</span> myContact<span class="operator">.</span>phoneNumbers<span class="operator">[</span><span class="number">1</span><span class="operator">]</span><span class="operator">.</span>number }
         Text { text:<span class="string">&quot;phone number[2]:&quot;</span> <span class="operator">+</span> myContact<span class="operator">.</span>phoneNumbers<span class="operator">[</span><span class="number">2</span><span class="operator">]</span><span class="operator">.</span>number }
     }
 }</pre>
<a name="contacts-elements"></a>
<h2>Contacts Elements</h2>
<table class="annotated">
<tr class="odd topAlign"><td class="tblName"><p><a href="qml-actionfilter.html">QML ActionFilter Element</a></p></td><td class="tblDescr"><p>The ActionFilter element provides a filter based around an action availability criterion.</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qml-address.html">QML Address Element</a></p></td><td class="tblDescr"><p>The Address element contains an address of a contact.</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qml-anniversary.html">QML Anniversary Element</a></p></td><td class="tblDescr"><p>The Anniversary element contains an anniversary of a contact.</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qml-avatar.html">QML Avatar Element</a></p></td><td class="tblDescr"><p>The Avatar element contains avatar URLs of a contact.</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qml-birthday.html">QML Birthday Element</a></p></td><td class="tblDescr"><p>The Birthday element contains a birthday of a contact.</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qml-changelogfilter.html">QML ChangeLogFilter Element</a></p></td><td class="tblDescr"><p>The ChangeLogFilter element provides a filter based around a contact timestamp criterion.</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qml-contact.html">QML Contact Element</a></p></td><td class="tblDescr"><p>The Contact element represents an addressbook contact, A Contact object has a collection of details (like a name, phone numbers and email addresses). Each detail (which can have multiple fields) is stored in an appropriate subclass of ContactDetail, and the Contact allows retrieving these details in various ways.</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qml-contactdetail.html">QML ContactDetail Element</a></p></td><td class="tblDescr"><p>The ContactDetail element represents a single, complete detail about a contact.</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qml-contactmodel.html">QML ContactModel Element</a></p></td><td class="tblDescr"><p>The ContactModel element provides access to contacts from the contacts store.</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qml-detailfilter.html">QML DetailFilter Element</a></p></td><td class="tblDescr"><p>The DetailFilter element provides a filter based around a detail value criterion.</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qml-detailrangefilter.html">QML DetailRangeFilter Element</a></p></td><td class="tblDescr"><p>The DetailRangeFilter element provides a filter based around a detail value range criterion.</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qml-displaylabel.html">QML DisplayLabel Element</a></p></td><td class="tblDescr"><p>The DisplayLabel element contains the (possibly synthesized) display label of a contact.</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qml-emailaddress.html">QML EmailAddress Element</a></p></td><td class="tblDescr"><p>The EmailAddress element contains an email address of a contact.</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qml-family.html">QML Family Element</a></p></td><td class="tblDescr"><p>The Family element contains names of family members of a contact.</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qml-favorite.html">QML Favorite Element</a></p></td><td class="tblDescr"><p>The Favorite element indicates if a contact is a favorite contact as well as the position it should appear in an ordered list of favorites.</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qml-fetchhint.html">QML FetchHint Element</a></p></td><td class="tblDescr"><p>The FetchHint element provides hints to the manager about which contact information needs to be retrieved in an asynchronous fetch request or a synchronous function call.</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qml-filter.html">QML Filter Element</a></p></td><td class="tblDescr"><p>The Filter element is used as a property of ContactModel, to allow selection of contacts which have certain details or properties.</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qml-gender.html">QML Gender Element</a></p></td><td class="tblDescr"><p>The Gender element contains the gender of a contact.</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qml-geolocation.html">QML GeoLocation Element</a></p></td><td class="tblDescr"><p>The GeoLocation element contains a global location coordinate associated with a contact.</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qml-globalpresence.html">QML GlobalPresence Element</a></p></td><td class="tblDescr"><p>The GlobalPresence element provides aggregated presence information for a contact, synthesized or supplied by the backend.</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qml-guid.html">QML Guid Element</a></p></td><td class="tblDescr"><p>The Guid element contains a globally unique Id of a contact, for use in synchronization with other datastores.</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qml-hobby.html">QML Hobby Element</a></p></td><td class="tblDescr"><p>The Hobby element contains a hobby of the contact.</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qml-idfilter.html">QML IdFilter Element</a></p></td><td class="tblDescr"><p>The IdFilter element provides a filter based around a list of contact ids.</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qml-intersectionfilter.html">QML IntersectionFilter Element</a></p></td><td class="tblDescr"><p>The IntersectionFilter element provides a filter which intersects the results of other filters.</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qml-invalidfilter.html">QML InvalidFilter Element</a></p></td><td class="tblDescr"><p>the InvalidFilter element provides a filter which will never match any contacts.</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qml-name.html">QML Name Element</a></p></td><td class="tblDescr"><p>The Name element contains a name of a contact.</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qml-nickname.html">QML Nickname Element</a></p></td><td class="tblDescr"><p>The Nickname element contains a nickname of a contact.</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qml-note.html">QML Note Element</a></p></td><td class="tblDescr"><p>The Note element contains a note associated with a contact.</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qml-onlineaccount.html">QML OnlineAccount Element</a></p></td><td class="tblDescr"><p>The OnlineAccount element contains a note associated with a contact.</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qml-organization.html">QML Organization Element</a></p></td><td class="tblDescr"><p>The Organization element provides details about an organization that the contact is either a part of, or stands for.</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qml-phonenumber.html">QML PhoneNumber Element</a></p></td><td class="tblDescr"><p>The PhoneNumber element provides a phone number of a contact.</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qml-presence.html">QML Presence Element</a></p></td><td class="tblDescr"><p>The Presence element provides presence information for an online account of a contact.</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qml-relationship.html">QML Relationship Element</a></p></td><td class="tblDescr"><p>The Relationship element describes a one-to-one relationship between a locally-stored contact and another (possibly remote) contact.</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qml-relationshipfilter.html">QML RelationshipFilter Element</a></p></td><td class="tblDescr"><p>The RelationshipFilter element provides a filter based around relationship criteria.</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qml-relationshipmodel.html">QML RelationshipModel Element</a></p></td><td class="tblDescr"><p>The RelationshipModel provides a model of contact relationships from the contacts store.</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qml-ringtone.html">QML Ringtone Element</a></p></td><td class="tblDescr"><p>The Ringtone element provides a ringtone associated with a contact.</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qml-sortorder.html">QML SortOrder Element</a></p></td><td class="tblDescr"><p>The SortOrder element defines how a list of contacts should be ordered according to some criteria.</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qml-synctarget.html">QML SyncTarget Element</a></p></td><td class="tblDescr"><p>The SyncTarget element provides a sync target for a contact.</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qml-tag.html">QML Tag Element</a></p></td><td class="tblDescr"><p>The Tag element provides a contains a tag associated with a contact.</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qml-timestamp.html">QML Timestamp Element</a></p></td><td class="tblDescr"><p>The Timestamp element contains the creation and last-modified timestamp associated with the contact.</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qml-unionfilter.html">QML UnionFilter Element</a></p></td><td class="tblDescr"><p>The UnionFilter element provides a filter which unions the results of other filters.</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qml-url.html">QML Url Element</a></p></td><td class="tblDescr"><p>The Url element contains a url associated with a contact.</p></td></tr>
</table>
</div>
<!-- @@@qml-contacts.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>