/usr/share/qt5/doc/qtversit/versit.html is in qtpim5-doc-html 5.0~git20140515~29475884-0ubuntu24~7.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- versit.qdoc -->
<title>Qt Versit Overview | Qt 5.0</title>
<link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
<script type="text/javascript">
document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
// loading style sheet breaks anchors that were jumped to before
// so force jumping to anchor again
setTimeout(function() {
var anchor = location.hash;
// need to jump to different anchor first (e.g. none)
location.hash = "#";
setTimeout(function() {
location.hash = anchor;
}, 0);
}, 0);
</script>
</head>
<body>
<div class="header" id="qtdocheader">
<div class="main">
<div class="main-rounded">
<div class="navigationbar">
<table><tr>
<td >Qt 5.0</td><td >Qt Versit Overview</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.0.0 Reference Documentation</td>
</tr></table>
</div>
</div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#overview">Overview</a></li>
<li class="level1"><a href="#importing-and-exporting-data">Importing and Exporting Data</a></li>
<li class="level1"><a href="#classes">Classes</a></li>
<li class="level1"><a href="#supported-features">Supported Features</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">Qt Versit Overview</h1>
<span class="subtitle"></span>
<!-- $$$versit.html-description -->
<div class="descr"> <a name="details"></a>
<a name="overview"></a>
<h2 id="overview">Overview</h2>
<p>The Versit API is part of a collection of Personal Information Management API's providing a library to convert QContacts to and from <a href="http://en.wikipedia.org/wiki/Vcard">vCard</a> files, and to convert QOrganizerItems to and from <a href="http://en.wikipedia.org/wiki/ICalendar">iCalendar</a> files.</p>
<p>Because vCard and iCalendar share the same structure, they are represented in abstract form with a common class, namely <a href="qversitdocument.html">QVersitDocument</a>. vCard and iCalendar files can be parsed into <a href="qversitdocument.html">QVersitDocument</a> form using <a href="qversitreader.html">QVersitReader</a>. <a href="qversitdocument.html">QVersitDocument</a> objects can be written to an I/O device using <a href="qversitwriter.html">QVersitWriter</a>.</p>
<p>A <a href="qversitdocument.html">QVersitDocument</a> object can represent either a vCard or an iCalendar. <a href="qversitdocument.html">QVersitDocuments</a> representing vCards can be converted to QContacts using <a href="qversitcontactimporter.html">QVersitContactImporter</a>. <a href="qversitdocument.html">QVersitDocuments</a> representing iCalendars can be converted to QOrganizerItems using <a href="qversitorganizerimporter.html">QVersitOrganizerImporter</a>. QContacts and QOrganizerItems can be converted to <a href="qversitdocument.html">QVersitDocuments</a> using <a href="qversitcontactexporter.html">QVersitContactExporter</a> and <a href="qversitorganizerexporter.html">QVersitOrganizerExporter</a>, respectively.</p>
<p>Currently <a href="qversitreader.html">QVersitReader</a> and <a href="qversitwriter.html">QVersitWriter</a> support reading and writing vCard 2.1, vCard 3.0 and iCalendar 2.0 format documents. Please note that the Organizer API is still under development, so the Qt Versit API classes related to importing and exporting organizer items is subject to change.</p>
<p>Versit <sup>®</sup> is a trademark of the Internet Mail Consortium.</p>
<p>For full list of classes, see Qt Versit C++ API.</p>
<a name="importing-and-exporting-data"></a>
<h2 id="importing-and-exporting-data">Importing and Exporting Data</h2>
<p>The following example goes through the process of reading a vCard and importing it to QContact format, then exporting and writing it back out.</p>
<p>First, let's create some data to read. In this case, we create a QBuffer as a demonstration, but any QIODevice will work.</p>
<pre class="cpp">
<span class="type">QBuffer</span> input;
input<span class="operator">.</span>open(<span class="type">QBuffer</span><span class="operator">::</span>ReadWrite);
<span class="type">QByteArray</span> inputVCard <span class="operator">=</span>
<span class="string">"BEGIN:VCARD\r\nVERSION:2.1\r\nFN:John Citizen\r\nN:Citizen;John;Q;;\r\nEND:VCARD\r\n"</span>;
input<span class="operator">.</span>write(inputVCard);
input<span class="operator">.</span>seek(<span class="number">0</span>);
</pre>
<p><a href="qversitreader.html">QVersitReader</a> can be used to parse a vCard or iCalendar from an I/O device to produce a list of QVersitDocuments.</p>
<pre class="cpp">
<span class="comment">// Note: we could also use the more convenient QVersitReader(QByteArray) constructor.</span>
<span class="type"><a href="qversitreader.html">QVersitReader</a></span> reader;
reader<span class="operator">.</span>setDevice(<span class="operator">&</span>input);
reader<span class="operator">.</span>startReading(); <span class="comment">// Remember to check the return value</span>
reader<span class="operator">.</span>waitForFinished();
<span class="type">QList</span><span class="operator"><</span><span class="type"><a href="qversitdocument.html">QVersitDocument</a></span><span class="operator">></span> inputDocuments <span class="operator">=</span> reader<span class="operator">.</span>results();
</pre>
<p>QVersitDocuments aren't very useful to the QtContacts API. They need to be imported using the <a href="qversitcontactimporter.html">QVersitContactImporter</a>. If the QVersitDocuments were iCalendar objects, they could be imported using <a href="qversitorganizerimporter.html">QVersitOrganizerImporter</a>.</p>
<pre class="cpp">
<span class="type"><a href="qversitcontactimporter.html">QVersitContactImporter</a></span> importer;
<span class="keyword">if</span> (<span class="operator">!</span>importer<span class="operator">.</span>importDocuments(inputDocuments))
<span class="keyword">return</span>;
<span class="type">QList</span><span class="operator"><</span><span class="type">QContact</span><span class="operator">></span> contacts <span class="operator">=</span> importer<span class="operator">.</span>contacts();
<span class="comment">// Note that the QContacts are not saved yet.</span>
<span class="comment">// Use QContactManager::saveContacts() for saving if necessary</span>
</pre>
<p>Conversely, <a href="qversitcontactexporter.html">QVersitContactExporter</a> can be used to convert from QContacts to QVersitDocuments. (<a href="qversitorganizerexporter.html">QVersitOrganizerExporter</a> can be used for QOrganizerItem):</p>
<pre class="cpp">
<span class="type"><a href="qversitcontactexporter.html">QVersitContactExporter</a></span> exporter;
<span class="keyword">if</span> (<span class="operator">!</span>exporter<span class="operator">.</span>exportContacts(contacts<span class="operator">,</span> <span class="type"><a href="qversitdocument.html">QVersitDocument</a></span><span class="operator">::</span>VCard30Type))
<span class="keyword">return</span>;
<span class="type">QList</span><span class="operator"><</span><span class="type"><a href="qversitdocument.html">QVersitDocument</a></span><span class="operator">></span> outputDocuments <span class="operator">=</span> exporter<span class="operator">.</span>documents();
</pre>
<p>To complete the exporting process, <a href="qversitwriter.html">QVersitWriter</a> can be used to write to an I/O device.</p>
<pre class="cpp">
<span class="comment">// Note: we could also use the more convenient QVersitWriter(QByteArray*) constructor.</span>
<span class="type">QBuffer</span> output;
output<span class="operator">.</span>open(<span class="type">QBuffer</span><span class="operator">::</span>ReadWrite);
<span class="type"><a href="qversitwriter.html">QVersitWriter</a></span> writer;
writer<span class="operator">.</span>setDevice(<span class="operator">&</span>output);
writer<span class="operator">.</span>startWriting(outputDocuments); <span class="comment">// Remember to check the return value</span>
writer<span class="operator">.</span>waitForFinished();
<span class="comment">// output.buffer() now contains a vCard</span>
</pre>
<a name="classes"></a>
<h2 id="classes">Classes</h2>
<p>The main classes for a client interested in importing or exporting vCard and iCalendar documents are:</p>
<ul>
<li><a href="qversitproperty.html">QVersitProperty</a></li>
<li><a href="qversitdocument.html">QVersitDocument</a></li>
<li><a href="qversitreader.html">QVersitReader</a></li>
<li><a href="qversitwriter.html">QVersitWriter</a></li>
<li><a href="qversitcontactimporter.html">QVersitContactImporter</a></li>
<li><a href="qversitcontactexporter.html">QVersitContactExporter</a></li>
<li><a href="qversitorganizerimporter.html">QVersitOrganizerImporter</a></li>
<li><a href="qversitorganizerexporter.html">QVersitOrganizerExporter</a></li>
</ul>
<p>It is also possible to extend the behaviour of the importer and exporter classes by writing handlers and plugins. For more details, see <a href="versitplugins.html">Qt Versit Plugins</a>. <div class="table"><table class="annotated">
<tr class="odd topAlign"><td class="tblName"><p><a href="qversitcontactexporterdetailhandlerv2.html">QVersitContactExporterDetailHandlerV2</a></p></td><td class="tblDescr"><p>Interface for specifying custom export behaviour for certain contact details</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qversitcontacthandler.html">QVersitContactHandler</a></p></td><td class="tblDescr"><p>Union of the QVersitContactImporterPropertyHandlerV2 and QVersitContactExporterDetailHandlerV2 interfaces</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qversitcontactimporterpropertyhandlerv2.html">QVersitContactImporterPropertyHandlerV2</a></p></td><td class="tblDescr"><p>Interface for specifying custom import behaviour for vCard properties</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qversitdefaultresourcehandler.html">QVersitDefaultResourceHandler</a></p></td><td class="tblDescr"><p>Default implementation of a Versit resource handler</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qversitresourcehandler.html">QVersitResourceHandler</a></p></td><td class="tblDescr"><p>Interface for clients wishing to implement custom behaviour for loading and saving files to disk when exporting and importing</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qversitorganizerexporterdetailhandler.html">QVersitOrganizerExporterDetailHandler</a></p></td><td class="tblDescr"><p>Interface for specifying custom export behaviour for certain organizer item details</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qversitorganizerhandler.html">QVersitOrganizerHandler</a></p></td><td class="tblDescr"><p>Union of the QVersitOrganizerImporterPropertyHandlerV2 and QVersitOrganizerExporterDetailHandlerV2 interfaces</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qversitorganizerhandlerfactory.html">QVersitOrganizerHandlerFactory</a></p></td><td class="tblDescr"><p>The interface for Versit plugins</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qversitorganizerimporterpropertyhandler.html">QVersitOrganizerImporterPropertyHandler</a></p></td><td class="tblDescr"><p>Interface for specifying custom import behaviour for vCard properties</p></td></tr>
</table></div>
</p>
<a name="supported-features"></a>
<h2 id="supported-features">Supported Features</h2>
<p>Please see the following documents for supported Versit Module features:</p>
<ul>
<li><a href="vcardsupport.html#vcardsupport">Supported vCard Features</a> document for a list of vCard features that the Versit module supports.</li>
<li>Supported iCalendar Features document for a list of iCal features that the Organizer Versit module supports.</li>
</ul>
</div>
<!-- @@@versit.html -->
</div>
</div>
</div>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2017 The Qt Company Ltd.
Documentation contributions included herein are the copyrights of
their respective owners.<br> The documentation provided herein is licensed 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.<br> Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. </p>
</div>
</body>
</html>
|