~ubuntu-branches/ubuntu/quantal/qtmobility/quantal

« back to all changes in this revision

Viewing changes to plugins/declarative/organizer/qdeclarativeorganizeritemdetail.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-11-16 16:18:07 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20101116161807-k2dzt2nyse975r3l
Tags: 1.1.0-0ubuntu1
* New upstream release
* Syncronise with Debian, no remaining changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
**
 
3
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
 
4
** All rights reserved.
 
5
** Contact: Nokia Corporation (qt-info@nokia.com)
 
6
**
 
7
** This file is part of the QtDeclarative module of the Qt Toolkit.
 
8
**
 
9
** $QT_BEGIN_LICENSE:LGPL$
 
10
** Commercial Usage
 
11
** Licensees holding valid Qt Commercial licenses may use this file in 
 
12
** accordance with the Qt Commercial License Agreement provided with
 
13
** the Software or, alternatively, in accordance with the terms
 
14
** contained in a written agreement between you and Nokia.
 
15
**
 
16
** GNU Lesser General Public License Usage
 
17
** Alternatively, this file may be used under the terms of the GNU Lesser
 
18
** General Public License version 2.1 as published by the Free Software
 
19
** Foundation and appearing in the file LICENSE.LGPL included in the
 
20
** packaging of this file.  Please review the following information to
 
21
** ensure the GNU Lesser General Public License version 2.1 requirements
 
22
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
 
23
**
 
24
** In addition, as a special exception, Nokia gives you certain additional
 
25
** rights.  These rights are described in the Nokia Qt LGPL Exception
 
26
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
 
27
**
 
28
** GNU General Public License Usage
 
29
** Alternatively, this file may be used under the terms of the GNU
 
30
** General Public License version 3.0 as published by the Free Software
 
31
** Foundation and appearing in the file LICENSE.GPL included in the
 
32
** packaging of this file.  Please review the following information to
 
33
** ensure the GNU General Public License version 3.0 requirements will be
 
34
** met: http://www.gnu.org/copyleft/gpl.html.
 
35
**
 
36
** If you are unsure which license is appropriate for your use, please
 
37
** contact the sales department at qt-sales@nokia.com.
 
38
** $QT_END_LICENSE$
 
39
**
 
40
****************************************************************************/
 
41
 
 
42
#include <qorganizeritemdetails.h>
 
43
#include "qdeclarativeorganizeritemdetail_p.h"
 
44
 
 
45
 
 
46
Q_DEFINE_LATIN1_CONSTANT(QDeclarativeOrganizerEventTime::DetailName, "eventTime");
 
47
Q_DEFINE_LATIN1_CONSTANT(QDeclarativeOrganizerItemComment::DetailName, "comment");
 
48
Q_DEFINE_LATIN1_CONSTANT(QDeclarativeOrganizerItemComment::DetailGroupName, "comments");
 
49
Q_DEFINE_LATIN1_CONSTANT(QDeclarativeOrganizerItemDescription::DetailName, "description");
 
50
Q_DEFINE_LATIN1_CONSTANT(QDeclarativeOrganizerItemDisplayLabel::DetailName, "label");
 
51
Q_DEFINE_LATIN1_CONSTANT(QDeclarativeOrganizerItemGuid::DetailName, "guid");
 
52
Q_DEFINE_LATIN1_CONSTANT(QDeclarativeOrganizerItemParent::DetailName, "parent");
 
53
Q_DEFINE_LATIN1_CONSTANT(QDeclarativeOrganizerItemLocation::DetailName, "location");
 
54
Q_DEFINE_LATIN1_CONSTANT(QDeclarativeOrganizerItemPriority::DetailName, "priority");
 
55
Q_DEFINE_LATIN1_CONSTANT(QDeclarativeOrganizerItemRecurrence::DetailName, "recurrence");
 
56
Q_DEFINE_LATIN1_CONSTANT(QDeclarativeOrganizerItemReminder::DetailName, "reminder");
 
57
Q_DEFINE_LATIN1_CONSTANT(QDeclarativeOrganizerItemReminder::DetailGroupName, "reminders");
 
58
Q_DEFINE_LATIN1_CONSTANT(QDeclarativeOrganizerItemAudibleReminder::DetailName, "audibleReminder");
 
59
Q_DEFINE_LATIN1_CONSTANT(QDeclarativeOrganizerItemAudibleReminder::DetailGroupName, "audibleReminders");
 
60
Q_DEFINE_LATIN1_CONSTANT(QDeclarativeOrganizerItemVisualReminder::DetailName, "visualReminder");
 
61
Q_DEFINE_LATIN1_CONSTANT(QDeclarativeOrganizerItemVisualReminder::DetailGroupName, "visualReminders");
 
62
Q_DEFINE_LATIN1_CONSTANT(QDeclarativeOrganizerItemEmailReminder::DetailName, "emailReminder");
 
63
Q_DEFINE_LATIN1_CONSTANT(QDeclarativeOrganizerItemEmailReminder::DetailGroupName, "emailReminders");
 
64
Q_DEFINE_LATIN1_CONSTANT(QDeclarativeOrganizerItemTimestamp::DetailName, "timestamp");
 
65
Q_DEFINE_LATIN1_CONSTANT(QDeclarativeOrganizerItemType::DetailName, "type");
 
66
Q_DEFINE_LATIN1_CONSTANT(QDeclarativeOrganizerJournalTime::DetailName, "journalTime");
 
67
Q_DEFINE_LATIN1_CONSTANT(QDeclarativeOrganizerTodoProgress::DetailName, "todoProgress");
 
68
Q_DEFINE_LATIN1_CONSTANT(QDeclarativeOrganizerTodoTime::DetailName, "todoTime");
 
69
 
 
70
 
 
71
/* ==================== QDeclarativeOrganizerItemDetail ======================= */
 
72
 
 
73
/*!
 
74
   \qmlclass ItemDetail QDeclarativeOrganizerItemDetail
 
75
   \brief The ItemDetail element represents a single, complete detail about a organizer item.
 
76
   \ingroup qml-organizer
 
77
 
 
78
   \sa QOrganizerItemDetail
 
79
 
 
80
    The ItemDetail element is part of the \bold{QtMobility.organizer 1.1} module.
 
81
 */
 
