This file is indexed.

/usr/share/doc/buteo-syncfw-doc/api-usage.html is in libbuteosyncfw5-doc 0.7.21+16.04.20151216.1-0ubuntu1.

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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>ButeoSynchronizationFramework: Buteo framework API usage</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">ButeoSynchronizationFramework
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Buteo framework API usage </div>  </div>
</div><!--header-->
<div class="contents">
<div class="toc"><h3>Table of Contents</h3>
<ul><li class="level1"><a href="#buteo-apis">Available Buteo APIs</a></li>
<li class="level1"><a href="#plugin-api">Plugin API</a></li>
<li class="level1"><a href="#dbus-api">Dbus API</a></li>
<li class="level1"><a href="#libbuteosyncfw-api">libbuteosyncfw API</a><ul><li class="level2"><a href="#logging">Using Logging API</a></li>
<li class="level2"><a href="#profile-api">Profile Management API</a><ul><li class="level3"><a href="#update-profile">Update a given profile</a></li>
<li class="level3"><a href="#sync-schedule">Handle sync schedule</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="textblock"><h1><a class="anchor" id="buteo-apis"></a>
Available Buteo APIs</h1>
<ul>
<li>Plugin API</li>
<li>msycnd Dbus API</li>
<li>libbuteosyncfw API</li>
</ul>
<h1><a class="anchor" id="plugin-api"></a>
Plugin API</h1>
<p>Refer to <a class="el" href="plugin-guide.html">Writing plugins for Synchronization Framework</a></p>
<h1><a class="anchor" id="dbus-api"></a>
Dbus API</h1>
<p>The dbus API can be used by application to get the live data from msyncd. Both signals as well as methods are provided. msyncd listens on the bus <b>com.meego.msyncd</b> and at the path <b>/synchronizer</b>. A dbus method can be invoked from cmdline as </p><div class="fragment"><div class="line">dbus-send --session --type=method_call --print-reply --dest=<a class="code" href="namespacecom.html">com</a>.<a class="code" href="namespacecom_1_1meego.html">meego</a>.msyncd /synchronizer <a class="code" href="namespacecom.html">com</a>.<a class="code" href="namespacecom_1_1meego.html">meego</a>.msyncd.startSync <span class="keywordtype">string</span>:<span class="stringliteral">&#39;abc.com&#39;</span></div>
</div><!-- fragment --><p>Following are the signals available in msyncd</p>
<ul>
<li>Signal to give status of an ongoing sync session <div class="fragment"><div class="line">&lt;signal name=<span class="stringliteral">&quot;syncStatus&quot;</span>&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aProfileName&quot;</span> type=<span class="stringliteral">&quot;s&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aStatus&quot;</span> type=<span class="stringliteral">&quot;i&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aMessage&quot;</span> type=<span class="stringliteral">&quot;s&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aMoreDetails&quot;</span> type=<span class="stringliteral">&quot;i&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">&lt;/signal&gt;</div>
</div><!-- fragment --></li>
<li>Signal to indicate the transfer progress (of the number of items transfered and the kind of items) <div class="fragment"><div class="line">&lt;signal name=<span class="stringliteral">&quot;transferProgress&quot;</span>&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aProfileName&quot;</span> type=<span class="stringliteral">&quot;s&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aTransferDatabase&quot;</span> type=<span class="stringliteral">&quot;i&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aTransferType&quot;</span> type=<span class="stringliteral">&quot;i&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aMimeType&quot;</span> type=<span class="stringliteral">&quot;s&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aCommittedItems&quot;</span> type=<span class="stringliteral">&quot;i&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">&lt;/signal&gt;</div>
</div><!-- fragment --></li>
<li>Signal to indicate if a profile has changed <div class="fragment"><div class="line">&lt;signal name=<span class="stringliteral">&quot;signalProfileChanged&quot;</span>&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aProfileName&quot;</span> type=<span class="stringliteral">&quot;s&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aChangeType&quot;</span> type=<span class="stringliteral">&quot;i&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aProfileAsXml&quot;</span> type=<span class="stringliteral">&quot;s&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">&lt;/signal&gt;</div>
</div><!-- fragment --></li>
<li>Signal to indicate a backup operation in progress. If a backup service is ongoing then msyncd does not start sync until the backup is complete. This signal can be use to keep track of an ongoing backup operation <div class="fragment"><div class="line">&lt;signal name=<span class="stringliteral">&quot;backupInProgress&quot;</span>&gt;</div>
<div class="line">&lt;/signal&gt;</div>
</div><!-- fragment --> -Signal to indicate that a backup operation is done <div class="fragment"><div class="line">&lt;signal name=<span class="stringliteral">&quot;backupDone&quot;</span>&gt;</div>
<div class="line">&lt;/signal&gt;</div>
</div><!-- fragment --></li>
<li>Signal to indicate that restore operation is in progress <div class="fragment"><div class="line">&lt;signal name=<span class="stringliteral">&quot;restoreInProgress&quot;</span>&gt;</div>
<div class="line">&lt;/signal&gt;</div>
</div><!-- fragment --></li>
<li>Signal to indicate that the restoration process is completed <div class="fragment"><div class="line">&lt;signal name=<span class="stringliteral">&quot;restoreDone&quot;</span>&gt;</div>
<div class="line">&lt;/signal&gt;</div>
</div><!-- fragment --></li>
<li>Signal to indicate that the results of the just finished sync operation are available <div class="fragment"><div class="line">&lt;signal name=<span class="stringliteral">&quot;resultsAvailable&quot;</span>&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aProfileName&quot;</span> type=<span class="stringliteral">&quot;s&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aResultsAsXml&quot;</span> type=<span class="stringliteral">&quot;s&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">&lt;/signal&gt;</div>
</div><!-- fragment --></li>
<li>Signal to indicate that the status of the sync operation has changed. The status could be that the state has changed from in progress to failed with also the failed reason <div class="fragment"><div class="line">&lt;signal name=<span class="stringliteral">&quot;statusChanged&quot;</span>&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aAccountId&quot;</span> type=<span class="stringliteral">&quot;u&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aNewStatus&quot;</span> type=<span class="stringliteral">&quot;i&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aFailedReason&quot;</span> type=<span class="stringliteral">&quot;i&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aPrevSyncTime&quot;</span> type=<span class="stringliteral">&quot;x&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aNextSyncTime&quot;</span> type=<span class="stringliteral">&quot;x&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">&lt;/signal&gt;</div>
</div><!-- fragment --></li>
</ul>
<p>Following are the dbus methods of msyncd</p><ul>
<li>Method to start sync given a profile name. The profile name is the name of the Sync profile XML file. The startSync operation is valid only for client plugins <div class="fragment"><div class="line">&lt;method name=<span class="stringliteral">&quot;startSync&quot;</span>&gt;</div>
<div class="line">  &lt;arg type=<span class="stringliteral">&quot;b&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aProfileId&quot;</span> type=<span class="stringliteral">&quot;s&quot;</span> direction=<span class="stringliteral">&quot;in&quot;</span>/&gt;</div>
<div class="line">&lt;/method&gt;</div>
</div><!-- fragment --></li>
<li>Method to cancel an ongoing sync. The profile id has to be specific to cancel an ongoing sync operation <div class="fragment"><div class="line">&lt;method name=<span class="stringliteral">&quot;abortSync&quot;</span>&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aProfileId&quot;</span> type=<span class="stringliteral">&quot;s&quot;</span> direction=<span class="stringliteral">&quot;in&quot;</span>/&gt;</div>
<div class="line">  &lt;annotation name=<span class="stringliteral">&quot;org.freedesktop.DBus.Method.NoReply&quot;</span> value=<span class="stringliteral">&quot;true&quot;</span>/&gt;</div>
<div class="line">&lt;/method&gt;</div>
</div><!-- fragment --></li>
<li>Method to remove a profile. A profile can be removed if it is not longer required, like for example, removing a sync account <div class="fragment"><div class="line">&lt;method name=<span class="stringliteral">&quot;removeProfile&quot;</span>&gt;</div>
<div class="line">  &lt;arg type=<span class="stringliteral">&quot;b&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aProfileId&quot;</span> type=<span class="stringliteral">&quot;s&quot;</span> direction=<span class="stringliteral">&quot;in&quot;</span>/&gt;</div>
<div class="line">&lt;/method&gt;</div>
</div><!-- fragment --></li>
<li>Method to update a given sync profile. The profile to be updated should be in the form of an XML and the XML object should be sent so that it can be updated. If the updation fails, then false is returned, else true <div class="fragment"><div class="line">&lt;method name=<span class="stringliteral">&quot;updateProfile&quot;</span>&gt;</div>
<div class="line">  &lt;arg type=<span class="stringliteral">&quot;b&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aProfileAsXml&quot;</span> type=<span class="stringliteral">&quot;s&quot;</span> direction=<span class="stringliteral">&quot;in&quot;</span>/&gt;</div>
<div class="line">&lt;/method&gt;</div>
</div><!-- fragment --></li>
<li>Method to request storages to be loaded. This is useful if a plugin makes use of existing storage plugins (contacts, calendar, notes) to perform the sync operation. If a plugin has its own way to manage the interaction with plugins, then this method need to be used <div class="fragment"><div class="line">&lt;method name=<span class="stringliteral">&quot;requestStorages&quot;</span>&gt;</div>
<div class="line">  &lt;arg type=<span class="stringliteral">&quot;b&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aStorageNames&quot;</span> type=<span class="stringliteral">&quot;as&quot;</span> direction=<span class="stringliteral">&quot;in&quot;</span>/&gt;</div>
<div class="line">&lt;/method&gt;</div>
</div><!-- fragment --></li>
<li>Method to release a storage that has already been requested using "requestStorage" method <div class="fragment"><div class="line">&lt;method name=<span class="stringliteral">&quot;releaseStorages&quot;</span>&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aStorageNames&quot;</span> type=<span class="stringliteral">&quot;as&quot;</span> direction=<span class="stringliteral">&quot;in&quot;</span>/&gt;</div>
<div class="line">  &lt;annotation name=<span class="stringliteral">&quot;org.freedesktop.DBus.Method.NoReply&quot;</span> value=<span class="stringliteral">&quot;true&quot;</span>/&gt;</div>
<div class="line">&lt;/method&gt;</div>
</div><!-- fragment --></li>
<li>Method to check if connectivity for a specific type is avialable. Currently supported type: USB=0, Bluetooth=1 and Network=2 <div class="fragment"><div class="line">&lt;method name=<span class="stringliteral">&quot;isConnectivityAvailable&quot;</span>&gt;</div>
<div class="line">  &lt;arg type=<span class="stringliteral">&quot;b&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;connectivityType&quot;</span> type=<span class="stringliteral">&quot;i&quot;</span> direction=<span class="stringliteral">&quot;in&quot;</span>/&gt;</div>
<div class="line">&lt;/method&gt;</div>
</div><!-- fragment --></li>
<li>Method to get a list of all running sync sessions <div class="fragment"><div class="line">&lt;method name=<span class="stringliteral">&quot;runningSyncs&quot;</span>&gt;</div>
<div class="line">  &lt;arg type=<span class="stringliteral">&quot;as&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">&lt;/method&gt;</div>
</div><!-- fragment --></li>
<li>Method to get the current state of backup/restore. True=backup/restore ongoing, false otherwise <div class="fragment"><div class="line">&lt;method name=<span class="stringliteral">&quot;getBackUpRestoreState&quot;</span>&gt;</div>
<div class="line">  &lt;arg type=<span class="stringliteral">&quot;b&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">&lt;/method&gt;</div>
</div><!-- fragment --></li>
<li>Method to set the sync schedule <div class="fragment"><div class="line">&lt;method name=<span class="stringliteral">&quot;setSyncSchedule&quot;</span>&gt;</div>
<div class="line">  &lt;arg type=<span class="stringliteral">&quot;b&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aProfileId&quot;</span> type=<span class="stringliteral">&quot;s&quot;</span> direction=<span class="stringliteral">&quot;in&quot;</span>/&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aScheduleAsXml&quot;</span> type=<span class="stringliteral">&quot;s&quot;</span> direction=<span class="stringliteral">&quot;in&quot;</span>/&gt;</div>
<div class="line">&lt;/method&gt;</div>
</div><!-- fragment --> The format of the sync schedule is: <div class="fragment"><div class="line"><span class="stringliteral">&quot;&lt;schedule time=&quot;</span>12:34:56<span class="stringliteral">&quot; interval=&quot;</span>30<span class="stringliteral">&quot; days=&quot;</span>1,2,3,4,5,6<span class="stringliteral">&quot;&gt;&quot;</span></div>
<div class="line">    <span class="stringliteral">&quot;&lt;rush enabled=&quot;</span><span class="keyword">true</span><span class="stringliteral">&quot; interval=&quot;</span>15<span class="stringliteral">&quot;&quot;</span></div>
<div class="line">        <span class="stringliteral">&quot;begin=&quot;</span>08:00:00<span class="stringliteral">&quot; end=&quot;</span>16:00:00<span class="stringliteral">&quot; days=&quot;</span>1,4,5<span class="stringliteral">&quot;/&gt;&quot;</span></div>
<div class="line"><span class="stringliteral">&quot;&lt;/schedule&gt;&quot;</span></div>
</div><!-- fragment --></li>
</ul>
<p><em><b>time</b> </em>is the time starting which the sync schedule has to be enabled <br />
<em><b>interval</b> </em>is in minutes is the frequency of sync <br />
<em><b>days</b> </em>is the days on which the sync has to run <br />
<em><b>rush</b> </em>is the sync setting for peak hours of the day. The idea is to run sync at a higher frequency in rush days than in the normal days. The rush begin time and end time and the rush days can be specified <br />
</p><ul>
<li>Method to save the sync results. This method can be used to persist the sync results given a profile id /code &lt;method name="saveSyncResults"&gt; &lt;arg type="b" direction="out"&gt; &lt;arg name="aProfileId" type="s" direction="in"&gt; &lt;arg name="aSyncResults" type="s" direction="in"&gt; &lt;/method&gt; /endcode</li>
<li>Method to get the sync results of the last finished sync session. The sync results are returned as an XML string, which then has to be parsed to retrieve the results. One can use the SyncResults class of libbuteosycnfw to handle any of the XML data received <div class="fragment"><div class="line">&lt;method name=<span class="stringliteral">&quot;getLastSyncResult&quot;</span>&gt;</div>
<div class="line">  &lt;arg type=<span class="stringliteral">&quot;s&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aProfileId&quot;</span> type=<span class="stringliteral">&quot;s&quot;</span> direction=<span class="stringliteral">&quot;in&quot;</span>/&gt;</div>
<div class="line">&lt;/method&gt;</div>
</div><!-- fragment --></li>
<li>A profile can be made a hidden so as not be be displayed in a UI. This method fetches the profiles that have been marked as visible <div class="fragment"><div class="line">&lt;method name=<span class="stringliteral">&quot;allVisibleSyncProfiles&quot;</span>&gt;</div>
<div class="line">  &lt;arg type=<span class="stringliteral">&quot;as&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">&lt;/method&gt;</div>
</div><!-- fragment --></li>
<li>Method to fetch a sync profile object given a profile id. The profile is returned in XML and the SyncProfile class of libbuteosyncfw can be used to parse the sync profile <div class="fragment"><div class="line">&lt;method name=<span class="stringliteral">&quot;syncProfile&quot;</span>&gt;</div>
<div class="line">  &lt;arg type=<span class="stringliteral">&quot;s&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aProfileId&quot;</span> type=<span class="stringliteral">&quot;s&quot;</span> direction=<span class="stringliteral">&quot;in&quot;</span>/&gt;</div>
<div class="line">&lt;/method&gt;</div>
</div><!-- fragment --></li>
<li>Method to fetch a specific sync profile based on a key. The key can be anything like sync direction, the URL of the target service etc. If there are multiple profiles matching the key, then all of them are returned <div class="fragment"><div class="line">&lt;method name=<span class="stringliteral">&quot;syncProfilesByKey&quot;</span>&gt;</div>
<div class="line">  &lt;arg type=<span class="stringliteral">&quot;as&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aKey&quot;</span> type=<span class="stringliteral">&quot;s&quot;</span> direction=<span class="stringliteral">&quot;in&quot;</span>/&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aValue&quot;</span> type=<span class="stringliteral">&quot;s&quot;</span> direction=<span class="stringliteral">&quot;in&quot;</span>/&gt;</div>
<div class="line">&lt;/method&gt;</div>
</div><!-- fragment --></li>
<li>Method to fetch a sync profile given a type of sync. The type can be client, server, storage <div class="fragment"><div class="line">&lt;method name=<span class="stringliteral">&quot;syncProfilesByType&quot;</span>&gt;</div>
<div class="line">  &lt;arg type=<span class="stringliteral">&quot;as&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aType&quot;</span> type=<span class="stringliteral">&quot;s&quot;</span> direction=<span class="stringliteral">&quot;in&quot;</span>/&gt;</div>
<div class="line">&lt;/method&gt;</div>
</div><!-- fragment --></li>
<li>Method to start a sync session with an account Id. This is useful if Buteo is integrated with AccountS&amp;SSO. The account id is passed to start the sync <div class="fragment"><div class="line">&lt;method name=<span class="stringliteral">&quot;start&quot;</span>&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aAccountId&quot;</span> type=<span class="stringliteral">&quot;u&quot;</span> direction=<span class="stringliteral">&quot;in&quot;</span>/&gt;</div>
<div class="line">  &lt;annotation name=<span class="stringliteral">&quot;org.freedesktop.DBus.Method.NoReply&quot;</span> value=<span class="stringliteral">&quot;true&quot;</span>/&gt;</div>
<div class="line">&lt;/method&gt;</div>
</div><!-- fragment --></li>
<li>Method to stop a sync given an account id <div class="fragment"><div class="line">&lt;method name=<span class="stringliteral">&quot;stop&quot;</span>&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aAccountId&quot;</span> type=<span class="stringliteral">&quot;u&quot;</span> direction=<span class="stringliteral">&quot;in&quot;</span>/&gt;</div>
<div class="line">  &lt;annotation name=<span class="stringliteral">&quot;org.freedesktop.DBus.Method.NoReply&quot;</span> value=<span class="stringliteral">&quot;true&quot;</span>/&gt;</div>
<div class="line">&lt;/method&gt;</div>
</div><!-- fragment --></li>
<li>Method to return the list of account id of all the ongoing sync sessions. This method is useful when Buteo is integrated with Accounts&amp;SSO <div class="fragment"><div class="line">&lt;method name=<span class="stringliteral">&quot;syncingAccounts&quot;</span>&gt;</div>
<div class="line">  &lt;arg type=<span class="stringliteral">&quot;au&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">  &lt;annotation name=<span class="stringliteral">&quot;com.trolltech.QtDBus.QtTypeName.Out0&quot;</span> value=<span class="stringliteral">&quot;QList&amp;lt;uint&amp;gt;&quot;</span>/&gt;</div>
<div class="line">&lt;/method&gt;</div>
</div><!-- fragment --></li>
<li>Method to return the status of a sync given an account id. This method is useful if Buteo is integrated with Accounts&amp;SSO <div class="fragment"><div class="line">&lt;method name=<span class="stringliteral">&quot;status&quot;</span>&gt;</div>
<div class="line">  &lt;arg type=<span class="stringliteral">&quot;i&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aAccountId&quot;</span> type=<span class="stringliteral">&quot;u&quot;</span> direction=<span class="stringliteral">&quot;in&quot;</span>/&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aFailedReason&quot;</span> type=<span class="stringliteral">&quot;i&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aPrevSyncTime&quot;</span> type=<span class="stringliteral">&quot;x&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">  &lt;arg name=<span class="stringliteral">&quot;aNextSyncTime&quot;</span> type=<span class="stringliteral">&quot;x&quot;</span> direction=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line">&lt;/method&gt;</div>
</div><!-- fragment --></li>
</ul>
<h1><a class="anchor" id="libbuteosyncfw-api"></a>
libbuteosyncfw API</h1>
<p>If one needs to use the API of the syncfw, then you can do so by using the library libbuteosyncfw. The main use of this library is to use the plugin API and the profile API. The profile API provides an easy way to manage the sync profiles. Following is the main API available in this library</p><ul>
<li>Logging</li>
<li>Profile management</li>
<li>Plugin management</li>
<li>A dbus library interface for client apps, like GUIs</li>
</ul>
<h2><a class="anchor" id="logging"></a>
Using Logging API</h2>
<p>The logging API has four main calls</p><ol type="1">
<li>FUNCTION_CALL_TRACE can be used to trace the entry and exit of functions</li>
<li>LOG_DEBUG(msg) - outputs a debug level message</li>
<li>LOG_WARNING(msg) - outputs a warning level message</li>
<li>LOG_CRITICAL(msg) - outputs a critical level message</li>
<li>LOG_FATAL(msg) - outputs a fatal level message and aborts the process</li>
</ol>
<p>Logging can be enabled by using "DEFINES += BUTEO_ENABLE_DEBUG" in the .pro file. By default logging is disabled</p>
<h2><a class="anchor" id="profile-api"></a>
Profile Management API</h2>
<p>Profile management API can be used to manage the profile information. For example, it can be used to retrive profiles, create profiles from a template, update profiles and save them back, fetch the results of the last sync, fetch the logs of the sync results etc. The main class that handle profile management are:</p><ul>
<li><a class="el" href="classButeo_1_1ProfileManager.html" title="ProfileManager is responsible for storing and retrieving the profiles. ">Buteo::ProfileManager</a>,</li>
<li><a class="el" href="classButeo_1_1Profile.html" title="This class represents a single profile, a collection of settings or data releated to some entity...">Buteo::Profile</a>,</li>
<li><a class="el" href="classButeo_1_1SyncProfile.html" title="A top level synchronization profile. ">Buteo::SyncProfile</a>,</li>
<li><a class="el" href="classButeo_1_1SyncSchedule.html" title="Class for handling sync schedule settings. ">Buteo::SyncSchedule</a>,</li>
<li><a class="el" href="classButeo_1_1SyncResults.html" title="Contains information about a completed synchronization session. ">Buteo::SyncResults</a>,</li>
<li><a class="el" href="classButeo_1_1StorageProfile.html" title="Storage Profile Class. ">Buteo::StorageProfile</a>,</li>
<li><a class="el" href="classButeo_1_1SyncLog.html" title="History of completed synchronization sessions and their results. ">Buteo::SyncLog</a></li>
</ul>
<h3><a class="anchor" id="update-profile"></a>
Update a given profile</h3>
<p>Following is a code snippet to update a given profile </p><div class="fragment"><div class="line"><span class="keyword">using namespace </span><a class="code" href="namespaceButeo.html">Buteo</a>;</div>
<div class="line">...</div>
<div class="line">...</div>
<div class="line"><a class="code" href="classButeo_1_1ProfileManager.html">ProfileManager</a> pm;</div>
<div class="line"><a class="code" href="classButeo_1_1SyncProfile.html">SyncProfile</a> *sp = pm.<a class="code" href="classButeo_1_1ProfileManager.html#a69831ac859de6c3f6d3bbb53596fcf5c">syncProfile</a>(profileName);</div>
<div class="line"><span class="keywordflow">if</span> (sp) {</div>
<div class="line">    sp-&gt;<a class="code" href="classButeo_1_1SyncProfile.html#aed0e0f1cf65641a0308b55364d9aeb45">setSyncDirection</a>(<a class="code" href="classButeo_1_1SyncProfile.html#a7a33abfbaffe441984d26b25044e5e9ba760a45e089a0e8c3a19eda77e26e09f8">SyncProfile::SYNC_DIRECTION_FROM_REMOTE</a>);</div>
<div class="line">    <span class="keywordflow">if</span> (pm.<a class="code" href="classButeo_1_1ProfileManager.html#a51a5d40107547a35c5de014bac866914">updateProfile</a>(sp).isEmpty()) {</div>
<div class="line">        LOG_DEBUG(<span class="stringliteral">&quot;Update failed for profile &quot;</span> &lt;&lt; profileName);</div>
<div class="line">    } <span class="keywordflow">else</span></div>
<div class="line">        LOG_DEBUG(<span class="stringliteral">&quot;Profile successfully updated&quot;</span>);</div>
<div class="line">}</div>
<div class="line">...</div>
<div class="line">...</div>
</div><!-- fragment --><h3><a class="anchor" id="sync-schedule"></a>
Handle sync schedule</h3>
<p>ProfileManager can be used to set the schedule of a sync session </p><div class="fragment"><div class="line"><span class="keyword">using namespace </span><a class="code" href="namespaceButeo.html">Buteo</a>;</div>
<div class="line">...</div>
<div class="line">...</div>
<div class="line"><a class="code" href="classButeo_1_1ProfileManager.html">ProfileManager</a> pm;</div>
<div class="line"><a class="code" href="classButeo_1_1SyncProfile.html">SyncProfile</a> *sp = pm.<a class="code" href="classButeo_1_1ProfileManager.html#a69831ac859de6c3f6d3bbb53596fcf5c">syncProfile</a>(profileName);</div>
<div class="line"></div>
<div class="line"><span class="keywordflow">if</span> (sp) {</div>
<div class="line">    <a class="code" href="classButeo_1_1SyncSchedule.html">SyncSchedule</a> sched = sp-&gt;<a class="code" href="classButeo_1_1SyncProfile.html#a0eb62316e39f05265058bae11a5e99a8">syncSchedule</a>();</div>
<div class="line">    <span class="keywordflow">if</span> (!sched.isEmpty()) {</div>
<div class="line">        sched.<a class="code" href="classButeo_1_1SyncSchedule.html#a6f10ad763cb9b342fdfb1283d7207772">setInterval</a>(45);</div>
<div class="line">        sched.<a class="code" href="classButeo_1_1SyncSchedule.html#af4b6ec6481cdd8c2a8bf73281a5bec6f">setRushEnabled</a>(<span class="keyword">false</span>);</div>
<div class="line">        DaySet days;</div>
<div class="line">        days &lt;&lt; Qt::Tuesday &lt;&lt; Qt::Thursday &lt;&lt; Qt::Sunday;</div>
<div class="line">        sched.<a class="code" href="classButeo_1_1SyncSchedule.html#a93d4258487466f3a351903788209de78">setDays</a>(days);</div>
<div class="line">        sched.<a class="code" href="classButeo_1_1SyncSchedule.html#a6590f927ccfb74640cf37da8356da35e">setScheduleEnabled</a>(<span class="keyword">true</span>);        </div>
<div class="line">        sp-&gt;<a class="code" href="classButeo_1_1SyncProfile.html#ad84f43031146427df47306302bdf07a2">setSyncSchedule</a>(sched);</div>
<div class="line">    } <span class="keywordflow">else</span> {</div>
<div class="line">        <a class="code" href="classButeo_1_1SyncSchedule.html">SyncSchedule</a> newSched;</div>
<div class="line">        newSched.<a class="code" href="classButeo_1_1SyncSchedule.html#a6f10ad763cb9b342fdfb1283d7207772">setInterval</a>(15);</div>
<div class="line">        newSched.<a class="code" href="classButeo_1_1SyncSchedule.html#a5adea2d4c27b93f26353503b599e12e8">setTime</a>(<span class="keyword">new</span> QDateTime());</div>
<div class="line">        newSched.<a class="code" href="classButeo_1_1SyncSchedule.html#a6590f927ccfb74640cf37da8356da35e">setScheduleEnabled</a>(<span class="keyword">true</span>);</div>
<div class="line">        sp-&gt;<a class="code" href="classButeo_1_1SyncProfile.html#ad84f43031146427df47306302bdf07a2">setSyncSchedule</a>(newSched);</div>
<div class="line">    }</div>
<div class="line">    pm.<a class="code" href="classButeo_1_1ProfileManager.html#a51a5d40107547a35c5de014bac866914">updateProfile</a>(sp);</div>
<div class="line">}</div>
</div><!-- fragment --> </div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Dec 16 2015 19:19:26 for ButeoSynchronizationFramework by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>