1/****************************************************************************
2**
3** Copyright (C) 2015 The Qt Company Ltd.
4** Contact: http://www.qt.io/licensing/
5**
6** This file is part of the QtOrganizer module of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL21$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The Qt Company. For licensing terms
14** and conditions see http://www.qt.io/terms-conditions. For further
15** information use the contact form at http://www.qt.io/contact-us.
16**
17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser
19** General Public License version 2.1 or version 3 as published by the Free
20** Software Foundation and appearing in the file LICENSE.LGPLv21 and
21** LICENSE.LGPLv3 included in the packaging of this file. Please review the
22** following information to ensure the GNU Lesser General Public License
23** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
24** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25**
26** As a special exception, The Qt Company gives you certain additional
27** rights. These rights are described in The Qt Company LGPL Exception
28** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29**
30** $QT_END_LICENSE$
31**
32****************************************************************************/
33
34#include "qorganizeritemdetails.h"
35
36#include <QtCore/qdatetime.h>
37#include <QtCore/qurl.h>
38
39QT_BEGIN_NAMESPACE_ORGANIZER
40
41/*!
42 \class QOrganizerItemDescription
43 \brief The QOrganizerItemDescription class contains some arbitrary information which is relevant to the organizer item.
44 \inmodule QtOrganizer
45 \ingroup organizer-details
46 */
47
48/*!
49 \enum QOrganizerItemDescription::DescriptionField
50
51 This enumeration defines the fields supported by QOrganizerItemDescription.
52 \value FieldDescription The value stored is a description.
53 */
54
55/*!
56 Sets a description associated with an organizer item to \a description.
57 */
58void QOrganizerItemDescription::setDescription(const QString &description)
59{
60 setValue(field: FieldDescription, value: description);
61}
62
63/*!
64 Returns a string for a description associated with an organizer item.
65 */
66QString QOrganizerItemDescription::description() const
67{
68 return value(field: FieldDescription).toString();
69}
70
71
72/*!
73 \class QOrganizerItemDisplayLabel
74 \brief The QOrganizerItemDisplayLabel class contains the backend-synthesized display label of the organizer item.
75 \inmodule QtOrganizer
76 \ingroup organizer-details
77*/
78
79/*!
80 Sets the display label of the organizer item to \a label.
81 */
82void QOrganizerItemDisplayLabel::setLabel(const QString &label)
83{
84 setValue(field: FieldLabel, value: label);
85}
86
87/*!
88 Returns the display label of the organizer item.
89 */
90QString QOrganizerItemDisplayLabel::label() const
91{
92 return value(field: FieldLabel).toString();
93}
94
95/*!
96 \enum QOrganizerItemDisplayLabel::DisplayLabelField
97
98 This enumeration defines the fields supported by QOrganizerItemDisplayLabel.
99 \value FieldLabel The value stored is a description label.
100 */
101
102
103/*!
104 \class QOrganizerEventAttendee
105 \brief The QOrganizerEventAttendee class contains information about an attendee of an event
106 \inmodule QtOrganizer
107 \ingroup organizer-details
108
109 Attendee details contain information such as the display label (name) of an attendee, their
110 role in the event, and their participation status.
111 */
112
113/*!
114 \enum QOrganizerEventAttendee::EventAttendeeField
115
116 This enumeration defines the fields supported by QOrganizerEventAttendee.
117 \value FieldName The value stored describes the name of the attendee.
118 \value FieldEmailAddress The value stored describes the Email address of the attendee.
119 \value FieldAttendeeId The value stored describes the ID of the attendee. It can be e.g.
120 a serialized contact ID, vCard UID, or any other platform specific
121 ID.
122 \value FieldParticipationStatus The value stored describes the participation status of the attendee.
123 \value FieldParticipationRole The value stored describes the participation role of the attendee.
124 */
125
126/*!
127 \enum QOrganizerEventAttendee::ParticipationStatus
128 \value StatusUnknown The status of the attendee is unknown or they have yet to respond.
129 \value StatusAccepted The attendee has responded that they will be attending the event.
130 \value StatusDeclined The attendee has responded that they will not be attending the event.
131 \value StatusTentative The attendee has responded that they may be attending the event.
132 \value StatusDelegated The attendee has delegated attendance at the event to another person.
133 \value StatusInProcess The attendee is currently attending the event.
134 \value StatusCompleted The attendee attended the event.
135*/
136
137/*!
138 \enum QOrganizerEventAttendee::ParticipationRole
139 \value RoleUnknown The role of the attendee is unknown or they have yet to respond.
140 \value RoleOrganizer The attendee is the organizer of the event.
141 \value RoleChairperson The attendee is the chairperson of the event.
142 \value RoleHost The attendee is the host of the event.
143 \value RoleRequiredParticipant The attendee is a required participant of the event.
144 \value RoleOptionalParticipant The attendee is an optional participant of the event.
145 \value RoleNonParticipant The attendee is not participating in the event (value included
146 for informational purposes only, as per iCalendar specification).
147*/
148
149/*!
150 Sets the name (or title or other label) of the attendee to \a name.
151 */
152void QOrganizerEventAttendee::setName(const QString &name)
153{
154 setValue(field: FieldName, value: name);
155}
156
157/*!
158 Returns the name (or title or other label) of the attendee.
159 */
160QString QOrganizerEventAttendee::name() const
161{
162 return value(field: FieldName).toString();
163}
164
165/*!
166 Sets the email address of the attendee to \a emailAddress.
167 */
168void QOrganizerEventAttendee::setEmailAddress(const QString &emailAddress)
169{
170 setValue(field: FieldEmailAddress, value: emailAddress);
171}
172
173/*!
174 Returns the email address of the attendee.
175 */
176QString QOrganizerEventAttendee::emailAddress() const
177{
178 return value(field: FieldEmailAddress).toString();
179}
180
181/*!
182 Sets the unique identifier of the attendee to \a attendeeId.
183 */
184void QOrganizerEventAttendee::setAttendeeId(const QString &attendeeId)
185{
186 setValue(field: FieldAttendeeId, value: attendeeId);
187}
188
189/*!
190 Returns the unique identifier of the attendee. The format of the identifier
191 is platform specific and may be a serialized id, a vCard UID, or something else.
192 */
193QString QOrganizerEventAttendee::attendeeId() const
194{
195 return value(field: FieldAttendeeId).toString();
196}
197
198/*!
199 Sets the participation status of the attendee in the event to \a status.
200 */
201void QOrganizerEventAttendee::setParticipationStatus(ParticipationStatus status)
202{
203 setValue(field: FieldParticipationStatus, value: status);
204}
205
206/*!
207 Returns the participation status of the attendee in the event.
208 */
209QOrganizerEventAttendee::ParticipationStatus QOrganizerEventAttendee::participationStatus() const
210{
211 return static_cast<ParticipationStatus>(value(field: FieldParticipationStatus).toInt());
212}
213
214/*!
215 Sets the role of the attendee in the event to \a role.
216 */
217void QOrganizerEventAttendee::setParticipationRole(ParticipationRole role)
218{
219 setValue(field: FieldParticipationRole, value: role);
220}
221
222/*!
223 Returns the participation role of the attendee in the event.
224 */
225QOrganizerEventAttendee::ParticipationRole QOrganizerEventAttendee::participationRole() const
226{
227 return static_cast<ParticipationRole>(value(field: FieldParticipationRole).toInt());
228}
229
230/*!
231 \class QOrganizerEventTime
232 \brief The QOrganizerEventTime class contains the start and end dates and times of a recurring event series,
233 or occurrence of an event.
234 \inmodule QtOrganizer
235 \ingroup organizer-details
236 */
237
238/*!
239 \enum QOrganizerEventTime::EventTimeField
240
241 This enumeration defines the fields supported by QOrganizerEventTime.
242 \value FieldEndDateTime The value stored describes the end date time of the event.
243 \value FieldStartDateTime The value stored describes the start date time of the event.
244 \value FieldAllDay The value stored describes if the event is an all day event.
245 */
246
247/*!
248 Returns the event time's start date and time as QDateTime.
249 For all-day events, the time part is meaningless.
250
251 \sa QOrganizerEventTime::setStartDateTime()
252 */
253QDateTime QOrganizerEventTime::startDateTime() const
254{
255 return value(field: FieldStartDateTime).toDateTime();
256}
257
258/*!
259 Sets the event time's start date and time to \a startDateTime.
260 For all-day events, the time part can be set to any valid value.
261
262 \sa QOrganizerEventTime::startDateTime()
263 */
264void QOrganizerEventTime::setStartDateTime(const QDateTime &startDateTime)
265{
266 setValue(field: FieldStartDateTime, value: startDateTime);
267}
268
269/*!
270 Sets the event time's due date and time to \a endDateTime.
271 For all-day events, the time part can be set to any valid value, and the date is to be
272 interpreted as the inclusive end date.
273
274 \sa QOrganizerEventTime::endDateTime()
275 */
276void QOrganizerEventTime::setEndDateTime(const QDateTime &endDateTime)
277{
278 setValue(field: FieldEndDateTime, value: endDateTime);
279}
280
281/*!
282 Returns the event time's due date and time as QDateTime.
283 For all-day events, the time part is meaningless, and the date is to be interpreted as the
284 inclusive end date.
285
286 \sa QOrganizerEventTime::setEndDateTime()
287 */
288QDateTime QOrganizerEventTime::endDateTime() const
289{
290 return value(field: FieldEndDateTime).toDateTime();
291}
292
293/*!
294 Sets the all-day status of the event to \a isAllDay.
295 If the event is an all-day event, no time is considered to be
296 specified for the event, even if a start or end date time set
297 for the event has a time component.
298 */
299void QOrganizerEventTime::setAllDay(bool isAllDay)
300{
301 setValue(field: FieldAllDay, value: isAllDay);
302}
303
304/*!
305 Returns true if the event is an all-day event, or false otherwise.
306 */
307bool QOrganizerEventTime::isAllDay() const
308{
309 return value(field: FieldAllDay).toBool();
310}
311
312
313/*!
314 \class QOrganizerItemGuid
315 \brief The QOrganizerItemGuid class contains the globally unique identifier of the organizer item,
316 which can be used for synchronization purposes.
317 \inmodule QtOrganizer
318 \ingroup organizer-details
319 */
320
321/*!
322 \enum QOrganizerItemGuid::GuidField
323
324 This enumeration defines the fields supported by QOrganizerItemGuid.
325 \value FieldGuid The value stored is the global unique identifier of the item.
326 */
327
328/*!
329 Returns the globally unique identifier which is stored in this detail.
330 */
331QString QOrganizerItemGuid::guid() const
332{
333 return value(field: FieldGuid).toString();
334}
335
336/*!
337 Sets the globally unique identifier which is stored in this detail to \a guid.
338 */
339void QOrganizerItemGuid::setGuid(const QString &guid)
340{
341 setValue(field: FieldGuid, value: guid);
342}
343
344
345/*!
346 \class QOrganizerItemParent
347 \brief The QOrganizerItemParent class contains information about the event or todo that generated this item.
348 \inmodule QtOrganizer
349 \ingroup organizer-details
350 */
351
352/*!
353 \enum QOrganizerItemParent::ParentField
354
355 This enumeration defines the fields supported by QOrganizerItemParent.
356 \value FieldParentId The value stored describes the ID of the item's parent item.
357 \value FieldOriginalDate The value stored describes the original date of this instance or exception
358 according to the recurrent series of the parent item is stored.
359 */
360
361/*!
362 Returns the ID of the item instance origin's parent item.
363 */
364QOrganizerItemId QOrganizerItemParent::parentId() const
365{
366 return value(field: FieldParentId).value<QOrganizerItemId>();
367}
368
369/*!
370 Sets the parent ID of this instance origin item to \a parentId.
371 */
372void QOrganizerItemParent::setParentId(const QOrganizerItemId &parentId)
373{
374 setValue(field: FieldParentId, value: QVariant::fromValue(value: parentId));
375}
376
377/*!
378 Returns the original date of this instance origin item.
379 */
380QDate QOrganizerItemParent::originalDate() const
381{
382 return value(field: FieldOriginalDate).toDate();
383}
384
385/*!
386 Sets the origin date to \a date.
387 */
388void QOrganizerItemParent::setOriginalDate(const QDate &date)
389{
390 setValue(field: FieldOriginalDate, value: date);
391}
392
393
394/*!
395 \class QOrganizerJournalTime
396
397 \brief The QOrganizerJournalTime class contains information about
398 the date and time for which a journal entry has been created.
399 \inmodule QtOrganizer
400 \ingroup organizer-details
401 */
402
403/*!
404 \enum QOrganizerJournalTime::JournalTimeField
405
406 This enumeration defines the fields supported by QOrganizerJournalTime.
407 \value FieldEntryDateTime The value stored describes the date time of the journal entry.
408 */
409
410/*!
411 Returns the journal entry date and time as QDateTime.
412 */
413QDateTime QOrganizerJournalTime::entryDateTime() const
414{
415 return value(field: FieldEntryDateTime).toDateTime();
416}
417
418/*!
419 Sets the journal entry date and time to \a entryDateTime.
420 */
421void QOrganizerJournalTime::setEntryDateTime(const QDateTime &entryDateTime)
422{
423 setValue(field: FieldEntryDateTime, value: entryDateTime);
424}
425
426
427/*!
428 \class QOrganizerItemLocation
429
430 \brief The QOrganizerItemLocation class contains information about a location which is related to the organizer item in some manner.
431 \inmodule QtOrganizer
432 \ingroup organizer-details
433 */
434
435/*!
436 \enum QOrganizerItemLocation::LocationField
437
438 This enumeration defines the fields supported by QOrganizerItemLocation.
439 \value FieldLatitude The value stored describes the latitude of the location.
440 \value FieldLongitude The value stored describes the longitude of the location.
441 \value FieldLabel The value stored is a label for the location.
442 */
443
444/*!
445 Returns the latitude value of the location's geocoordinates.
446 */
447double QOrganizerItemLocation::latitude() const
448{
449 return value(field: FieldLatitude).toDouble();
450}
451
452/*!
453 Sets the latitude value of the location's geocoordinates to \a latitude.
454
455 The equator has a latitude of 0, the North pole has a latitude of 90, and the South pole has a
456 latitude of -90. Values out of the range will be ignored.
457 */
458void QOrganizerItemLocation::setLatitude(double latitude)
459{
460 if (latitude >= -90 && latitude <= 90)
461 setValue(field: FieldLatitude, value: latitude);
462}
463
464/*!
465 Returns the longitude value of the location's geocoordinates.
466 */
467double QOrganizerItemLocation::longitude() const
468{
469 return value(field: FieldLongitude).toDouble();
470}
471
472/*!
473 Sets the longitude value of the location's geocoordinates to \a longitude.
474
475 The Prime Meridian has a longitude of 0, ranging to 180 eastward and -180 westward. Values out
476 of the range will be ignored.
477 */
478void QOrganizerItemLocation::setLongitude(double longitude)
479{
480 if (longitude >= -180 && longitude <= 180)
481 setValue(field: FieldLongitude, value: longitude);
482}
483
484/*!
485 Returns the human-readable label of the location.
486 */
487QString QOrganizerItemLocation::label() const
488{
489 return value(field: FieldLabel).toString();
490}
491
492/*!
493 Sets the human-readable label of the location to \a label.
494 */
495void QOrganizerItemLocation::setLabel(const QString &label)
496{
497 setValue(field: FieldLabel, value: label);
498}
499
500
501/*!
502 \class QOrganizerItemComment
503 \brief The QOrganizerItemComment class contains some arbitrary information which is relevant to the organizer item.
504 \inmodule QtOrganizer
505 \ingroup organizer-details
506 */
507
508/*!
509 \enum QOrganizerItemComment::CommentField
510
511 This enumeration defines the fields supported by QOrganizerItemComment.
512 \value FieldComment The value is a comment of the item.
513 */
514
515/*!
516 Sets a comment associated with an organizer item to \a comment.
517 */
518void QOrganizerItemComment::setComment(const QString &comment)
519{
520 setValue(field: FieldComment, value: comment);
521}
522
523/*!
524 Returns a string for a comment associated with an organizer item.
525 */
526QString QOrganizerItemComment::comment() const
527{
528 return value(field: FieldComment).toString();
529}
530
531
532/*!
533 \class QOrganizerItemPriority
534 \brief The QOrganizerItemPriority class contains the priority of the organizer item, which may be used to resolve scheduling conflicts.
535 \inmodule QtOrganizer
536 \ingroup organizer-details
537 */
538
539/*!
540 \enum QOrganizerItemPriority::Priority
541 \value UnknownPriority
542 \value HighestPriority
543 \value ExtremelyHighPriority
544 \value VeryHighPriority
545 \value HighPriority
546 \value MediumPriority
547 \value LowPriority
548 \value VeryLowPriority
549 \value ExtremelyLowPriority
550 \value LowestPriority
551 */
552
553/*!
554 \enum QOrganizerItemPriority::PriorityField
555
556 This enumeration defines the fields supported by QOrganizerItemPriority.
557 \value FieldPriority The value describes the priority of the item.
558 */
559
560/*!
561 Sets the priority associated with an organizer item to \a priority.
562 */
563void QOrganizerItemPriority::setPriority(Priority priority)
564{
565 setValue(field: FieldPriority, value: priority);
566}
567
568/*!
569 Returns the priority associated with an organizer item.
570 */
571QOrganizerItemPriority::Priority QOrganizerItemPriority::priority() const
572{
573 return static_cast<Priority>(value(field: FieldPriority).toInt());
574}
575
576
577/*!
578 \class QOrganizerItemRecurrence
579 \brief The QOrganizerItemRecurrence class contains a list of rules and dates on which the recurrent item occurs,
580 and a list of rules and dates on which exceptions occur.
581 \inmodule QtOrganizer
582 \ingroup organizer-details
583 */
584
585/*!
586 Returns true if the \a other recurrence detail is equal to this detail; otherwise, false.
587
588 Since the data types stored in this detail are custom data types, the base class
589 operator==() doesn't know how to perform the comparison without calling this function.
590 However, it means that if (in the future) a backend were to extend the detail with
591 more fields, this operator== would no longer work; it'd have to be updated to compare
592 the other fields also.
593 */
594bool QOrganizerItemRecurrence::operator==(const QOrganizerItemRecurrence &other) const
595{
596 return recurrenceRules() == other.recurrenceRules()
597 && exceptionRules() == other.exceptionRules()
598 && recurrenceDates() == other.recurrenceDates()
599 && exceptionDates() == other.exceptionDates();
600}
601
602/*!
603 \fn QOrganizerItemRecurrence::operator!=(const QOrganizerItemRecurrence &other) const
604
605 Returns true if the \a other recurrence detail is not equal to this detail; otherwise, false.
606 */
607
608/*!
609 \enum QOrganizerItemRecurrence::RecurrenceField
610
611 This enumeration defines the fields supported by QOrganizerItemRecurrence.
612 \value FieldRecurrenceRules The value stored describes the rules for when an item should recur.
613 \value FieldRecurrenceDates The value stored describes the dates for when an item should recur.
614 \value FieldExceptionRules The value stored describes the rules for when an item should not recur.
615 \value FieldExceptionDates The value stored describes the dates for when an item should not recur.
616 */
617
618/*!
619 Returns the set of recurrence dates.
620 */
621QSet<QDate> QOrganizerItemRecurrence::recurrenceDates() const
622{
623 return value(field: FieldRecurrenceDates).value<QSet<QDate> >();
624}
625
626/*!
627 Sets the set of recurrence dates to \a rdates.
628 */
629void QOrganizerItemRecurrence::setRecurrenceDates(const QSet<QDate> &rdates)
630{
631 setValue(field: FieldRecurrenceDates, value: QVariant::fromValue(value: rdates));
632}
633
634/*!
635 Returns the set of exception rules.
636 */
637QSet<QOrganizerRecurrenceRule> QOrganizerItemRecurrence::exceptionRules() const
638{
639 return value(field: FieldExceptionRules).value<QSet<QOrganizerRecurrenceRule> >();
640}
641
642/*!
643 Sets the set of exception rules to \a xrules.
644 */
645void QOrganizerItemRecurrence::setExceptionRules(const QSet<QOrganizerRecurrenceRule> &xrules)
646{
647 setValue(field: FieldExceptionRules, value: QVariant::fromValue(value: xrules));
648}
649
650/*!
651 Returns the set of recurrence rules.
652 */
653QSet<QOrganizerRecurrenceRule> QOrganizerItemRecurrence::recurrenceRules() const
654{
655 return value(field: FieldRecurrenceRules).value<QSet<QOrganizerRecurrenceRule> >();
656}
657
658/*!
659 Sets the set of recurrence rules to \a rrules.
660 */
661void QOrganizerItemRecurrence::setRecurrenceRules(const QSet<QOrganizerRecurrenceRule> &rrules)
662{
663 setValue(field: FieldRecurrenceRules, value: QVariant::fromValue(value: rrules));
664}
665
666/*!
667 Returns the set of exception dates.
668 */
669QSet<QDate> QOrganizerItemRecurrence::exceptionDates() const
670{
671 return value(field: FieldExceptionDates).value<QSet<QDate> >();
672}
673
674/*!
675 Sets the set of exception dates to \a xdates.
676 */
677void QOrganizerItemRecurrence::setExceptionDates(const QSet<QDate> &xdates)
678{
679 setValue(field: FieldExceptionDates, value: QVariant::fromValue(value: xdates));
680}
681
682
683/*!
684 \class QOrganizerItemReminder
685 \brief The QOrganizerItemReminder class contains information about when and how the user wants to reminded of the item
686 \inmodule QtOrganizer
687 \ingroup organizer-details
688
689 Note that the Organizer API does not enforce that the user is reminded of the item;
690 rather, it simply allows clients to store and manipulate data which might be used
691 by the platform to implement alarms and reminders.
692 */
693
694/*!
695 \enum QOrganizerItemReminder::ReminderType
696
697 This enumeration defines the type of the reminder.
698 \value NoReminder This reminder is entirely unobtrusive
699 \value AudibleReminder This reminder has an audible element
700 \value VisualReminder This reminder has a visual element
701 \value EmailReminder This reminder has a email element
702 */
703
704/*!
705 \enum QOrganizerItemReminder::ReminderField
706
707 This enumeration defines the fields supported by QOrganizerItemReminder.
708 \value FieldSecondsBeforeStart The value stored describes the time in seconds prior to the item's
709 start time, when the reminder should be triggered.
710 \value FieldRepetitionCount The value stored describes the number of repetitions of the reminder.
711 \value FieldRepetitionDelay The value stored describes the delays in seconds between repetitions
712 of the reminder.
713 */
714
715/*!
716 Returns the reminder type of this reminder for an organizer item.
717 */
718QOrganizerItemReminder::ReminderType QOrganizerItemReminder::reminderType() const
719{
720 if (type() == QOrganizerItemDetail::TypeAudibleReminder)
721 return QOrganizerItemReminder::AudibleReminder;
722 else if (type() == QOrganizerItemDetail::TypeEmailReminder)
723 return QOrganizerItemReminder::EmailReminder;
724 else if (type() == QOrganizerItemDetail::TypeVisualReminder)
725 return QOrganizerItemReminder::VisualReminder;
726
727 return QOrganizerItemReminder::NoReminder;
728}
729
730/*!
731 Sets the number of seconds prior to the activation of the item
732 at which the user wants to be reminded of the item to \a seconds.
733
734 The exact datetime of activation of the item depends on the type of
735 item: for a QOrganizerTodo or QOrganizerTodoOccurrence it is the
736 due date time; for a QOrganizerEvent or QOrganizerEventOccurrence
737 it is the start date time.
738
739 The value must be non-negative, and negative values will be ignored.
740 */
741void QOrganizerItemReminder::setSecondsBeforeStart(int seconds)
742{
743 if (seconds >= 0)
744 setValue(field: FieldSecondsBeforeStart, value: seconds);
745}
746
747/*!
748 Returns the number of seconds prior to the activation of the item
749 at which the user wants to be reminded of the item.
750
751 The exact datetime of activation of the item depends on the type of
752 item: for a QOrganizerTodo or QOrganizerTodoOccurrence it is the
753 due date time; for a QOrganizerEvent or QOrganizerEventOccurrence
754 it is the start date time.
755 */
756int QOrganizerItemReminder::secondsBeforeStart() const
757{
758 return value(field: FieldSecondsBeforeStart).toInt();
759}
760
761/*!
762 Returns the number of times the user should be reminded of the item.
763
764 \sa repetitionDelay()
765 */
766int QOrganizerItemReminder::repetitionCount() const
767{
768 return value(field: FieldRepetitionCount).toInt();
769}
770
771/*!
772 Returns the delay (in seconds) between each repetition of the reminder.
773
774 \sa repetitionCount()
775 */
776int QOrganizerItemReminder::repetitionDelay() const
777{
778 return value(field: FieldRepetitionDelay).toInt();
779}
780
781/*!
782 Sets the number of repetitions of the reminderto \a count, and the delay (in seconds)
783 between each repetition of the reminder to \a delaySeconds.
784
785 Both \a count and \a delaySeconds must be positive numbers, otherwise both will be ignored.
786
787 \sa repetitionCount(), repetitionDelay()
788*/
789void QOrganizerItemReminder::setRepetition(int count, int delaySeconds)
790{
791 if (count > 0 && delaySeconds >= 0) {
792 setValue(field: FieldRepetitionCount, value: count);
793 setValue(field: FieldRepetitionDelay, value: delaySeconds);
794 }
795}
796
797/*!
798 \macro Q_DECLARE_CUSTOM_ORGANIZER_REMINDER_DETAIL
799 \relates QOrganizerItemReminder
800
801 Macro for simplifying declaring custom (leaf) reminder detail classes.
802
803 The first argument is the name of the class, and the second argument
804 is a Latin-1 string literal naming the detail type, and the third argument
805 is the reminder type of the leaf reminder detail class.
806
807 If you are creating a convenience class for a type of QOrganizerItemReminder,
808 you should use this macro when declaring your class to ensure that
809 it interoperates with other organizer item functionality.
810 */
811
812
813/*!
814 \class QOrganizerItemAudibleReminder
815 \brief The QOrganizerItemAudibleReminder class contains information about an audible reminder of an item.
816 \inmodule QtOrganizer
817 \ingroup organizer-details
818
819 An audible reminder is a reminder which alerts the user about the item, with sound.
820 Note that the Organizer API does not enforce that the sound data is played,
821 or that any other sort of reminder occurs; rather, it simply allows clients
822 to store and manipulate data which might be used by the platform to
823 implement alarms and reminders.
824 */
825
826/*!
827 \enum QOrganizerItemAudibleReminder::AudibleReminderField
828
829 This enumeration defines the fields supported by QOrganizerItemAudibleReminder.
830 \value FieldDataUrl The value stored describes URL of the sound to be played when the reminder is triggered.
831 */
832
833/*!
834 Sets the url of the audible data which should be played to \a dataUrl.
835 */
836void QOrganizerItemAudibleReminder::setDataUrl(const QUrl &dataUrl)
837{
838 setValue(field: FieldDataUrl, value: dataUrl);
839}
840
841/*!
842 Returns the url of the audible data which should be played.
843 */
844QUrl QOrganizerItemAudibleReminder::dataUrl() const
845{
846 return value(field: FieldDataUrl).toUrl();
847}
848
849
850/*!
851 \class QOrganizerItemEmailReminder
852 \brief The QOrganizerItemEmailReminder class contains information about an email reminder of an item.
853 \inmodule QtOrganizer
854 \ingroup organizer-details
855
856 An email reminder is a reminder which alerts the user (or other users) about the item,
857 by sending an email.
858 Note that the Organizer API does not enforce that the email is sent,
859 or that any other sort of reminder occurs; rather, it simply allows clients
860 to store and manipulate data which might be used by the platform to
861 implement alarms and reminders.
862 */
863
864/*!
865 \enum QOrganizerItemEmailReminder::EmailReminderField
866
867 This enumeration defines the fields supported by QOrganizerItemEmailReminder.
868 \value FieldSubject The value stored describes the subject of the Email, which the user wishes to be sent as a reminder.
869 \value FieldBody The value stored describes the body of the Email, which the user wishes to be sent as a reminder.
870 \value FieldAttachments The value stored describes the attachments of the Email, which the user wishes to be sent as a reminder.
871 \value FieldRecipients The value stored describes the recipients of the Email, which the user wishes to be sent as a reminder.
872 */
873
874/*!
875 Sets the contents of the email reminder to be the given \a subject, \a body and \a attachments.
876 */
877void QOrganizerItemEmailReminder::setContents(const QString &subject, const QString &body, const QVariantList &attachments)
878{
879 setValue(field: FieldSubject, value: subject); setValue(field: FieldBody, value: body); setValue(field: FieldAttachments, value: attachments);
880}
881
882/*!
883 Returns the subject of the email.
884 */
885QString QOrganizerItemEmailReminder::subject() const
886{
887 return value(field: FieldSubject).toString();
888}
889
890/*!
891 Returns the body of the email.
892 */
893QString QOrganizerItemEmailReminder::body() const
894{
895 return value(field: FieldBody).toString();
896}
897
898/*!
899 Returns the attachments of the email.
900 */
901QVariantList QOrganizerItemEmailReminder::attachments() const
902{
903 return value(field: FieldAttachments).toList();
904}
905
906/*!
907 Sets the list of recipients that the user wishes to be sent an email as part of the reminder
908 to \a recipients.
909 */
910void QOrganizerItemEmailReminder::setRecipients(const QStringList &recipients)
911{
912 setValue(field: FieldRecipients, value: recipients);
913}
914
915/*!
916 Returns the list of recipients that the user wishes to be sent an email as part of the reminder.
917 */
918QStringList QOrganizerItemEmailReminder::recipients() const
919{
920 return value(field: FieldRecipients).toStringList();
921}
922
923
924/*!
925 \class QOrganizerItemVisualReminder
926 \brief The QOrganizerItemVisualReminder class contains information about a visual reminder of an item.
927 \inmodule QtOrganizer
928 \ingroup organizer-details
929
930 A visual reminder is a reminder which alerts the user about the item, with a message, image or video.
931 Note that the Organizer API does not enforce that the visual data is displayed,
932 or that any other sort of reminder occurs; rather, it simply allows clients
933 to store and manipulate data which might be used by the platform to
934 implement alarms and reminders.
935 */
936
937/*!
938 \enum QOrganizerItemVisualReminder::VisualReminderField
939
940 This enumeration defines the fields supported by QOrganizerItemVisualReminder.
941 \value FieldMessage The value stored describes the message to be shown when the reminder is triggered.
942 \value FieldDataUrl The value stored describes URL of the video to be played when the reminder is triggered.
943 */
944
945/*!
946 Sets the message which the user wishes to be displayed as part of the reminder to \a message.
947*/
948void QOrganizerItemVisualReminder::setMessage(const QString &message)
949{
950 setValue(field: FieldMessage, value: message);
951}
952
953/*!
954 Returns the message which the user wishes to be displayed as part of the reminder.
955*/
956QString QOrganizerItemVisualReminder::message() const
957{
958 return value(field: FieldMessage).toString();
959}
960
961/*!
962 Sets the url of the visual data which the user wishes to be displayed as part of the reminder to \a dataUrl.
963*/
964void QOrganizerItemVisualReminder::setDataUrl(const QUrl &dataUrl)
965{
966 setValue(field: FieldDataUrl, value: dataUrl);
967}
968
969/*!
970 Returns the url of the visual data which the user wishes to be displayed as part of the reminder.
971*/
972QUrl QOrganizerItemVisualReminder::dataUrl() const
973{
974 return value(field: FieldDataUrl).toUrl();
975}
976
977
978/*!
979 \class QOrganizerItemTag
980 \brief The QOrganizerItemTag class contains some arbitrary tag which is relevant to the organizer item.
981 \inmodule QtOrganizer
982 \ingroup organizer-details
983 */
984
985/*!
986 \enum QOrganizerItemTag::TagField
987
988 This enumeration defines the fields supported by QOrganizerItemTag.
989 \value FieldTag The value stored is a tag of the item.
990 */
991
992/*!
993 Sets a tag associated with an organizer item to \a tag.
994 */
995void QOrganizerItemTag::setTag(const QString &tag)
996{
997 setValue(field: FieldTag, value: tag);
998}
999
1000/*!
1001 Returns the tag associated with an organizer item which is stored in this detail.
1002 */
1003QString QOrganizerItemTag::tag() const
1004{
1005 return value(field: FieldTag).toString();
1006}
1007
1008
1009/*!
1010 \class QOrganizerItemTimestamp
1011 \brief The QOrganizerItemTimestamp class contains the creation and last-modified timestamp associated with the organizer item.
1012 \inmodule QtOrganizer
1013 \ingroup organizer-details
1014 */
1015
1016/*!
1017 \enum QOrganizerItemTimestamp::TimestampField
1018
1019 This enumeration defines the fields supported by QOrganizerItemTimestamp.
1020 \value FieldCreated The value stored describes the time the item is created.
1021 \value FieldLastModified The value stored describes the last time the item is modified.
1022 */
1023
1024/*!
1025 Returns the creation timestamp saved in this detail.
1026 */
1027QDateTime QOrganizerItemTimestamp::created() const
1028{
1029 return value(field: FieldCreated).toDateTime();
1030}
1031
1032/*!
1033 Returns the last-modified timestamp saved in this detail.
1034 */
1035QDateTime QOrganizerItemTimestamp::lastModified() const
1036{
1037 return value(field: FieldLastModified).toDateTime();
1038}
1039
1040/*!
1041 Sets the creation timestamp saved in this detail to \a timestamp.
1042 */
1043void QOrganizerItemTimestamp::setCreated(const QDateTime &timestamp)
1044{
1045 setValue(field: FieldCreated, value: timestamp);
1046}
1047
1048/*!
1049 Sets the last-modified timestamp saved in this detail to \a timestamp.
1050 */
1051void QOrganizerItemTimestamp::setLastModified(const QDateTime &timestamp)
1052{
1053 setValue(field: FieldLastModified, value: timestamp);
1054}
1055
1056
1057/*!
1058 \class QOrganizerTodoProgress
1059 \brief The QOrganizerTodoProgress class contains information about the progress of a todo item.
1060 \inmodule QtOrganizer
1061 \ingroup organizer-details
1062 */
1063
1064/*!
1065 \enum QOrganizerTodoProgress::TodoProgressField
1066
1067 This enumeration defines the fields supported by QOrganizerTodoProgress.
1068 \value FieldStatus The value stored describes the status of the TODO item.
1069 \value FieldPercentageComplete The value stored describes the current completion percentage of the TODO item.
1070 \value FieldFinishedDateTime The value stored describes the date time at which this TODO item is finished.
1071 */
1072
1073/*!
1074 \enum QOrganizerTodoProgress::Status
1075 Enumerates the various possible types of todo item status
1076 \value StatusNotStarted The todo item hasn't been started yet
1077 \value StatusInProgress The todo item is current in progress
1078 \value StatusComplete The todo item has finished
1079 */
1080
1081/*!
1082 Returns the todo progress item's current status as QOrganizerTodoProgress::Status.
1083 */
1084QOrganizerTodoProgress::Status QOrganizerTodoProgress::status() const
1085{
1086 return static_cast<Status>(value(field: FieldStatus).toInt());
1087}
1088
1089/*!
1090 Sets the todo progress item's current status to \a status.
1091 */
1092void QOrganizerTodoProgress::setStatus(Status status)
1093{
1094 setValue(field: FieldStatus, value: status);
1095}
1096
1097/*!
1098 Returns the todo progress item's finished date and timeas QDateTime.
1099 */
1100QDateTime QOrganizerTodoProgress::finishedDateTime() const
1101{
1102 return value(field: FieldFinishedDateTime).toDateTime();
1103}
1104
1105/*!
1106 Sets the todo progress item's finished date and time to \a finishedDateTime.
1107 */
1108void QOrganizerTodoProgress::setFinishedDateTime(const QDateTime &finishedDateTime)
1109{
1110 setValue(field: FieldFinishedDateTime, value: finishedDateTime);
1111}
1112
1113/*!
1114 Returns the todo progress item's completion percentage.
1115 */
1116int QOrganizerTodoProgress::percentageComplete() const
1117{
1118 return value(field: FieldPercentageComplete).toInt();
1119}
1120
1121/*!
1122 Sets the todo progress item's completion percentage to \a percentage. The \a percentage must
1123 be between 0 and 100, and values out of the range will be ignored.
1124 */
1125void QOrganizerTodoProgress::setPercentageComplete(int percentage)
1126{
1127 if (percentage >=0 && percentage <= 100)
1128 setValue(field: FieldPercentageComplete, value: percentage);
1129}
1130
1131
1132/*!
1133 \class QOrganizerTodoTime
1134 \brief The QOrganizerTodoTime class contains information about the time range of a todo item.
1135 \inmodule QtOrganizer
1136 \ingroup organizer-details
1137 */
1138
1139/*!
1140 \enum QOrganizerTodoTime::TodoTimeField
1141
1142 This enumeration defines the fields supported by QOrganizerTodoTime.
1143 \value FieldStartDateTime The value stored describes the time when the TODO item should be started.
1144 \value FieldDueDateTime The value stored describes the time when the TODO item should be finished.
1145 \value FieldAllDay The value stored describes if it is an all day TODO item.
1146 */
1147
1148/*!
1149 Returns the todo time's start date and time as QDateTime.
1150 For all-day tasks, the time part is meaningless.
1151 */
1152QDateTime QOrganizerTodoTime::startDateTime() const
1153{
1154 return value(field: FieldStartDateTime).toDateTime();
1155}
1156
1157/*!
1158 Sets the todo time's start date and time to \a startDateTime.
1159 For all-day tasks, the time part can be set to any valid value.
1160 */
1161void QOrganizerTodoTime::setStartDateTime(const QDateTime &startDateTime)
1162{
1163 setValue(field: FieldStartDateTime, value: startDateTime);
1164}
1165
1166/*!
1167 Returns the todo time's due date and time as QDateTime.
1168 For all-day tasks, the time part is meaningless.
1169 */
1170QDateTime QOrganizerTodoTime::dueDateTime() const
1171{
1172 return value(field: FieldDueDateTime).toDateTime();
1173}
1174
1175/*!
1176 Sets the todo time's due date and time to \a dueDateTime.
1177 For all-day tasks, the time part can be set to any valid value.
1178 */
1179void QOrganizerTodoTime::setDueDateTime(const QDateTime &dueDateTime)
1180{
1181 setValue(field: FieldDueDateTime, value: dueDateTime);
1182}
1183
1184/*!
1185 Sets the all-day status of the TODO to \a isAllDay.
1186 If the tasks is an all-day TODO, no time is considered to be
1187 specified for the todo, even if the start date time set
1188 for the todo has a time component.
1189 */
1190void QOrganizerTodoTime::setAllDay(bool isAllDay)
1191{
1192 setValue(field: FieldAllDay, value: isAllDay);
1193}
1194
1195/*!
1196 Returns true if the todo is an all-day TODO, or false otherwise.
1197 */
1198bool QOrganizerTodoTime::isAllDay() const
1199{
1200 return value(field: FieldAllDay).toBool();
1201}
1202
1203
1204/*!
1205 \class QOrganizerItemType
1206 \brief The QOrganizerItemType class describes the type of the organizer item.
1207 \inmodule QtOrganizer
1208 \ingroup organizer-details
1209 */
1210
1211/*!
1212 \enum QOrganizerItemType::ItemType
1213
1214 This enumeration describes the type of the organizer item.
1215
1216 \value TypeUndefined This item is of an unknown type.
1217 \value TypeEvent This item is an event.
1218 \value TypeEventOccurrence This item is an event occurrence.
1219 \value TypeTodo This item is a TODO.
1220 \value TypeTodoOccurrence This item is a TODO occurrence.
1221 \value TypeJournal This item is a journal.
1222 \value TypeNote This item is a note.
1223 */
1224
1225/*!
1226 \enum QOrganizerItemType::ItemTypeField
1227
1228 This enumeration defines the fields supported by QOrganizerItemType.
1229 \value FieldType The value stored describes the type of the item.
1230 */
1231
1232/*!
1233 Returns the organizer item type value stored in this detail.
1234 */
1235QOrganizerItemType::ItemType QOrganizerItemType::type() const
1236{
1237 return static_cast<ItemType>(value(field: FieldType).toInt());
1238}
1239
1240/*!
1241 Sets the type of the organizer item to be the give \a type.
1242 */
1243void QOrganizerItemType::setType(QOrganizerItemType::ItemType type)
1244{
1245 setValue(field: FieldType, value: type);
1246}
1247
1248
1249/*!
1250 \class QOrganizerEventRsvp
1251 \brief The QOrganizerEventRsvp class contains RSVP information for an event, applicable to the user of the calendar
1252 \inmodule QtOrganizer
1253 \ingroup organizer-details
1254
1255 RSVP detail contain information such as the role of the calendar user in the event,
1256 the participation status of the calendar user in the event, the date by which the
1257 user is requested to respond to the invitation, the date at which the user did
1258 respond to the invitation, the name of the organizer of the event, and the contact
1259 details of the organizer of the event.
1260 */
1261
1262/*!
1263 \enum QOrganizerEventRsvp::EventRsvpField
1264
1265 This enumeration defines the fields supported by QOrganizerEventRsvp.
1266 \value FieldParticipationStatus The value stored describes the pariticipation status of the user for this event.
1267 \value FieldParticipationRole The value stored describes the pariticipation role of the user for this event.
1268 \value FieldResponseRequirement The value stored describes the if the user is required to respond this event invitation.
1269 \value FieldResponseDeadline The value stored describes when the user should respond to this event invitation.
1270 \value FieldResponseDate The value stored describes when the user responds to this event invitation.
1271 \value FieldOrganizerName The value stored describes the organizer's name of this event.
1272 \value FieldOrganizerEmail The value stored describes the organizer's Email of this event.
1273 */
1274
1275/*!
1276 Sets the participation status of the user of the calendar in the event to \a status.
1277 */
1278void QOrganizerEventRsvp::setParticipationStatus(QOrganizerEventAttendee::ParticipationStatus status)
1279{
1280 setValue(field: FieldParticipationStatus, value: status);
1281}
1282
1283/*!
1284 Returns the participation status of the user of the calendar in the event.
1285 */
1286QOrganizerEventAttendee::ParticipationStatus QOrganizerEventRsvp::participationStatus() const
1287{
1288 return static_cast<QOrganizerEventAttendee::ParticipationStatus>(value(field: FieldParticipationStatus).toInt());
1289}
1290
1291/*!
1292 Sets the role of the user of the calendar in the event to \a role.
1293 */
1294void QOrganizerEventRsvp::setParticipationRole(QOrganizerEventAttendee::ParticipationRole role)
1295{
1296 setValue(field: FieldParticipationRole, value: role);
1297}
1298
1299/*!
1300 Returns the participation role of the user of the calendar in the event.
1301 */
1302QOrganizerEventAttendee::ParticipationRole QOrganizerEventRsvp::participationRole() const
1303{
1304 return static_cast<QOrganizerEventAttendee::ParticipationRole>(value(field: FieldParticipationRole).toInt());
1305}
1306
1307/*!
1308 \enum QOrganizerEventRsvp::ResponseRequirement
1309 \value ResponseNotRequired The organizer does not require the calendar user to respond to the invitation
1310 \value ResponseRequired The organizer requires the calendar user to respond to the invitation
1311*/
1312
1313/*!
1314 Sets the response requirement for the invitation to \a responseRequirement.
1315 */
1316void QOrganizerEventRsvp::setResponseRequirement(ResponseRequirement responseRequirement)
1317{
1318 setValue(field: FieldResponseRequirement, value: responseRequirement);
1319}
1320
1321/*!
1322 Returns the response requirement of the invitation.
1323 */
1324QOrganizerEventRsvp::ResponseRequirement QOrganizerEventRsvp::responseRequirement() const
1325{
1326 return static_cast<ResponseRequirement>(value(field: FieldResponseRequirement).toInt());
1327}
1328
1329/*!
1330 Sets the date by which the user was requested to have responded to the invitation to the event to \a date.
1331 */
1332void QOrganizerEventRsvp::setResponseDeadline(const QDate &date)
1333{
1334 setValue(field: FieldResponseDeadline, value: date);
1335}
1336
1337/*!
1338 Returns the date by which the user was requested to have responded to the invitation to the event.
1339 */
1340QDate QOrganizerEventRsvp::responseDeadline() const
1341{
1342 return value(field: FieldResponseDeadline).toDate();
1343}
1344
1345/*!
1346 Sets the date at which the user responded to the invitation to the event to \a date.
1347 */
1348void QOrganizerEventRsvp::setResponseDate(const QDate &date)
1349{
1350 setValue(field: FieldResponseDate, value: date);
1351}
1352
1353/*!
1354 Returns the date at which user responded to the invitation to the event.
1355 */
1356QDate QOrganizerEventRsvp::responseDate() const
1357{
1358 return value(field: FieldResponseDate).toDate();
1359}
1360
1361/*!
1362 Sets the name of the organizer of the event (who sent the invitation) to \a name.
1363 */
1364void QOrganizerEventRsvp::setOrganizerName(const QString &name)
1365{
1366 setValue(field: FieldOrganizerName, value: name);
1367}
1368
1369/*!
1370 Returns the name of the organizer of the event.
1371 */
1372QString QOrganizerEventRsvp::organizerName() const
1373{
1374 return value(field: FieldOrganizerName).toString();
1375}
1376
1377/*!
1378 Sets the email address of the organizer of the event (who sent the invitation) to \a email.
1379 */
1380void QOrganizerEventRsvp::setOrganizerEmail(const QString &email)
1381{
1382 setValue(field: FieldOrganizerEmail, value: email);
1383}
1384
1385/*!
1386 Returns the email address of the organizer of the event.
1387 */
1388QString QOrganizerEventRsvp::organizerEmail() const
1389{
1390 return value(field: FieldOrganizerEmail).toString();
1391}
1392
1393/*!
1394 \class QOrganizerItemClassification
1395 \brief The QOrganizerItemClassification class is for defining the classification of an organizer item.
1396 \inmodule QtOrganizer
1397 \ingroup organizer-details
1398
1399 This can be used as a part of security model for the organizer.
1400 */
1401
1402/*!
1403 \enum QOrganizerItemClassification::ClassificationField
1404
1405 This enumeration defines the fields supported by QOrganizerItemClassification.
1406 \value FieldClassification The value stored describes the classification of an item.
1407 */
1408
1409/*!
1410 \enum QOrganizerItemClassification::AccessClassification
1411 \value AccessPublic The item can be accessed by everybody
1412 \value AccessConfidential The access to the item is restricted
1413 \value AccessPrivate Only private access allowed for the item
1414*/
1415
1416/*!
1417 Sets the classification of the item \a classification.
1418 */
1419void QOrganizerItemClassification::setClassification(AccessClassification classification)
1420{
1421 setValue(field: FieldClassification, value: classification);
1422}
1423
1424/*!
1425 Returns classification of the item.
1426 */
1427QOrganizerItemClassification::AccessClassification QOrganizerItemClassification::classification() const
1428{
1429 return static_cast<AccessClassification>(value(field: FieldClassification).toInt());
1430}
1431
1432/*!
1433 \class QOrganizerItemExtendedDetail
1434 \brief The QOrganizerItemExtendedDetail class provides the possibility to save extended details to the organizer item.
1435 \inmodule QtOrganizer
1436 \ingroup organizer-details
1437
1438 Different back-end engines may or may not support extended details for different item types. Even
1439 if supported, they may accept different QVariant types as the data.
1440 */
1441
1442/*!
1443 \enum QOrganizerItemExtendedDetail::ExtendedDetailField
1444
1445 This enumeration defines the fields supported by QOrganizerItemExtendedDetail.
1446 \value FieldName The value stored describes the name of this extended detail.
1447 \value FieldData The value stored describes the data stored in this extended detail.
1448 */
1449
1450/*!
1451 Sets the \a name of this extended detail.
1452 */
1453void QOrganizerItemExtendedDetail::setName(const QString &name)
1454{
1455 setValue(field: FieldName, value: name);
1456}
1457
1458/*!
1459 Gets the name of this extended detail.
1460 */
1461QString QOrganizerItemExtendedDetail::name() const
1462{
1463 return value(field: FieldName).toString();
1464}
1465
1466/*!
1467 Sets the \a data of the extended detail.
1468 */
1469void QOrganizerItemExtendedDetail::setData(const QVariant &data)
1470{
1471 setValue(field: FieldData, value: data);
1472}
1473
1474/*!
1475 Gets the data of this extended detail.
1476 */
1477QVariant QOrganizerItemExtendedDetail::data() const
1478{
1479 return value(field: FieldData);
1480}
1481
1482/*!
1483 \class QOrganizerItemVersion
1484 \brief The QOrganizerItemVersion class provides the versioning information of an organizer item.
1485 \inmodule QtOrganizer
1486 \ingroup organizer-details
1487 */
1488
1489/*!
1490 \enum QOrganizerItemVersion::VersionField
1491
1492 This enumeration defines the fields supported by QOrganizerItemVersion.
1493 \value FieldVersion The value stored describes the integer version of an organizer item.
1494 It can be used as the sequence number as per iCalendar spec.
1495 \value FieldExtendedVersion The value stored describes the extended version of an organizer item.
1496 It can be used to represent the version stored in the back-end.
1497 */
1498
1499/*!
1500 Sets the integer \a version. The \a version must be a positive number, otherwise ignored.
1501 */
1502void QOrganizerItemVersion::setVersion(int version)
1503{
1504 if (version > 0)
1505 setValue(field: FieldVersion, value: version);
1506}
1507
1508/*!
1509 Gets the integer version.
1510 */
1511int QOrganizerItemVersion::version() const
1512{
1513 return value(field: FieldVersion).toInt();
1514}
1515
1516/*!
1517 Sets the \a extendedVersion.
1518 */
1519void QOrganizerItemVersion::setExtendedVersion(const QByteArray &extendedVersion)
1520{
1521 setValue(field: FieldExtendedVersion, value: extendedVersion);
1522}
1523
1524/*!
1525 Gets the extended version.
1526 */
1527QByteArray QOrganizerItemVersion::extendedVersion() const
1528{
1529 return value(field: FieldExtendedVersion).toByteArray();
1530}
1531
1532QT_END_NAMESPACE_ORGANIZER
1533

source code of qtpim/src/organizer/details/qorganizeritemdetails.cpp