82
 
 
83
 
 
84
/*!
 
85
  \qmlproperty string ItemDetail::definitionName
 
86
  This property holds the string constant for the definition name of the detail.
 
87
  This property is read only.
 
88
  */
 
89
 
 
90
/*!
 
91
  \qmlproperty enumeration ItemDetail::type
 
92
  This property holds the type of the detail.
 
93
  This property is read only.
 
94
 
 
95
    \sa EventTime
 
96
    \sa JournalTime
 
97
    \sa TodoTime
 
98
    \sa TodoProgress
 
99
    \sa AudibleReminder
 
100
    \sa VisualReminder
 
101
    \sa EmailReminder
 
102
    \sa Comment
 
103
    \sa Description
 
104
    \sa DisplayLabel
 
105
    \sa Guid
 
106
    \sa Location
 
107
    \sa Parent
 
108
    \sa Priority
 
109
    \sa Recurrence
 
110
    \sa Timestamp
 
111
    \sa Type
 
112
    \sa Tag
 
113
  */
 
114
 
 
115
 
 
116
/*!
 
117
  \qmlproperty list<string> ItemDetail::fieldNames
 
118
  This property holds the list of all field names which this detail supports.
 
119
 
 
120
  This property is read only.
 
121
  */
 
122
/*!
 
123
  \qmlproperty bool ItemDetail::readOnly
 
124
  This property indicates whether or not this detail is writable.
 
125
  This property is read only.
 
126
  */
 
127
/*!
 
128
  \qmlproperty bool ItemDetail::removable
 
129
  This property indicates whether or not this detail is removale.
 
130
  This property is read only.
 
131
  */
 
132
 
 
133
QString QDeclarativeOrganizerItemDetail::definitionName(QDeclarativeOrganizerItemDetail::ItemDetailType type)
 
134
{
 
135
    switch (type) {
 
136
    case QDeclarativeOrganizerItemDetail::EventTime:
 
137
        return QDeclarativeOrganizerEventTime::DetailName;
 
138
    case QDeclarativeOrganizerItemDetail::JournalTime:
 
139
        return QDeclarativeOrganizerJournalTime::DetailName;
 
140
    case QDeclarativeOrganizerItemDetail::TodoTime:
 
141
        return QDeclarativeOrganizerTodoTime::DetailName;
 
142
    case QDeclarativeOrganizerItemDetail::TodoProgress:
 
143
        return QDeclarativeOrganizerTodoProgress::DetailName;
 
144
    case QDeclarativeOrganizerItemDetail::Reminder:
 
145
        return QDeclarativeOrganizerItemReminder::DetailName;
 
146
    case QDeclarativeOrganizerItemDetail::AudibleReminder:
 
147
        return QDeclarativeOrganizerItemAudibleReminder::DetailName;
 
148
    case QDeclarativeOrganizerItemDetail::VisualReminder:
 
149
        return QDeclarativeOrganizerItemVisualReminder::DetailName;
 
150
    case QDeclarativeOrganizerItemDetail::EmailReminder:
 
151
        return QDeclarativeOrganizerItemEmailReminder::DetailName;
 
152
    case QDeclarativeOrganizerItemDetail::Comment:
 
153
        return QDeclarativeOrganizerItemComment::DetailName;
 
154
    case QDeclarativeOrganizerItemDetail::Description:
 
155
        return QDeclarativeOrganizerItemDescription::DetailName;
 
156
    case QDeclarativeOrganizerItemDetail::DisplayLabel:
 
157
        return QDeclarativeOrganizerItemDisplayLabel::DetailName;
 
158
    case QDeclarativeOrganizerItemDetail::Guid:
 
159
        return QDeclarativeOrganizerItemGuid::DetailName;
 
160
    case QDeclarativeOrganizerItemDetail::Location:
 
161
        return QDeclarativeOrganizerItemLocation::DetailName;
 
162
    case QDeclarativeOrganizerItemDetail::Parent:
 
163
        return QDeclarativeOrganizerItemParent::DetailName;
 
164
    case QDeclarativeOrganizerItemDetail::Priority:
 
165
        return QDeclarativeOrganizerItemPriority::DetailName;
 
166
    case QDeclarativeOrganizerItemDetail::Recurrence:
 
167
        return QDeclarativeOrganizerItemRecurrence::DetailName;
 
168
    case QDeclarativeOrganizerItemDetail::Timestamp:
 
169
        return QDeclarativeOrganizerItemTimestamp::DetailName;
 
170
    case QDeclarativeOrganizerItemDetail::Type:
 
171
        return QDeclarativeOrganizerItemType::DetailName;
 
172
    default:
 
173
        break;
 
174
    }
 
175
    qWarning() << QString("Can't find the detail definition name for detail type '%1'").arg(type);
 
176
    return QString();
 
177
}
 
178
 
 
179
 
 
180
QDeclarativeOrganizerItemDetail::ItemDetailType QDeclarativeOrganizerItemDetail::detailType(const QString& definitionName)
 
