Sophie

Sophie

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

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" />
<!-- qdeclarativendefrecord.cpp -->
  <title>Qt Mobility 1.2: QDeclarativeNdefRecord Class Reference</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="modules.html">Modules</a></li>
<li><a href="qtconnectivity.html">QtConnectivity</a></li>
<li>QDeclarativeNdefRecord</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="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#macros">Macros</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QDeclarativeNdefRecord Class Reference</h1>
<!-- $$$QDeclarativeNdefRecord-brief -->
<p>The QDeclarativeNdefRecord class implements the <a href="qml-ndefrecord.html">NdefRecord</a> element in QML. <a href="#details">More...</a></p>
<!-- @@@QDeclarativeNdefRecord -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QDeclarativeNdefRecord&gt;</span></pre><p><b>Inherits: </b><a href="http://qt.nokia.com/doc/4.7/qobject.html">QObject</a>.</p>
<ul>
<li><a href="qdeclarativendefrecord-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="properties"></a>
<h2>Properties</h2>
<ul>
<li class="fn"><b><a href="qdeclarativendefrecord.html#recordType-prop">recordType</a></b> : QString</li>
</ul>
<ul>
<li class="fn">1 property inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativendefrecord.html#QDeclarativeNdefRecord">QDeclarativeNdefRecord</a></b> ( QObject * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativendefrecord.html#QDeclarativeNdefRecord-2">QDeclarativeNdefRecord</a></b> ( const QNdefRecord &amp; <i>record</i>, QObject * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QNdefRecord </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativendefrecord.html#record">record</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativendefrecord.html#recordType-prop">recordType</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativendefrecord.html#setRecord">setRecord</a></b> ( const QNdefRecord &amp; <i>record</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativendefrecord.html#recordType-prop">setRecordType</a></b> ( const QString &amp; <i>type</i> )</td></tr>
</table>
<ul>
<li class="fn">29 public functions inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#public-functions">QObject</a></li>
</ul>
<a name="signals"></a>
<h2>Signals</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativendefrecord.html#recordTypeChanged">recordTypeChanged</a></b> ()</td></tr>
</table>
<ul>
<li class="fn">1 signal inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#signals">QObject</a></li>
</ul>
<a name="macros"></a>
<h2>Macros</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativendefrecord.html#Q_DECLARE_NDEFRECORD">Q_DECLARE_NDEFRECORD</a></b> (  <i>className</i>,  <i>typeNameFormat</i>,  <i>type</i> )</td></tr>
</table>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 public slot inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#public-slots">QObject</a></li>
<li class="fn">1 public variable inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#public-variables">QObject</a></li>
<li class="fn">4 static public members inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#static-public-members">QObject</a></li>
<li class="fn">7 protected functions inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#protected-functions">QObject</a></li>
<li class="fn">2 protected variables inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#protected-variables">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QDeclarativeNdefRecord-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QDeclarativeNdefRecord class implements the <a href="qml-ndefrecord.html">NdefRecord</a> element in QML.</p>
<p>The QDeclarativeNdefRecord class is the base class for all <a href="qml-ndefrecord.html">NdefRecord</a> elements in QML. To support a new NDEF record type in QML subclass this class and expose new properties, member functions and signals appropriate for the new record type. The following must be done to create a new NDEF record type in QML:</p>
<ul>
<li>The subclass must have a <a href="http://qt.nokia.com/doc/4.7/qobject.html#Q_OBJECT">Q_OBJECT</a> macro in its declaration.</li>
<li>The subclass must have an <a href="http://qt.nokia.com/doc/4.7/qobject.html#Q_INVOKABLE">invokable</a> constructor that takes a <a href="qndefrecord.html">QNdefRecord</a> and a <a href="http://qt.nokia.com/doc/4.7/qobject.html">QObject</a> pointer.</li>
<li>The subclass must be declared as an NDEF record by expanding the <a href="qdeclarativendefrecord.html#Q_DECLARE_NDEFRECORD">Q_DECLARE_NDEFRECORD</a>() macro in the implementation file of the subclass.</li>
<li>The subclass must be registered with QML.</li>
</ul>
<p>For example the declaration of such a class may look like the following.</p>
<pre class="cpp"> <span class="keyword">class</span> <span class="type">QDeclarativeNdefFooRecord</span> : <span class="keyword">public</span> <span class="type">QDeclarativeNdefRecord</span>
 {
     Q_OBJECT

     Q_PROPERTY(<span class="type">int</span> foo READ foo WRITE setFoo NOTIFY fooChanged)

 <span class="keyword">public</span>:
     <span class="keyword">explicit</span> <span class="type">QDeclarativeNdefFooRecord</span>(<span class="type"><a href="http://qt.nokia.com/doc/4.7/qobject.html">QObject</a></span> <span class="operator">*</span>parent <span class="operator">=</span> <span class="number">0</span>);
     Q_INVOKABLE <span class="type">QDeclarativeNdefFooRecord</span>(<span class="keyword">const</span> <span class="type"><a href="qndefrecord.html">QNdefRecord</a></span> <span class="operator">&amp;</span>record<span class="operator">,</span> <span class="type"><a href="http://qt.nokia.com/doc/4.7/qobject.html">QObject</a></span> <span class="operator">*</span>parent <span class="operator">=</span> <span class="number">0</span>);
     <span class="operator">~</span><span class="type">QDeclarativeNdefFooRecord</span>();

     <span class="type">int</span> foo() <span class="keyword">const</span>;
     <span class="type">void</span> setFoo(<span class="type">int</span> value);

 <span class="keyword">signals</span>:
     <span class="type">void</span> fooChanged();
 };</pre>