181
{
 
182
    if (definitionName == QDeclarativeOrganizerEventTime::DetailName)
 
183
        return QDeclarativeOrganizerItemDetail::EventTime;
 
184
    if (definitionName == QDeclarativeOrganizerJournalTime::DetailName)
 
185
            return QDeclarativeOrganizerItemDetail::JournalTime;
 
186
    if (definitionName == QDeclarativeOrganizerTodoTime::DetailName)
 
187
        return QDeclarativeOrganizerItemDetail::TodoTime;
 
188
    if (definitionName == QDeclarativeOrganizerTodoProgress::DetailName)
 
189
        return QDeclarativeOrganizerItemDetail::TodoProgress;
 
190
    if (definitionName == QDeclarativeOrganizerItemReminder::DetailName)
 
191
        return QDeclarativeOrganizerItemDetail::Reminder;
 
192
    if (definitionName == QDeclarativeOrganizerItemAudibleReminder::DetailName)
 
193
        return QDeclarativeOrganizerItemDetail::AudibleReminder;
 
194
    if (definitionName == QDeclarativeOrganizerItemVisualReminder::DetailName)
 
195
        return QDeclarativeOrganizerItemDetail::VisualReminder;
 
196
    if (definitionName == QDeclarativeOrganizerItemEmailReminder::DetailName)
 
197
        return QDeclarativeOrganizerItemDetail::EmailReminder;
 
198
    if (definitionName == QDeclarativeOrganizerItemComment::DetailName)
 
199
        return QDeclarativeOrganizerItemDetail::Comment;
 
200
    if (definitionName == QDeclarativeOrganizerItemDescription::DetailName)
 
201
        return QDeclarativeOrganizerItemDetail::Description;
 
202
    if (definitionName == QDeclarativeOrganizerItemDisplayLabel::DetailName)
 
203
        return QDeclarativeOrganizerItemDetail::DisplayLabel;
 
204
    if (definitionName == QDeclarativeOrganizerItemGuid::DetailName)
 
205
        return QDeclarativeOrganizerItemDetail::Guid;
 
206
    if (definitionName == QDeclarativeOrganizerItemLocation::DetailName)
 
207
        return QDeclarativeOrganizerItemDetail::Location;
 
208
    if (definitionName == QDeclarativeOrganizerItemParent::DetailName)
 
209
        return QDeclarativeOrganizerItemDetail::Parent;
 
210
    if (definitionName == QDeclarativeOrganizerItemPriority::DetailName)
 
211
        return QDeclarativeOrganizerItemDetail::Priority;
 
212
    if (definitionName == QDeclarativeOrganizerItemRecurrence::DetailName)
 
213
        return QDeclarativeOrganizerItemDetail::Recurrence;
 
214
    if (definitionName == QDeclarativeOrganizerItemTimestamp::DetailName)
 
215
        return QDeclarativeOrganizerItemDetail::Timestamp;
 
216
    if (definitionName == QDeclarativeOrganizerItemType::DetailName)
 
217
        return QDeclarativeOrganizerItemDetail::Type;
 
218
    qWarning() << QString("Can't find the detail type for detail name '%1'").arg(definitionName);
 
219
    return QDeclarativeOrganizerItemDetail::Customized;
 
220
}
 
221
 
 
222
QString QDeclarativeOrganizerItemDetail::fieldName(QDeclarativeOrganizerItemDetail::ItemDetailType detailType, int fieldType)
 
223
{
 
224
    switch (detailType) {
 
225
    case QDeclarativeOrganizerItemDetail::EventTime:
 
226
        return QDeclarativeOrganizerEventTime::fieldNameFromFieldType(fieldType);
 
227
    case QDeclarativeOrganizerItemDetail::JournalTime:
 
228
        return QDeclarativeOrganizerJournalTime::fieldNameFromFieldType(fieldType);
 
229
    case QDeclarativeOrganizerItemDetail::TodoTime:
 
230
        return QDeclarativeOrganizerTodoTime::fieldNameFromFieldType(fieldType);
 
231
    case QDeclarativeOrganizerItemDetail::TodoProgress:
 
232
        return QDeclarativeOrganizerTodoProgress::fieldNameFromFieldType(fieldType);
 
233
    case QDeclarativeOrganizerItemDetail::Reminder:
 
234
        return QDeclarativeOrganizerItemReminder::fieldNameFromFieldType(fieldType);
 
235
    case QDeclarativeOrganizerItemDetail::AudibleReminder:
 
236
        return QDeclarativeOrganizerItemAudibleReminder::fieldNameFromFieldType(fieldType);
 
237
    case QDeclarativeOrganizerItemDetail::VisualReminder:
 
238
        return QDeclarativeOrganizerItemVisualReminder::fieldNameFromFieldType(fieldType);
 
239
    case QDeclarativeOrganizerItemDetail::EmailReminder:
 
240
        return QDeclarativeOrganizerItemEmailReminder::fieldNameFromFieldType(fieldType);
 
241
    case QDeclarativeOrganizerItemDetail::Comment:
 
242
        return QDeclarativeOrganizerItemComment::fieldNameFromFieldType(fieldType);
 
243
    case QDeclarativeOrganizerItemDetail::Description:
 
244
        return QDeclarativeOrganizerItemDescription::fieldNameFromFieldType(fieldType);
 
245
    case QDeclarativeOrganizerItemDetail::DisplayLabel:
 
246
        return QDeclarativeOrganizerItemDisplayLabel::fieldNameFromFieldType(fieldType);
 
247
    case QDeclarativeOrganizerItemDetail::Guid:
 
248
        return QDeclarativeOrganizerItemGuid::fieldNameFromFieldType(fieldType);
 
249
    case QDeclarativeOrganizerItemDetail::Location:
 
250
        return QDeclarativeOrganizerItemLocation::fieldNameFromFieldType(fieldType);
 
251
    case QDeclarativeOrganizerItemDetail::Parent:
 
252
        return QDeclarativeOrganizerItemParent::fieldNameFromFieldType(fieldType);
 
253
    case QDeclarativeOrganizerItemDetail::Priority:
 
254
        return QDeclarativeOrganizerItemPriority::fieldNameFromFieldType(fieldType);
 
255
    case QDeclarativeOrganizerItemDetail::Recurrence:
 
256
        return QDeclarativeOrganizerItemRecurrence::fieldNameFromFieldType(fieldType);
 
257
    case QDeclarativeOrganizerItemDetail::Timestamp:
 
258
        return QDeclarativeOrganizerItemTimestamp::fieldNameFromFieldType(fieldType);
 
259
    case QDeclarativeOrganizerItemDetail::Type:
 
260
        return QDeclarativeOrganizerItemType::fieldNameFromFieldType(fieldType);
 
261
    default:
 
262
        break;
 
263
    }
 
264
    qWarning() << QString("Can't find the field name for detail type '%1' and field type '%2'").arg(detailType).arg(fieldType);
 
265
    return QString();
 
266
}
 
267
 
 
268
 
 
269
 
 
270
 
 
271
 
 
272
QString QDeclarativeOrganizerItemComment::fieldNameFromFieldType(int type)
 
273
{
 
274
    switch (type) {
 
275
    case QDeclarativeOrganizerItemComment::Comment:
 
276
        return QOrganizerItemComment::FieldComment;
 
277
    }
 
278
    qWarning() << "invalid field type:" << type;
 
279
    return QString();
 
280
}
 
281
 
 
282
 
 
283
QString QDeclarativeOrganizerItemDescription::fieldNameFromFieldType(int type)
 
284
{
 
285
    switch (type) {
 
286
    case QDeclarativeOrganizerItemDescription::Description:
 
287
        return QOrganizerItemDescription::FieldDescription;
 
288
    }
 
289
    qWarning() << "invalid field type:" << type;
 
290
    return QString();
 
291
}
 
292
 
 
293
 
 
294
QString QDeclarativeOrganizerItemDisplayLabel::fieldNameFromFieldType(int type)
 
295
{
 
296
    switch (type) {
 
297
    case QDeclarativeOrganizerItemDisplayLabel::Label:
 
298
        return QOrganizerItemDisplayLabel::FieldLabel;
 
299
    }
 
300
    qWarning() << "invalid field type:" << type;
 
301
    return QString();
 
302
}
 
303
 
 
304
 
 
305
QString QDeclarativeOrganizerItemGuid::fieldNameFromFieldType(int type)
 
306
{
 
307
    switch (type) {
 
308
    case QDeclarativeOrganizerItemGuid::Guid:
 
309
        return QOrganizerItemGuid::FieldGuid;
 
310
    }
 
311
    qWarning() << "invalid field type:" << type;
 
312
    return QString();
 
313
}
 
314
 
 
315
 
 
316
QString QDeclarativeOrganizerItemParent::fieldNameFromFieldType(int type)
 
317
{
 
318
    switch (type) {
 
319
    case QDeclarativeOrganizerItemParent::ParentId:
 
320
        return QOrganizerItemParent::FieldParentId;
 
321
    case QDeclarativeOrganizerItemParent::OriginalDate:
 
322
        return QOrganizerItemParent::FieldOriginalDate;
 
323
    }
 
324
    qWarning() << "invalid field type:" << type;
 
325
    return QString();
 
326
}
 
327
 
 
328
QString QDeclarativeOrganizerItemLocation::fieldNameFromFieldType(int type)
 
329
{
 
330
    switch (type) {
 
331
    case QDeclarativeOrganizerItemLocation::Latitude:
 
332
        return QOrganizerItemLocation::FieldLatitude;
 
333
    case QDeclarativeOrganizerItemLocation::Longitude:
 
334
        return QOrganizerItemLocation::FieldLongitude;
 
335
    case QDeclarativeOrganizerItemLocation::Label:
 
336
        return QOrganizerItemLocation::FieldLabel;
 
337
    }
 
338
    qWarning() << "invalid field type:" << type;
 
339
    return QString();
 
340
}
 
341
 
 
342
QString QDeclarativeOrganizerItemPriority::fieldNameFromFieldType(int type)
 
343
{
 
344
    switch (type) {
 
345
    case QDeclarativeOrganizerItemPriority::Priority:
 
346
        return QOrganizerItemPriority::FieldPriority;
 
347
    }
 
348
    qWarning() << "invalid field type:" << type;
 
349
    return QString();
 
350
}
 
351
 
 
352
QString QDeclarativeOrganizerItemRecurrence::fieldNameFromFieldType(int type)
 
353
{
 
354
    switch (type) {
 
355
    case QDeclarativeOrganizerItemRecurrence::RecurrenceRules:
 
356
        return QOrganizerItemRecurrence::FieldRecurrenceRules;
 
357
    case QDeclarativeOrganizerItemRecurrence::ExceptionRules:
 
358
        return QOrganizerItemRecurrence::FieldExceptionRules;
 
359
    case QDeclarativeOrganizerItemRecurrence::RecurrenceDates:
 
360
        return QOrganizerItemRecurrence::FieldRecurrenceDates;
 
361
    case QDeclarativeOrganizerItemRecurrence::ExceptionDates:
 
362
        return QOrganizerItemRecurrence::FieldExceptionDates;
 
363
    }
 
364
    qWarning() << "invalid field type:" << type;
 
365
    return QString();
 
366
}
 
367
 
 
368
 
 
369
QString QDeclarativeOrganizerItemReminder::fieldNameFromFieldType(int type)
 
370
{
 
371
    switch (type) {
 
372
    case QDeclarativeOrganizerItemReminder::SecondsBeforeStart:
 
373
        return QOrganizerItemReminder::FieldSecondsBeforeStart;
 
374
    case QDeclarativeOrganizerItemReminder::RepetitionCount:
 
375
        return QOrganizerItemReminder::FieldRepetitionCount;
 
376
    case QDeclarativeOrganizerItemReminder::RepetitionDelay:
 
377
        return QOrganizerItemReminder::FieldRepetitionDelay;
 
378
    }
 
379
    qWarning() << "invalid field type:" << type;
 
380
    return QString();
 
381
}
 
382
 
 
383
 
 
384
QString QDeclarativeOrganizerItemAudibleReminder::fieldNameFromFieldType(int type)
 
385
{
 
386
    switch (type) {
 
387
    case QDeclarativeOrganizerItemAudibleReminder::DataUrl:
 
388
        return QOrganizerItemAudibleReminder::FieldDataUrl;
 
389
    }
 
390
    qWarning() << "invalid field type:" << type;
 
391
    return QString();
 
392
}
 
393
 
 
394
 
 
395
 
 
396
QString QDeclarativeOrganizerItemVisualReminder::fieldNameFromFieldType(int type)
 
397
{
 
398
    switch (type) {
 
399
    case QDeclarativeOrganizerItemVisualReminder::DataUrl:
 
400
        return QOrganizerItemVisualReminder::FieldDataUrl;
 
401
    case QDeclarativeOrganizerItemVisualReminder::Message:
 
402
        return QOrganizerItemVisualReminder::FieldMessage;
 
403
    }
 
404
    qWarning() << "invalid field type:" << type;
 
405
    return QString();
 
406
}
 
407
 
 
408
 
 
409
QString QDeclarativeOrganizerItemEmailReminder::fieldNameFromFieldType(int type)
 