<p>Within the implementation file the <a href="qdeclarativendefrecord.html#Q_DECLARE_NDEFRECORD">Q_DECLARE_NDEFRECORD</a>() macro is expanded:</p>
<pre class="cpp"> <a href="qdeclarativendefrecord.html#Q_DECLARE_NDEFRECORD">Q_DECLARE_NDEFRECORD</a>(<span class="type">QDeclarativeNdefFooRecord</span><span class="operator">,</span> <span class="type"><a href="qndefrecord.html">QNdefRecord</a></span><span class="operator">::</span>ExternalRtd<span class="operator">,</span> <span class="string">&quot;com.example:f&quot;</span>)</pre>
<p>Finially the application or plugin code calls <a href="http://qt.nokia.com/doc/4.7/qdeclarativeengine.html#qmlRegisterType">qmlRegisterType</a>():</p>
<pre class="cpp"> qmlRegisterType<span class="operator">&lt;</span><span class="type">QDeclarativeNdefFooRecord</span><span class="operator">&gt;</span>(uri<span class="operator">,</span> <span class="number">1</span><span class="operator">,</span> <span class="number">0</span><span class="operator">,</span> <span class="string">&quot;NdefFooRecord&quot;</span>);</pre>
</div>
<p><b>See also </b><a href="qml-ndefrecord.html">NdefRecord</a>.</p>
<!-- @@@QDeclarativeNdefRecord -->
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$recordType-prop$$$recordType$$$setRecordTypeconstQString&$$$recordTypeChanged -->
<h3 class="fn"><a name="recordType-prop"></a><span class="name">recordType</span> : <span class="type"><a href="http://qt.nokia.com/doc/4.7/qstring.html">QString</a></span></h3>
<p>This property hold the record type of the NDEF record that this class represents.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>recordType</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setRecordType</b></span> ( const QString &amp; <i>type</i> )</td></tr>
</table>
<p><b>Notifier signal:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qdeclarativendefrecord.html#recordTypeChanged">recordTypeChanged</a></b></span> ()</td></tr>
</table>
<!-- @@@recordType -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QDeclarativeNdefRecord[overload1]$$$QDeclarativeNdefRecordQObject* -->
<h3 class="fn"><a name="QDeclarativeNdefRecord"></a>QDeclarativeNdefRecord::<span class="name">QDeclarativeNdefRecord</span> ( <span class="type"><a href="http://qt.nokia.com/doc/4.7/qobject.html">QObject</a></span> * <i>parent</i> = 0 )</h3>
<p>Constructs a new empty <a href="qdeclarativendefrecord.html">QDeclarativeNdefRecord</a> with <i>parent</i>.</p>
<!-- @@@QDeclarativeNdefRecord -->
<!-- $$$QDeclarativeNdefRecord$$$QDeclarativeNdefRecordconstQNdefRecord&QObject* -->
<h3 class="fn"><a name="QDeclarativeNdefRecord-2"></a>QDeclarativeNdefRecord::<span class="name">QDeclarativeNdefRecord</span> ( const <span class="type"><a href="qndefrecord.html">QNdefRecord</a></span> &amp; <i>record</i>, <span class="type"><a href="http://qt.nokia.com/doc/4.7/qobject.html">QObject</a></span> * <i>parent</i> = 0 )</h3>
<p>Constructs a new <a href="qdeclarativendefrecord.html">QDeclarativeNdefRecord</a> representing <i>record</i>. The parent of the newly constructed object will be set to <i>parent</i>.</p>
<!-- @@@QDeclarativeNdefRecord -->
<!-- $$$record[overload1]$$$record -->
<h3 class="fn"><a name="record"></a><span class="type"><a href="qndefrecord.html">QNdefRecord</a></span> QDeclarativeNdefRecord::<span class="name">record</span> () const</h3>
<p>Returns a copy of the record.</p>
<p><b>See also </b><a href="qdeclarativendefrecord.html#setRecord">setRecord</a>().</p>
<!-- @@@record -->
<!-- $$$recordTypeChanged[overload1]$$$recordTypeChanged -->
<h3 class="fn"><a name="recordTypeChanged"></a><span class="type">void</span> QDeclarativeNdefRecord::<span class="name">recordTypeChanged</span> ()<tt> [signal]</tt></h3>
<p>This signal is emitted when the record type changes.</p>
<!-- @@@recordTypeChanged -->
<!-- $$$setRecord[overload1]$$$setRecordconstQNdefRecord& -->
<h3 class="fn"><a name="setRecord"></a><span class="type">void</span> QDeclarativeNdefRecord::<span class="name">setRecord</span> ( const <span class="type"><a href="qndefrecord.html">QNdefRecord</a></span> &amp; <i>record</i> )</h3>
<p>Sets the record to <i>record</i>.</p>
<p><b>See also </b><a href="qdeclarativendefrecord.html#record">record</a>().</p>
<!-- @@@setRecord -->
</div>
<div class="macros">
<h2>Macro Documentation</h2>
<!-- $$$Q_DECLARE_NDEFRECORD[overload1]$$$Q_DECLARE_NDEFRECORD -->
<h3 class="fn"><a name="Q_DECLARE_NDEFRECORD"></a><span class="name">Q_DECLARE_NDEFRECORD</span> (  <i>className</i>,  <i>typeNameFormat</i>,  <i>type</i> )</h3>
<p>This macro ensures that <i>className</i> is declared as the class implementing the NDEF record identified by <i>typeNameFormat</i> and <i>type</i>.</p>
<p>This macro should be expanded in the implementation file for <i>className</i>.</p>
<!-- @@@Q_DECLARE_NDEFRECORD -->
</div>
  <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>