410
{
 
411
    switch (type) {
 
412
    case QDeclarativeOrganizerItemEmailReminder::Subject:
 
413
        return QOrganizerItemEmailReminder::FieldSubject;
 
414
    case QDeclarativeOrganizerItemEmailReminder::Body:
 
415
        return QOrganizerItemEmailReminder::FieldBody;
 
416
    case QDeclarativeOrganizerItemEmailReminder::Recipients:
 
417
        return QOrganizerItemEmailReminder::FieldRecipients;
 
418
    case QDeclarativeOrganizerItemEmailReminder::Attachments:
 
419
        return QOrganizerItemEmailReminder::FieldAttachments;
 
420
    }
 
421
    qWarning() << "invalid field type:" << type;
 
422
    return QString();
 
423
}
 
424
 
 
425
 
 
426
 
 
427
QString QDeclarativeOrganizerItemTimestamp::fieldNameFromFieldType(int type)
 
428
{
 
429
    switch (type) {
 
430
    case QDeclarativeOrganizerItemTimestamp::LastModified:
 
431
        return QOrganizerItemTimestamp::FieldModificationTimestamp;
 
432
    case QDeclarativeOrganizerItemTimestamp::Created:
 
433
        return QOrganizerItemTimestamp::FieldCreationTimestamp;
 
434
    }
 
435
    qWarning() << "invalid field type:" << type;
 
436
    return QString();
 
437
}
 
438
 
 
439
////////////////QDeclarativeOrganizerEventTime////////////////////////
 
440
/*!
 
441
   \qmlclass EventTime QDeclarativeOrganizerEventTime
 
442
   \brief The EventTime element contains the start and end dates and times of a recurring event series, or occurrence of an event.
 
443
   \ingroup qml-organizer
 
444
 
 
445
   EventTime element contains the following field types:
 
446
   \list
 
447
   \o EventTime.StartDateTime
 
448
   \o EventTime.EndDateTime
 
449
   \o EventTime.AllDay
 
450
   \endlist
 
451
 
 
452
   This element is part of the \bold{QtMobility.organizer 1.1} module.
 
453
 */
 
454
 
 
455
/*!
 
456
  \qmlproperty date EventTime::startDateTime
 
457
 
 
458
  This property holds the start date and time value of the event.
 
459
  */
 
460
 
 
461
/*!
 
462
  \qmlproperty date EventTime::endDateTime
 
463
 
 
464
  This property holds the end date and time value of the event.
 
465
  */
 
466
/*!
 
467
  \qmlproperty date EventTime::allDay
 
468
 
 
469
  This property holds whether the time is significant in the start datetime.
 
470
  */
 
471
 
 
472
////////////////QDeclarativeOrganizerTodoTime////////////////////////
 
473
/*!
 
474
   \qmlclass TodoTime QDeclarativeOrganizerTodoTime
 
475
   \brief The TodoTime element contains the start and due dates and times of a recurring todo series, or occurrence of an todo item.
 
476
   \ingroup qml-organizer
 
477
 
 
478
   TodoTime element contains the following field types:
 
479
   \list
 
480
   \o TodoTime.StartDateTime
 
481
   \o TodoTime.DueDateTime
 
482
   \o TodoTime.AllDay
 
483
   \endlist
 
484
 
 
485
   This element is part of the \bold{QtMobility.organizer 1.1} module.
 
486
 */
 
487
 
 
488
/*!
 
489
  \qmlproperty date TodoTime::startDateTime
 
490
 
 
491
  This property holds the start date and time value of the todo item.
 
492
  */
 
493
 
 
494
/*!
 
495
  \qmlproperty date TodoTime::dueDateTime
 
496
 
 
497
  This property holds the end date and time value of the todo item.
 
498
  */
 
499
/*!
 
500
  \qmlproperty date TodoTime::allDay
 
501
 
 
502
  This property holds whether the time is significant in the start datetime.
 
503
  */
 
504
 
 
505
////////////////QDeclarativeOrganizerJournalTime////////////////////////
 
506
/*!
 
507
   \qmlclass JournalTime QDeclarativeOrganizerJournalTime
 
508
   \brief The JournalTime element contains the entry date and time of a journal item.
 
509
   \ingroup qml-organizer
 
510
 
 
511
   JournalTime element contains the following field types:
 
512
   \list
 
513
   \o JournalTime.EntryDateTime
 
514
   \endlist
 
515
 
 
516
   This element is part of the \bold{QtMobility.organizer 1.1} module.
 
517
 */
 
518
 
 
519
/*!
 
520
  \qmlproperty date JournalTime::entryDateTime
 
521
 
 
522
  This property holds the entry date and time value of the journal.
 
523
  */
 
524
 
 
525
////////////////QDeclarativeOrganizerComment////////////////////////
 
526
/*!
 
527
   \qmlclass Comment QDeclarativeOrganizerComment
 
528
   \brief The Comment element contains the comment text of an organizer item.
 
529
   \ingroup qml-organizer
 
530
 
 
531
   Comment element contains the following field types:
 
532
   \list
 
533
   \o Comment.Comment
 
534
   \endlist
 
535
 
 
536
   This element is part of the \bold{QtMobility.organizer 1.1} module.
 
537
 */
 
538
 
 
539
/*!
 
540
  \qmlproperty string Comment::comment
 
541
 
 
542
  This property holds the text of the comment.
 
543
  */
 
544
 
 
545
////////////////QDeclarativeOrganizerDescription////////////////////////
 
546
/*!
 
547
   \qmlclass Description QDeclarativeOrganizerDescription
 
548
   \brief The Description element contains the description text of an organizer item.
 
549
   \ingroup qml-organizer
 
550
 
 
551
   Description element contains the following field types:
 
552
   \list
 
553
   \o Description.Description
 
554
   \endlist
 
555
 
 
556
   This element is part of the \bold{QtMobility.organizer 1.1} module.
 
557
 */
 
558
 
 
559
/*!
 
560
  \qmlproperty string Description::Description
 
561
 
 
562
  This property holds the text of the description.
 
563
  */
 
564
 
 
565
////////////////QDeclarativeOrganizerDisplayLabel////////////////////////
 
566
/*!
 
567
   \qmlclass DisplayLabel QDeclarativeOrganizerDisplayLabel
 
568
   \brief The DisplayLabel element contains the display label of an organizer item.
 
569
   \ingroup qml-organizer
 
570
 
 
571
   DisplayLabel element contains the following field types:
 
572
   \list
 
573
   \o DisplayLabel.DisplayLabel
 
574
   \endlist
 
575
 
 
576
   This element is part of the \bold{QtMobility.organizer 1.1} module.
 
577
 */
 
578
 
 
579
/*!
 
580
  \qmlproperty string DisplayLabel::DisplayLabel
 
581
 
 
582
  This property holds the display label text.
 
583
  */
 
584
 
 
585
////////////////QDeclarativeOrganizerGuid////////////////////////
 
586
/*!
 
587
   \qmlclass Guid QDeclarativeOrganizerGuid
 
588
   \brief The Guid element contains the GUID string of an organizer item.
 
589
   \ingroup qml-organizer
 
590
 
 
591
   Guid element contains the following field types:
 
592
   \list
 
593
   \o Guid.Guid
 
594
   \endlist
 
595
 
 
596
   This element is part of the \bold{QtMobility.organizer 1.1} module.
 
597
 */
 
598
 
 
599
/*!
 
600
  \qmlproperty string Guid::Guid
 
601
 
 
602
  This property holds the GUID string.
 
603
  */
 
604
 
 
605
////////////////QDeclarativeOrganizerTag////////////////////////
 
606
/*!
 
607
   \qmlclass Tag QDeclarativeOrganizerTag
 
608
   \brief The Tag element contains the tag string of an organizer item.
 
609
   \ingroup qml-organizer
 
610
 
 
611
   Tag element contains the following field types:
 
612
   \list
 
613
   \o Tag.Tag
 
614
   \endlist
 
615
 
 
616
   This element is part of the \bold{QtMobility.organizer 1.1} module.
 
617
 */
 
618
 
 
619
/*!
 
620
  \qmlproperty string Tag::Tag
 
621
 
 
622
  This property holds the tag string.
 
623
  */
 
624
 
 
625
////////////////QDeclarativeOrganizerType////////////////////////
 
626
/*!
 
627
   \qmlclass Type QDeclarativeOrganizerType
 
628
   \brief The Type element contains the type string of an organizer item.
 
629
   \ingroup qml-organizer
 
630
 
 
631
   Type element contains the following field types:
 
632
   \list
 
633
   \o Type.Type
 
634
   \endlist
 
635
 
 
636
   This element is part of the \bold{QtMobility.organizer 1.1} module.
 
637
 */
 
638
 
 
639
/*!
 
640
  \qmlproperty string Type::Type
 
641
 
 
642
  This property holds the type string.
 
643
  */
 
644
 
 
645
////////////////QDeclarativeOrganizerTimestamp////////////////////////
 
646
/*!
 
647
   \qmlclass Timestamp QDeclarativeOrganizerTimestamp
 
648
   \brief The Timestamp element contains the created and last modified timestamp of an organizer item's creating date and time.
 
649
   \ingroup qml-organizer
 
650
 
 
651
   Timestamp element contains the following field types:
 
652
   \list
 
653
   \o Timestamp.LastModified
 
654
   \o Timestamp.Created
 
655
   \endlist
 
656
 
 
657
   This element is part of the \bold{QtMobility.organizer 1.1} module.
 
658
 */
 
659
 
 
660
/*!
 
661
  \qmlproperty date Timestamp::lastModified
 
662
 
 
663
  This property holds the value of the item's last modified date and time.
 
664
  */
 
665
 
 
666
/*!
 
667
  \qmlproperty date Timestamp::created
 
668
 
 
669
  This property holds the value of the item's creation date and time.
 
670
  */
 
671
 
 
672
////////////////QDeclarativeOrganizerLocation////////////////////////
 
673
/*!
 
674
   \qmlclass Location QDeclarativeOrganizerLocation
 
675
   \brief The Location element contains information about a location which is related to the organizer item in some manner.
 
676
   \ingroup qml-organizer
 
677
 
 
678
   Location element contains the following field types:
 
679
   \list
 
680
   \o Location.Label
 
681
   \o Location.Longitude
 
682
   \o Location.Latitude
 
683
   \endlist
 
684
 
 
685
   This element is part of the \bold{QtMobility.organizer 1.1} module.
 
686
 */
 
687
 
 
688
/*!
 
689
  \qmlproperty string Location::label
 
690
 
 
691
  This property holds the location label value.
 
692
  */
 
693
 
 
694
/*!
 
695
  \qmlproperty double Location::longitude
 
696
 
 
697
  This property holds the location longitude value .
 
698
  */
 
699
 
 
700
/*!
 
701
  \qmlproperty double Location::latitude
 
702
 
 
703
  This property holds the location latitude value.
 
704
  */
 
705
 
 
706
////////////////QDeclarativeOrganizerTodoProgress////////////////////////
 
707
/*!
 
708
   \qmlclass TodoProgress QDeclarativeOrganizerTodoProgress
 
709
   \brief The TodoProgress element contains information about the progress of a todo item.
 
710
   \ingroup qml-organizer
 
711
 
 
712
   TodoProgress element contains the following field types:
 
713
   \list
 
714
   \o TodoProgress.Status
 
715
   \o TodoProgress.Percentage
 
716
   \o TodoProgress.FinishedDateTime
 
717
   \endlist
 
718
 
 
719
   This element is part of the \bold{QtMobility.organizer 1.1} module.
 
720
 */
 
721
 
 
722
/*!
 
723
  \qmlproperty enumeration TodoProgress::status
 
724
 
 
725
  This property holds the value which describes the current completion status of the
 
726
   todo item. The value can be one of:
 
727
  \list
 
728
  \o TodoProgress.NotStarted
 
729
  \o TodoProgress.InProgress
 
730
  \o TodoProgress.Complete
 
731
  \endlist
 
732
  */
 
733
 
 
734
/*!
 
735
  \qmlproperty int TodoProgress::percentage
 
736
 
 
737
  This property holds the value which contains the current completion percentage of the
 
738
   todo item.
 
739
  */
 
740
 
 
741
/*!
 
742
  \qmlproperty date TodoProgress::finishedDateTime
 
743
 
 
744
  This property holds the date time value which contains the date and time at which the
 
745
   todo item was completed.
 
746
  */
 
747
 
 
748
 
 
749
////////////////QDeclarativeOrganizerItemParent////////////////////////
 
750
/*!
 
751
   \qmlclass Parent QDeclarativeOrganizerItemParent
 
752
   \brief The Parent element contains information about the event or todo that generated this item.
 
753
   \ingroup qml-organizer
 
754
 
 
755
   Parent element contains the following field types:
 
756
   \list
 
757
   \o Parent.ParentId
 
758
   \o Parent.OriginalDate
 
759
   \endlist
 
760
 
 
761
   This element is part of the \bold{QtMobility.organizer 1.1} module.
 
762
 */
 
763
 
 
764
/*!
 
765
  \qmlproperty int Parent::parentId
 
766
 
 
767
  This property holds the id of the parent recurrent event or todo.
 
768
  */
 
769
 
 
770
/*!
 
771
  \qmlproperty date Parent::originalDate
 
772
 
 
773
  This property holds the original date of this instance origin item.
 
774
  */
 
775
 
 
776
////////////////QDeclarativeOrganizerItemRecurrence////////////////////////
 
777
/*!
 
778
   \qmlclass Recurrence QDeclarativeOrganizerItemRecurrence
 
779
   \brief The Recurrence element contains a list of rules and dates on which the recurrent item occurs,
 
780
          and a list of rules and dates on which exceptions occur.
 
781
   \ingroup qml-organizer
 
782
 
 
783
   Recurrence element contains the following field types:
 
784
   \list
 
785
   \o Recurrence.RecurrenceRules
 
786
   \o Recurrence.ExceptionRules
 
787
   \o Recurrence.RecurrenceDates
 
788
   \o Recurrence.ExceptionDates
 
789
   \endlist
 
790
 
 
791
   This element is part of the \bold{QtMobility.organizer 1.1} module.
 
792
 */
 
793
 
 
794
/*!
 
795
  \qmlproperty QDeclarativeListProperty Recurrence::recurrenceRules
 
796
 
 
797
  This property holds the list of recurrence rules.
 
798
 
 
799
  \sa RecurrenceRule
 
800
  */
 
801
 
 
802
/*!
 
803
  \qmlproperty QDeclarativeListProperty Recurrence::exceptionRules
 
804
 
 
805
  This property holds the list of exception rules.
 
806
 
 
807
  \sa RecurrenceRule
 
808
  */
 
809
 
 
810
/*!
 
811
  \qmlproperty list<date> Recurrence::recurrenceDates
 
812
 
 
813
  This property holds the list of recurrence dates.
 
814
  */
 
815
 
 
816
/*!
 
817
  \qmlproperty list<date> Recurrence::exceptionDates
 
818
 
 
819
  This property holds the list of exception dates.
 
820
  */
 
821
 
 
822
////////////////QDeclarativeOrganizerItemPriority////////////////////////
 
823
/*!
 
824
   \qmlclass Priority QDeclarativeOrganizerItemPriority
 
825
   \brief The Priority element contains the priority of the organizer item, which may be used to resolve scheduling conflicts.
 
826
   \ingroup qml-organizer
 
827
 
 
828
   Priority element contains the following field types:
 
829
   \list
 
830
   \o Priority.Priority
 
831
   \endlist
 
832
 
 
833
   This element is part of the \bold{QtMobility.organizer 1.1} module.
 
834
 */
 
835
 
 
836
/*!
 
837
  \qmlproperty enumeration Priority::priority
 
838
 
 
839
  This property holds the priority associated with an organizer item. The value can be one of:
 
840
  \list
 
841
  \o Priority.Unknown
 
842
  \o Priority.Highest
 
843
  \o Priority.ExtremelyHigh
 
844
  \o Priority.VeryHigh
 
845
  \o Priority.High
 
846
  \o Priority.Medium
 
847
  \o Priority.Low
 
848
  \o Priority.VeryLow
 
849
  \o Priority.ExtremelyLow
 
850
  \o Priority.Lowest
 
851
  \endlist
 
852
  */
 
853
 
 
854
////////////////QDeclarativeOrganizerItemReminder////////////////////////
 
855
/*!
 
856
   \qmlclass Reminder QDeclarativeOrganizerItemReminder
 
857
   \brief The Reminder element contains information about when and how the user wants to reminded of the item.
 
858
   \ingroup qml-organizer
 
859
 
 
860
   Reminder element contains the following field types:
 
861
   \list
 
862
   \o Reminder.Type
 
863
   \o Reminder.SecondsBeforeStart
 
864
   \o Reminder.RepetitionCount
 
865
   \o Reminder.RepetitionDelay
 
866
   \endlist
 
867
 
 
868
   This element is part of the \bold{QtMobility.organizer 1.1} module.
 
869
 */
 
870
 
 
871
/*!
 
872
  \qmlproperty enumeration Reminder::type
 
873
 
 
874
  This property holds the reminder type of this reminder for an organizer item. The value can be one of:
 
875
  \list
 
876
  \o Reminder.NoReminder
 
877
  \o Reminder.VisualReminder
 
878
  \o Reminder.AudibleReminder
 
879
  \o Reminder.EmailReminder
 
880
  \endlist
 
881
  */
 
882
 
 
883
/*!
 
884
  \qmlproperty int Reminder::secondsBeforeStart
 
885
 
 
886
  This property holds the number of seconds prior to the activation of the item
 
887
   at which the user wants to be reminded of the item.
 
888
  */
 
889
/*!
 
890
  \qmlproperty int Reminder::repetitionCount
 
891
 
 
892
  This property holds the number of times the user should be reminded of the item.
 
893
  */
 
894
/*!
 
895
  \qmlproperty int Reminder::repetitionDelay
 
896
 
 
897
  This property holds the delay (in seconds) between each repetition of the reminder.
 
898
  */
 
899
 
 
900
////////////////QDeclarativeOrganizerItemAudibleReminder////////////////////////
 
901
/*!
 
902
   \qmlclass AudibleReminder QDeclarativeOrganizerItemAudibleReminder
 
903
   \brief The AudibleReminder element contains information about an audible reminder of an item.
 
904
   \ingroup qml-organizer
 
905
 
 
906
   \inherits Reminder
 
907
 
 
908
   AudibleReminder element contains the following field types:
 
909
   \list
 
910
   \o AudibleReminder.DataUrl
 
911
   \endlist
 
912
 
 
913
   This element is part of the \bold{QtMobility.organizer 1.1} module.
 
914
 */
 
915
 
 
916
/*!
 
917
  \qmlproperty url AudibleReminder::dataUrl
 
918
 
 
919
  This property holds the url of the audible data to play.
 
920
  */
 
921
 
 
922
////////////////QDeclarativeOrganizerItemVisualReminder////////////////////////
 
923
/*!
 
924
   \qmlclass VisualReminder QDeclarativeOrganizerItemVisualReminder
 
925
   \brief The VisualReminder element contains information about a visual reminder of an item.
 
926
   \ingroup qml-organizer
 
927
 
 
928
   \inherits Reminder
 
929
 
 
930
   VisualReminder element contains the following field types:
 
931
   \list
 
932
   \o VisualReminder.DataUrl
 
933
   \o VisualReminder.Message
 
934
   \endlist
 
935
 
 
936
   This element is part of the \bold{QtMobility.organizer 1.1} module.
 
937
 */
 
938
 
 
939
/*!
 
940
  \qmlproperty url VisualReminder::dataUrl
 
941
 
 
942
  This property holds the url of the visual data which the user wishes to be displayed as part of the reminder.
 
943
  */
 
944
/*!
 
945
  \qmlproperty string VisualReminder::message
 
946
 
 
947
  This property holds the message which the user wishes to be displayed as part of the reminder.
 
948
  */
 
949
 
 
950
////////////////QDeclarativeOrganizerItemEmailReminder////////////////////////
 
951
/*!
 
952
   \qmlclass EmailReminder QDeclarativeOrganizerItemEmailReminder
 
953
   \brief The EmailReminder element contains information about an email reminder of an item.
 
954
   \ingroup qml-organizer
 
955
 
 
956
   \inherits Reminder
 
957
 
 
958
   EmailReminder element contains the following field types:
 
959
   \list
 
960
   \o EmailReminder.Subject
 
961
   \o EmailReminder.Body
 
962
   \o EmailReminder.Recipients
 
963
   \o EmailReminder.Attachments
 
964
   \endlist
 
965
 
 
966
   This element is part of the \bold{QtMobility.organizer 1.1} module.
 
967
 */
 
968
 
 
969
/*!
 
970
  \qmlproperty string EmailReminder::subject
 
971
 
 
972
  This property holds the subject of the email.
 
973
  */
 
974
/*!
 
975
  \qmlproperty string EmailReminder::body
 
976
 
 
977
  This property holds the body of the email.
 
978
  */
 
979
 
 
980
/*!
 
981
  \qmlproperty list<string> EmailReminder::recipients
 
982
 
 
983
  This property holds the list of recipients that the user wishes to be sent an email as part of the reminder.
 
984
  */
 
985
 
 
986
/*!
 
987
  \qmlproperty list<variant> EmailReminder::attachments
 
988
 
 
989
  This property holds the attachments of the email.
 
990
  */
 
991
QString QDeclarativeOrganizerEventTime::fieldNameFromFieldType(int type)
 
992
{
 
993
    switch (type) {
 
994
    case QDeclarativeOrganizerEventTime::StartDateTime:
 
995
        return QOrganizerEventTime::FieldStartDateTime;
 
996
    case QDeclarativeOrganizerEventTime::EndDateTime:
 
997
        return QOrganizerEventTime::FieldEndDateTime;
 
998
    case QDeclarativeOrganizerEventTime::AllDay:
 
999
        return QOrganizerEventTime::FieldAllDay;
 
1000
    }
 
1001
    qWarning() << "invalid field type:" << type;
 
1002
    return QString();
 
1003
}
 
1004
 
 
1005
QString QDeclarativeOrganizerItemType::fieldNameFromFieldType(int type)
 
1006
{
 
1007
    switch (type) {
 
1008
    case QDeclarativeOrganizerItemType::ItemType:
 
1009
        return QOrganizerItemType::FieldType;
 
1010
    }
 
1011
    qWarning() << "invalid field type:" << type;
 
1012
    return QString();
 
1013
}
 
1014
 
 
1015
 
 
1016
QString QDeclarativeOrganizerJournalTime::fieldNameFromFieldType(int type)
 
1017
{
 
1018
    switch (type) {
 
1019
    case QDeclarativeOrganizerJournalTime::EntryDateTime:
 
1020
        return QOrganizerJournalTime::FieldEntryDateTime;
 
1021
    }
 
1022
    qWarning() << "invalid field type:" << type;
 
1023
    return QString();
 
1024
}
 
1025
 
 
1026
 
 
1027
QString QDeclarativeOrganizerTodoProgress::fieldNameFromFieldType(int type)
 
1028
{
 
1029
    switch (type) {
 
1030
    case QDeclarativeOrganizerTodoProgress::Status:
 
1031
        return QOrganizerTodoProgress::FieldStatus;
 
1032
    case QDeclarativeOrganizerTodoProgress::Percentage:
 
1033
        return QOrganizerTodoProgress::FieldPercentageComplete;
 
1034
    case QDeclarativeOrganizerTodoProgress::FinishedDateTime:
 
1035
        return QOrganizerTodoProgress::FieldFinishedDateTime;
 
1036
    }
 
1037
    qWarning() << "invalid field type:" << type;
 
1038
    return QString();
 
1039
}
 
1040
 
 
1041
QString QDeclarativeOrganizerTodoTime::fieldNameFromFieldType(int type)
 
1042
{
 
1043
    switch (type) {
 
1044
    case QDeclarativeOrganizerTodoTime::AllDay:
 
1045
        return QOrganizerTodoTime::FieldAllDay;
 
1046
    case QDeclarativeOrganizerTodoTime::StartDateTime:
 
1047
        return QOrganizerTodoTime::FieldStartDateTime;
 
1048
    case QDeclarativeOrganizerTodoTime::DueDateTime:
 
1049
        return QOrganizerTodoTime::FieldDueDateTime;
 
1050
    }
 
1051
    qWarning() << "invalid field type:" << type;
 
1052
    return QString();
 
1053
}