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#ifndef QDECLARATIVEORGANIZERITEMDETAIL_H
35#define QDECLARATIVEORGANIZERITEMDETAIL_H
36
37#include <QtQml/qqml.h>
38
39#include <QtOrganizer/qorganizeritemdetails.h>
40
41#include "qdeclarativeorganizerrecurrencerule_p.h"
42
43QTORGANIZER_USE_NAMESPACE
44
45QT_BEGIN_NAMESPACE
46
47class QDeclarativeOrganizerItemDetail : public QObject
48{
49 Q_OBJECT
50
51 Q_ENUMS(DetailType)
52
53 Q_PROPERTY(DetailType type READ type)
54
55public:
56 enum DetailType {
57 Undefined = QOrganizerItemDetail::TypeUndefined,
58 Classification = QOrganizerItemDetail::TypeClassification,
59 Comment = QOrganizerItemDetail::TypeComment,
60 Description = QOrganizerItemDetail::TypeDescription,
61 DisplayLabel = QOrganizerItemDetail::TypeDisplayLabel,
62 ItemType = QOrganizerItemDetail::TypeItemType,
63 Guid = QOrganizerItemDetail::TypeGuid,
64 Location = QOrganizerItemDetail::TypeLocation,
65 Parent = QOrganizerItemDetail::TypeParent,
66 Priority = QOrganizerItemDetail::TypePriority,
67 Recurrence = QOrganizerItemDetail::TypeRecurrence,
68 Tag = QOrganizerItemDetail::TypeTag,
69 Timestamp = QOrganizerItemDetail::TypeTimestamp,
70 Version = QOrganizerItemDetail::TypeVersion,
71 Reminder = QOrganizerItemDetail::TypeReminder,
72 AudibleReminder = QOrganizerItemDetail::TypeAudibleReminder,
73 EmailReminder = QOrganizerItemDetail::TypeEmailReminder,
74 VisualReminder = QOrganizerItemDetail::TypeVisualReminder,
75 ExtendedDetail = QOrganizerItemDetail::TypeExtendedDetail,
76 EventAttendee = QOrganizerItemDetail::TypeEventAttendee,
77 EventRsvp = QOrganizerItemDetail::TypeEventRsvp,
78 EventTime = QOrganizerItemDetail::TypeEventTime,
79 JournalTime = QOrganizerItemDetail::TypeJournalTime,
80 TodoTime = QOrganizerItemDetail::TypeTodoTime,
81 TodoProgress = QOrganizerItemDetail::TypeTodoProgress
82 };
83
84 explicit QDeclarativeOrganizerItemDetail(QObject *parent = Q_NULLPTR);
85 ~QDeclarativeOrganizerItemDetail();
86
87 virtual DetailType type() const;
88
89 // QML functions
90 Q_INVOKABLE virtual QVariant value(int key) const;
91 Q_INVOKABLE virtual bool setValue(int key, const QVariant& value);
92 Q_INVOKABLE bool removeValue(int key);
93
94 // non-QML APIs
95 QOrganizerItemDetail detail() const;
96 void setDetail(const QOrganizerItemDetail &detail);
97
98Q_SIGNALS:
99 void detailChanged();
100
101protected:
102 QOrganizerItemDetail m_detail;
103
104private:
105 Q_DISABLE_COPY(QDeclarativeOrganizerItemDetail)
106};
107
108
109class QDeclarativeOrganizerEventTime : public QDeclarativeOrganizerItemDetail
110{
111 Q_OBJECT
112
113 Q_ENUMS(EventTimeField)
114
115 Q_PROPERTY(bool allDay READ isAllDay WRITE setAllDay NOTIFY valueChanged)
116 Q_PROPERTY(QDateTime startDateTime READ startDateTime WRITE setStartDateTime NOTIFY valueChanged)
117 Q_PROPERTY(QDateTime endDateTime READ endDateTime WRITE setEndDateTime NOTIFY valueChanged)
118
119public:
120 enum EventTimeField {
121 FieldStartDateTime = QOrganizerEventTime::FieldStartDateTime,
122 FieldEndDateTime = QOrganizerEventTime::FieldEndDateTime,
123 FieldAllDay = QOrganizerEventTime::FieldAllDay
124 };
125
126 QDeclarativeOrganizerEventTime(QObject *parent = Q_NULLPTR);
127
128 virtual DetailType type() const;
129
130 void setAllDay(bool isAllDay);
131 bool isAllDay();
132
133 void setStartDateTime(const QDateTime &datetime);
134 QDateTime startDateTime() const;
135
136 void setEndDateTime(const QDateTime &datetime);
137 QDateTime endDateTime() const;
138
139Q_SIGNALS:
140 void valueChanged();
141};
142
143
144class QDeclarativeOrganizerItemComment : public QDeclarativeOrganizerItemDetail
145{
146 Q_OBJECT
147
148 Q_ENUMS(CommentField)
149
150 Q_PROPERTY(QString comment READ comment WRITE setComment NOTIFY valueChanged)
151
152public:
153 enum CommentField {
154 FieldComment = QOrganizerItemComment::FieldComment
155 };
156
157 QDeclarativeOrganizerItemComment(QObject *parent = Q_NULLPTR);
158
159 virtual DetailType type() const;
160
161 void setComment(const QString &newComment);
162 QString comment() const;
163
164Q_SIGNALS:
165 void valueChanged();
166};
167
168
169class QDeclarativeOrganizerItemDescription : public QDeclarativeOrganizerItemDetail
170{
171 Q_OBJECT
172
173 Q_ENUMS(DescriptionField)
174
175 Q_PROPERTY(QString description READ description WRITE setDescription NOTIFY valueChanged)
176
177public:
178 enum DescriptionField {
179 FieldDescription = QOrganizerItemDescription::FieldDescription
180 };
181
182 QDeclarativeOrganizerItemDescription(QObject *parent = Q_NULLPTR);
183
184 virtual DetailType type() const;
185
186 void setDescription(const QString &desc);
187 QString description() const;
188
189Q_SIGNALS:
190 void valueChanged();
191};
192
193
194class QDeclarativeOrganizerItemDisplayLabel : public QDeclarativeOrganizerItemDetail
195{
196 Q_OBJECT
197
198 Q_ENUMS(DisplayLabelField)
199
200 Q_PROPERTY(QString label READ label WRITE setLabel NOTIFY valueChanged)
201
202public:
203 enum DisplayLabelField {
204 FieldLabel = QOrganizerItemDisplayLabel::FieldLabel
205 };
206
207 QDeclarativeOrganizerItemDisplayLabel(QObject *parent = Q_NULLPTR);
208
209 virtual DetailType type() const;
210
211 void setLabel(const QString &newLabel);
212 QString label() const;
213
214Q_SIGNALS:
215 void valueChanged();
216};
217
218
219class QDeclarativeOrganizerItemGuid : public QDeclarativeOrganizerItemDetail
220{
221 Q_OBJECT
222
223 Q_ENUMS(GuidField)
224
225 Q_PROPERTY(QString guid READ guid WRITE setGuid NOTIFY valueChanged)
226
227public:
228 enum GuidField {
229 FieldGuid = QOrganizerItemGuid::FieldGuid
230 };
231
232 QDeclarativeOrganizerItemGuid(QObject *parent = Q_NULLPTR);
233
234 virtual DetailType type() const;
235
236 void setGuid(const QString &newGuid);
237 QString guid() const;
238
239Q_SIGNALS:
240 void valueChanged();
241};
242
243
244class QDeclarativeOrganizerItemLocation : public QDeclarativeOrganizerItemDetail
245{
246 Q_OBJECT
247
248 Q_ENUMS(LocationField)
249
250 Q_PROPERTY(double latitude READ latitude WRITE setLatitude NOTIFY valueChanged)
251 Q_PROPERTY(double longitude READ longitude WRITE setLongitude NOTIFY valueChanged)
252 Q_PROPERTY(QString label READ label WRITE setLabel NOTIFY valueChanged)
253
254public:
255 enum LocationField {
256 FieldLabel = QOrganizerItemLocation::FieldLabel,
257 FieldLatitude = QOrganizerItemLocation::FieldLatitude,
258 FieldLongitude = QOrganizerItemLocation::FieldLongitude
259 };
260
261 QDeclarativeOrganizerItemLocation(QObject *parent = Q_NULLPTR);
262
263 virtual DetailType type() const;
264
265 void setLatitude(double newLatitude);
266 double latitude() const;
267
268 void setLongitude(double newLongitude);
269 double longitude() const;
270
271 void setLabel(const QString &newLabel);
272 QString label() const;
273
274Q_SIGNALS:
275 void valueChanged();
276};
277
278
279class QDeclarativeOrganizerItemParent : public QDeclarativeOrganizerItemDetail
280{
281 Q_OBJECT
282
283 Q_ENUMS(ParentField)
284
285 Q_PROPERTY(QDateTime originalDate READ originalDate WRITE setOriginalDate NOTIFY valueChanged)
286 Q_PROPERTY(QString parentId READ parentId WRITE setParentId NOTIFY valueChanged)
287
288public:
289 enum ParentField {
290 FieldParentId = QOrganizerItemParent::FieldParentId,
291 FieldOriginalDate = QOrganizerItemParent::FieldOriginalDate
292 };
293
294 QDeclarativeOrganizerItemParent(QObject *parent = Q_NULLPTR);
295
296 virtual DetailType type() const;
297 virtual QVariant value(int field) const;
298 virtual bool setValue(int key, const QVariant& value);
299
300 void setOriginalDate(const QDateTime &date);
301 QDateTime originalDate() const;
302
303 void setParentId(const QString &newParentId);
304 QString parentId() const;
305
306Q_SIGNALS:
307 void valueChanged();
308};
309
310
311class QDeclarativeOrganizerItemPriority : public QDeclarativeOrganizerItemDetail
312{
313 Q_OBJECT
314
315 Q_ENUMS(PriorityField)
316 Q_ENUMS(Priority)
317
318 Q_PROPERTY(Priority priority READ priority WRITE setPriority NOTIFY valueChanged)
319
320public:
321 enum PriorityField {
322 FieldPriority = QOrganizerItemPriority::FieldPriority
323 };
324
325 enum Priority {
326 Unknown = QOrganizerItemPriority::UnknownPriority,
327 Highest = QOrganizerItemPriority::HighestPriority,
328 ExtremelyHigh = QOrganizerItemPriority::ExtremelyHighPriority,
329 VeryHigh = QOrganizerItemPriority::VeryHighPriority,
330 High = QOrganizerItemPriority::HighPriority,
331 Medium = QOrganizerItemPriority::MediumPriority,
332 Low = QOrganizerItemPriority::LowPriority,
333 VeryLow = QOrganizerItemPriority::VeryLowPriority,
334 ExtremelyLow = QOrganizerItemPriority::ExtremelyLowPriority,
335 Lowest = QOrganizerItemPriority::LowestPriority
336 };
337
338 QDeclarativeOrganizerItemPriority(QObject *parent = Q_NULLPTR);
339
340 virtual DetailType type() const;
341
342 void setPriority(Priority newPriority);
343 Priority priority() const;
344
345Q_SIGNALS:
346 void valueChanged();
347};
348
349
350class QDeclarativeOrganizerItemRecurrence : public QDeclarativeOrganizerItemDetail
351{
352 Q_OBJECT
353
354 Q_ENUMS(RecurrenceField)
355
356 Q_PROPERTY(QQmlListProperty<QDeclarativeOrganizerRecurrenceRule> recurrenceRules READ recurrenceRules NOTIFY recurrenceRulesChanged)
357 Q_PROPERTY(QQmlListProperty<QDeclarativeOrganizerRecurrenceRule> exceptionRules READ exceptionRules NOTIFY exceptionRulesChanged)
358 Q_PROPERTY(QVariantList recurrenceDates READ recurrenceDates WRITE setRecurrenceDates NOTIFY valueChanged)
359 Q_PROPERTY(QVariantList exceptionDates READ exceptionDates WRITE setExceptionDates NOTIFY valueChanged)
360
361public:
362 enum RecurrenceField {
363 FieldRecurrenceRules = QOrganizerItemRecurrence::FieldRecurrenceRules,
364 FieldExceptionRules = QOrganizerItemRecurrence::FieldExceptionRules,
365 FieldRecurrenceDates = QOrganizerItemRecurrence::FieldRecurrenceDates,
366 FieldExceptionDates = QOrganizerItemRecurrence::FieldExceptionDates
367 };
368
369 QDeclarativeOrganizerItemRecurrence(QObject *parent = Q_NULLPTR);
370
371 virtual DetailType type() const;
372 virtual QVariant value(int field) const;
373 virtual bool setValue(int key, const QVariant& value);
374
375 QQmlListProperty<QDeclarativeOrganizerRecurrenceRule> recurrenceRules();
376 QQmlListProperty<QDeclarativeOrganizerRecurrenceRule> exceptionRules();
377
378 void setRecurrenceDates(const QVariantList &dates);
379 QVariantList recurrenceDates() const;
380
381 void setExceptionDates(const QVariantList &dates);
382 QVariantList exceptionDates() const;
383
384Q_SIGNALS:
385 void recurrenceRulesChanged();
386 void exceptionRulesChanged();
387 void valueChanged();
388
389private Q_SLOTS:
390 void _saveRecurrenceRules();
391 void _saveExceptionRules();
392
393private:
394 static void rrule_append(QQmlListProperty<QDeclarativeOrganizerRecurrenceRule> *p, QDeclarativeOrganizerRecurrenceRule *item);
395 static void xrule_append(QQmlListProperty<QDeclarativeOrganizerRecurrenceRule> *p, QDeclarativeOrganizerRecurrenceRule *item);
396 static int rule_count(QQmlListProperty<QDeclarativeOrganizerRecurrenceRule> *p);
397 static QDeclarativeOrganizerRecurrenceRule *rule_at(QQmlListProperty<QDeclarativeOrganizerRecurrenceRule> *p, int idx);
398 static void rrule_clear(QQmlListProperty<QDeclarativeOrganizerRecurrenceRule> *p);
399 static void xrule_clear(QQmlListProperty<QDeclarativeOrganizerRecurrenceRule> *p);
400
401 QList<QDeclarativeOrganizerRecurrenceRule*> m_recurrenceRules;
402 QList<QDeclarativeOrganizerRecurrenceRule*> m_exceptionRules;
403};
404
405
406class QDeclarativeOrganizerItemTag : public QDeclarativeOrganizerItemDetail
407{
408 Q_OBJECT
409
410 Q_ENUMS(TagField)
411
412 Q_PROPERTY(QString tag READ tag WRITE setTag NOTIFY valueChanged)
413
414public:
415 enum TagField {
416 FieldTag = QOrganizerItemTag::FieldTag
417 };
418
419 QDeclarativeOrganizerItemTag(QObject *parent = Q_NULLPTR);
420
421 virtual DetailType type() const;
422
423 void setTag(const QString &newTag);
424 QString tag() const;
425
426Q_SIGNALS:
427 void valueChanged();
428};
429
430
431class QDeclarativeOrganizerItemTimestamp : public QDeclarativeOrganizerItemDetail
432{
433 Q_OBJECT
434
435 Q_ENUMS(TimestampField)
436
437 Q_PROPERTY(QDateTime created READ created WRITE setCreated NOTIFY valueChanged)
438 Q_PROPERTY(QDateTime lastModified READ lastModified WRITE setLastModified NOTIFY valueChanged)
439
440public:
441 enum TimestampField {
442 FieldCreated = QOrganizerItemTimestamp::FieldCreated,
443 FieldLastModified = QOrganizerItemTimestamp::FieldLastModified
444 };
445
446 QDeclarativeOrganizerItemTimestamp(QObject *parent = Q_NULLPTR);
447
448 virtual DetailType type() const;
449
450 void setCreated(const QDateTime &timestamp);
451 QDateTime created() const;
452
453 void setLastModified(const QDateTime &timestamp);
454 QDateTime lastModified() const;
455
456Q_SIGNALS:
457 void valueChanged();
458};
459
460
461class QDeclarativeOrganizerItemType : public QDeclarativeOrganizerItemDetail
462{
463 Q_OBJECT
464
465 Q_ENUMS(ItemTypeField)
466 Q_ENUMS(ItemType)
467
468 Q_PROPERTY(ItemType itemType READ itemType WRITE setItemType NOTIFY valueChanged)
469
470public:
471 enum ItemTypeField {
472 FieldType = QOrganizerItemType::FieldType
473 };
474
475 enum ItemType {
476 Undefined = QOrganizerItemType::TypeUndefined,
477 Event = QOrganizerItemType::TypeEvent,
478 EventOccurrence = QOrganizerItemType::TypeEventOccurrence,
479 Todo = QOrganizerItemType::TypeTodo,
480 TodoOccurrence = QOrganizerItemType::TypeTodoOccurrence,
481 Journal = QOrganizerItemType::TypeJournal,
482 Note = QOrganizerItemType::TypeNote
483 };
484
485 QDeclarativeOrganizerItemType(QObject *parent = Q_NULLPTR);
486
487 virtual DetailType type() const;
488
489 void setItemType(ItemType newType);
490 ItemType itemType() const;
491
492Q_SIGNALS:
493 void valueChanged();
494};
495
496
497class QDeclarativeOrganizerJournalTime : public QDeclarativeOrganizerItemDetail
498{
499 Q_OBJECT
500
501 Q_ENUMS(JournalTimeField)
502
503 Q_PROPERTY(QDateTime entryDateTime READ entryDateTime WRITE setEntryDateTime NOTIFY valueChanged)
504
505public:
506 enum JournalTimeField {
507 FieldEntryDateTime = QOrganizerJournalTime::FieldEntryDateTime
508 };
509
510 QDeclarativeOrganizerJournalTime(QObject *parent = Q_NULLPTR);
511
512 virtual DetailType type() const;
513
514 void setEntryDateTime(const QDateTime &datetime);
515 QDateTime entryDateTime() const;
516
517Q_SIGNALS:
518 void valueChanged();
519};
520
521
522class QDeclarativeOrganizerTodoProgress : public QDeclarativeOrganizerItemDetail
523{
524 Q_OBJECT
525
526 Q_ENUMS(TodoProgressField)
527 Q_ENUMS(StatusType)
528
529 Q_PROPERTY(int percentageComplete READ percentageComplete WRITE setPercentageComplete NOTIFY valueChanged)
530 Q_PROPERTY(QDateTime finishedDateTime READ finishedDateTime WRITE setFinishedDateTime NOTIFY valueChanged)
531 Q_PROPERTY(StatusType status READ status WRITE setStatus NOTIFY valueChanged)
532
533public:
534 enum TodoProgressField {
535 FieldStatus = QOrganizerTodoProgress::FieldStatus,
536 FieldPercentageComplete = QOrganizerTodoProgress::FieldPercentageComplete,
537 FieldFinishedDateTime = QOrganizerTodoProgress::FieldFinishedDateTime
538 };
539
540 enum StatusType {
541 NotStarted = QOrganizerTodoProgress::StatusNotStarted,
542 InProgress = QOrganizerTodoProgress::StatusInProgress,
543 Complete = QOrganizerTodoProgress::StatusComplete
544 };
545
546 QDeclarativeOrganizerTodoProgress(QObject *parent = Q_NULLPTR);
547
548 virtual DetailType type() const;
549
550 void setPercentageComplete(int percentageComplete);
551 int percentageComplete() const;
552
553 void setFinishedDateTime(const QDateTime &datetime);
554 QDateTime finishedDateTime() const;
555
556 void setStatus(StatusType newStatus);
557 StatusType status() const;
558
559Q_SIGNALS:
560 void valueChanged();
561};
562
563class QDeclarativeOrganizerTodoTime : public QDeclarativeOrganizerItemDetail
564{
565 Q_OBJECT
566
567 Q_ENUMS(TodoTimeField)
568
569 Q_PROPERTY(bool allDay READ isAllDay WRITE setAllDay NOTIFY valueChanged)
570 Q_PROPERTY(QDateTime startDateTime READ startDateTime WRITE setStartDateTime NOTIFY valueChanged)
571 Q_PROPERTY(QDateTime dueDateTime READ dueDateTime WRITE setDueDateTime NOTIFY valueChanged)
572
573public:
574 enum TodoTimeField {
575 FieldStartDateTime = QOrganizerTodoTime::FieldStartDateTime,
576 FieldDueDateTime = QOrganizerTodoTime::FieldDueDateTime,
577 FieldAllDay = QOrganizerTodoTime::FieldAllDay
578 };
579
580 QDeclarativeOrganizerTodoTime(QObject *parent = Q_NULLPTR);
581
582 virtual DetailType type() const;
583
584 void setAllDay(bool isAllDay);
585 bool isAllDay();
586
587 void setStartDateTime(const QDateTime &datetime);
588 QDateTime startDateTime() const;
589
590 void setDueDateTime(const QDateTime &dateTime);
591 QDateTime dueDateTime() const;
592
593Q_SIGNALS:
594 void valueChanged();
595};
596
597
598class QDeclarativeOrganizerItemReminder : public QDeclarativeOrganizerItemDetail
599{
600 Q_OBJECT
601
602 Q_ENUMS(ReminderField)
603 Q_ENUMS(ReminderType)
604
605 Q_PROPERTY(ReminderType reminderType READ reminderType NOTIFY reminderChanged)
606 Q_PROPERTY(int repetitionCount READ repetitionCount WRITE setRepetitionCount NOTIFY reminderChanged)
607 Q_PROPERTY(int repetitionDelay READ repetitionDelay WRITE setRepetitionDelay NOTIFY reminderChanged)
608 Q_PROPERTY(int secondsBeforeStart READ secondsBeforeStart WRITE setSecondsBeforeStart NOTIFY reminderChanged)
609
610public:
611 enum ReminderField {
612 FieldRepetitionCount = QOrganizerItemReminder::FieldRepetitionCount,
613 FieldRepetitionDelay = QOrganizerItemReminder::FieldRepetitionDelay,
614 FieldSecondsBeforeStart = QOrganizerItemReminder::FieldSecondsBeforeStart
615 };
616
617 enum ReminderType {
618 NoReminder = QOrganizerItemReminder::NoReminder,
619 VisualReminder = QOrganizerItemReminder::VisualReminder,
620 AudibleReminder = QOrganizerItemReminder::AudibleReminder,
621 EmailReminder = QOrganizerItemReminder::EmailReminder
622 };
623
624 QDeclarativeOrganizerItemReminder(QObject *parent = Q_NULLPTR);
625
626 virtual DetailType type() const;
627
628 ReminderType reminderType() const;
629
630 void setRepetitionCount(int count);
631 int repetitionCount() const;
632
633 void setRepetitionDelay(int delaySeconds);
634 int repetitionDelay() const;
635
636 void setSecondsBeforeStart(int seconds);
637 int secondsBeforeStart() const;
638
639Q_SIGNALS:
640 void reminderChanged();
641};
642
643
644class QDeclarativeOrganizerItemAudibleReminder : public QDeclarativeOrganizerItemReminder
645{
646 Q_OBJECT
647
648 Q_ENUMS(AudibleReminderField)
649
650 Q_PROPERTY(QUrl dataUrl READ dataUrl WRITE setDataUrl NOTIFY valueChanged)
651
652public:
653 enum AudibleReminderField {
654 FieldDataUrl = QOrganizerItemAudibleReminder::FieldDataUrl
655 };
656
657 QDeclarativeOrganizerItemAudibleReminder(QObject *parent = Q_NULLPTR);
658
659 virtual DetailType type() const;
660
661 void setDataUrl(const QUrl &url);
662 QUrl dataUrl() const;
663
664Q_SIGNALS:
665 void valueChanged();
666};
667
668
669class QDeclarativeOrganizerItemEmailReminder : public QDeclarativeOrganizerItemReminder
670{
671 Q_OBJECT
672
673 Q_ENUMS(EmailReminderField)
674
675 Q_PROPERTY(QString body READ body WRITE setBody NOTIFY valueChanged)
676 Q_PROPERTY(QString subject READ subject WRITE setSubject NOTIFY valueChanged)
677 Q_PROPERTY(QStringList recipients READ recipients WRITE setRecipients NOTIFY valueChanged)
678 Q_PROPERTY(QVariantList attachments READ attachments WRITE setAttachments NOTIFY valueChanged)
679
680public:
681 enum EmailReminderField {
682 FieldSubject = QOrganizerItemEmailReminder::FieldSubject,
683 FieldBody = QOrganizerItemEmailReminder::FieldBody,
684 FieldRecipients = QOrganizerItemEmailReminder::FieldRecipients,
685 FieldAttachments = QOrganizerItemEmailReminder::FieldAttachments
686 };
687
688 QDeclarativeOrganizerItemEmailReminder(QObject *parent = Q_NULLPTR);
689
690 virtual DetailType type() const;
691
692 void setBody(const QString &newBody);
693 QString body() const;
694
695 void setSubject(const QString &newSubject);
696 QString subject() const;
697
698 void setRecipients(const QStringList &newRecipients);
699 QStringList recipients() const;
700
701 void setAttachments(const QVariantList &newAttachments);
702 QVariantList attachments();
703
704Q_SIGNALS:
705 void valueChanged();
706};
707
708
709class QDeclarativeOrganizerItemVisualReminder : public QDeclarativeOrganizerItemReminder
710{
711 Q_OBJECT
712
713 Q_ENUMS(VisualReminderField)
714
715 Q_PROPERTY(QString message READ message WRITE setMessage NOTIFY valueChanged)
716 Q_PROPERTY(QUrl dataUrl READ dataUrl WRITE setDataUrl NOTIFY valueChanged)
717
718public:
719 enum VisualReminderField {
720 FieldDataUrl = QOrganizerItemVisualReminder::FieldDataUrl,
721 FieldMessage = QOrganizerItemVisualReminder::FieldMessage
722 };
723
724 QDeclarativeOrganizerItemVisualReminder(QObject *parent = Q_NULLPTR);
725
726 virtual DetailType type() const;
727
728 void setMessage(const QString &msg);
729 QString message() const;
730
731 void setDataUrl(const QUrl &url);
732 QUrl dataUrl() const;
733
734Q_SIGNALS:
735 void valueChanged();
736};
737
738
739class QDeclarativeOrganizerItemExtendedDetail : public QDeclarativeOrganizerItemDetail
740{
741 Q_OBJECT
742
743 Q_ENUMS(ExtendedDetailField)
744
745 Q_PROPERTY(QString name READ name WRITE setName NOTIFY valueChanged)
746 Q_PROPERTY(QVariant data READ data WRITE setData NOTIFY valueChanged)
747
748public:
749 enum ExtendedDetailField {
750 FieldName = QOrganizerItemExtendedDetail::FieldName,
751 FieldData = QOrganizerItemExtendedDetail::FieldData
752 };
753
754 QDeclarativeOrganizerItemExtendedDetail(QObject *parent = Q_NULLPTR);
755
756 virtual DetailType type() const;
757
758 void setName(const QString &newDetailName);
759 QString name() const;
760
761 void setData(const QVariant &data);
762 QVariant data() const;
763
764Q_SIGNALS:
765 void valueChanged();
766};
767
768
769class QDeclarativeOrganizerEventAttendee : public QDeclarativeOrganizerItemDetail
770{
771 Q_OBJECT
772
773 Q_ENUMS(EventAttendeeField)
774 Q_ENUMS(ParticipationStatus)
775 Q_ENUMS(ParticipationRole)
776
777 Q_PROPERTY(QString name READ name WRITE setName NOTIFY valueChanged)
778 Q_PROPERTY(QString emailAddress READ emailAddress WRITE setEmailAddress NOTIFY valueChanged)
779 Q_PROPERTY(QString attendeeId READ attendeeId WRITE setAttendeeId NOTIFY valueChanged)
780 Q_PROPERTY(ParticipationStatus participationStatus READ participationStatus WRITE setParticipationStatus NOTIFY valueChanged)
781 Q_PROPERTY(ParticipationRole participationRole READ participationRole WRITE setParticipationRole NOTIFY valueChanged)
782
783public:
784 enum EventAttendeeField {
785 FieldName = QOrganizerEventAttendee::FieldName,
786 FieldEmailAddress = QOrganizerEventAttendee::FieldEmailAddress,
787 FieldAddendeeId = QOrganizerEventAttendee::FieldAttendeeId,
788 FieldParticipationStatus = QOrganizerEventAttendee::FieldParticipationStatus,
789 FieldParticipationRole = QOrganizerEventAttendee::FieldParticipationRole
790 };
791
792 enum ParticipationStatus {
793 StatusUnknown = QOrganizerEventAttendee::StatusUnknown,
794 StatusAccepted = QOrganizerEventAttendee::StatusAccepted,
795 StatusDeclined = QOrganizerEventAttendee::StatusDeclined,
796 StatusTentative = QOrganizerEventAttendee::StatusTentative,
797 StatusDelegated = QOrganizerEventAttendee::StatusDelegated,
798 StatusInProcess = QOrganizerEventAttendee::StatusInProcess,
799 StatusCompleted = QOrganizerEventAttendee::StatusCompleted
800 };
801
802 enum ParticipationRole {
803 RoleUnknown = QOrganizerEventAttendee::RoleUnknown,
804 RoleOrganizer = QOrganizerEventAttendee::RoleOrganizer,
805 RoleChairperson = QOrganizerEventAttendee::RoleChairperson,
806 RoleHost = QOrganizerEventAttendee::RoleHost,
807 RoleRequiredParticipant = QOrganizerEventAttendee::RoleRequiredParticipant,
808 RoleOptionalParticipant = QOrganizerEventAttendee::RoleOptionalParticipant,
809 RoleNonParticipant = QOrganizerEventAttendee::RoleNonParticipant
810 };
811
812 QDeclarativeOrganizerEventAttendee(QObject *parent = Q_NULLPTR);
813
814 virtual DetailType type() const;
815
816 void setName(const QString &newName);
817 QString name() const;
818
819 void setEmailAddress(const QString &newEmailAddress);
820 QString emailAddress() const;
821
822 void setParticipationStatus(ParticipationStatus status);
823 ParticipationStatus participationStatus() const;
824
825 void setParticipationRole(ParticipationRole role);
826 ParticipationRole participationRole() const;
827
828 void setAttendeeId(const QString &newAttendeeId);
829 QString attendeeId() const;
830
831Q_SIGNALS:
832 void valueChanged();
833};
834
835
836class QDeclarativeOrganizerEventRsvp : public QDeclarativeOrganizerItemDetail
837{
838 Q_OBJECT
839 Q_PROPERTY(QDeclarativeOrganizerEventAttendee::ParticipationStatus participationStatus READ participationStatus WRITE setParticipationStatus NOTIFY valueChanged)
840 Q_PROPERTY(QDeclarativeOrganizerEventAttendee::ParticipationRole participationRole READ participationRole WRITE setParticipationRole NOTIFY valueChanged)
841 Q_PROPERTY(ResponseRequirement responseRequirement READ responseRequirement WRITE setResponseRequirement NOTIFY valueChanged)
842 Q_PROPERTY(QDateTime responseDeadline READ responseDeadline WRITE setResponseDeadline NOTIFY valueChanged)
843 Q_PROPERTY(QDateTime responseDate READ responseDate WRITE setResponseDate NOTIFY valueChanged)
844 Q_PROPERTY(QString organizerName READ organizerName WRITE setOrganizerName NOTIFY valueChanged)
845 Q_PROPERTY(QString organizerEmail READ organizerEmail WRITE setOrganizerEmail NOTIFY valueChanged)
846 Q_ENUMS(EventRsvpField)
847 Q_ENUMS(ResponseRequirement)
848
849public:
850 enum EventRsvpField {
851 FieldParticipationStatus = QOrganizerEventRsvp::FieldParticipationStatus,
852 FieldParticipationRole = QOrganizerEventRsvp::FieldParticipationRole,
853 FieldResponseRequirement = QOrganizerEventRsvp::FieldResponseRequirement,
854 FieldResponseDeadline = QOrganizerEventRsvp::FieldResponseDeadline,
855 FieldResponseDate = QOrganizerEventRsvp::FieldResponseDate,
856 FieldOrganizerName = QOrganizerEventRsvp::FieldOrganizerName,
857 FieldOrganizerEmail = QOrganizerEventRsvp::FieldOrganizerEmail
858 };
859
860 enum ResponseRequirement {
861 ResponseNotRequired = QOrganizerEventRsvp::ResponseNotRequired,
862 ResponseRequired = QOrganizerEventRsvp::ResponseRequired
863 };
864
865 QDeclarativeOrganizerEventRsvp(QObject *parent = Q_NULLPTR);
866
867 virtual DetailType type() const;
868 virtual QVariant value(int field) const;
869 virtual bool setValue(int key, const QVariant& value);
870
871 void setParticipationStatus(QDeclarativeOrganizerEventAttendee::ParticipationStatus status);
872 QDeclarativeOrganizerEventAttendee::ParticipationStatus participationStatus() const;
873
874 void setParticipationRole(QDeclarativeOrganizerEventAttendee::ParticipationRole role);
875 QDeclarativeOrganizerEventAttendee::ParticipationRole participationRole() const;
876
877 void setResponseRequirement(ResponseRequirement requirement);
878 ResponseRequirement responseRequirement() const;
879
880 void setResponseDeadline(const QDateTime &date);
881 QDateTime responseDeadline() const;
882
883 void setResponseDate(const QDateTime &date);
884 QDateTime responseDate() const;
885
886 void setOrganizerName(const QString &name);
887 QString organizerName() const;
888
889 void setOrganizerEmail(const QString &email);
890 QString organizerEmail() const;
891
892Q_SIGNALS:
893 void valueChanged();
894};
895
896
897class QDeclarativeOrganizerItemClassification : public QDeclarativeOrganizerItemDetail
898{
899 Q_OBJECT
900 Q_PROPERTY(AccessClassification classification READ classification WRITE setClassification NOTIFY valueChanged)
901 Q_ENUMS(Field)
902 Q_ENUMS(AccessClassification)
903
904public:
905 enum Field {
906 FieldClassification = QOrganizerItemClassification::FieldClassification
907 };
908
909 enum AccessClassification {
910 AccessPublic = QOrganizerItemClassification::AccessPublic,
911 AccessConfidential = QOrganizerItemClassification::AccessConfidential,
912 AccessPrivate = QOrganizerItemClassification::AccessPrivate
913 };
914
915 QDeclarativeOrganizerItemClassification(QObject *parent = Q_NULLPTR);
916
917 virtual DetailType type() const;
918
919 void setClassification(AccessClassification newClassification);
920 AccessClassification classification() const;
921
922Q_SIGNALS:
923 void valueChanged();
924};
925
926
927class QDeclarativeOrganizerItemVersion : public QDeclarativeOrganizerItemDetail
928{
929 Q_OBJECT
930 Q_ENUMS(Field)
931 Q_PROPERTY(int version READ version WRITE setVersion NOTIFY valueChanged)
932 Q_PROPERTY(QString extendedVersion READ extendedVersion WRITE setExtendedVersion NOTIFY valueChanged)
933
934public:
935 enum Field {
936 FieldVersion = QOrganizerItemVersion::FieldVersion,
937 FieldExtendedVersion = QOrganizerItemVersion::FieldExtendedVersion
938 };
939
940 QDeclarativeOrganizerItemVersion(QObject *parent = Q_NULLPTR);
941
942 virtual DetailType type() const;
943
944 void setVersion(int newVersion);
945 int version() const;
946
947 void setExtendedVersion(const QString &newExtendedVersion);
948 QString extendedVersion() const;
949
950Q_SIGNALS:
951 void valueChanged();
952};
953
954
955class QDeclarativeOrganizerItemDetailFactory
956{
957public:
958 static QDeclarativeOrganizerItemDetail *createItemDetail(QDeclarativeOrganizerItemDetail::DetailType type);
959};
960
961QT_END_NAMESPACE
962
963QML_DECLARE_TYPE(QDeclarativeOrganizerItemDetail)
964QML_DECLARE_TYPE(QDeclarativeOrganizerEventTime)
965QML_DECLARE_TYPE(QDeclarativeOrganizerItemComment)
966QML_DECLARE_TYPE(QDeclarativeOrganizerItemDescription)
967QML_DECLARE_TYPE(QDeclarativeOrganizerItemDisplayLabel)
968QML_DECLARE_TYPE(QDeclarativeOrganizerItemGuid)
969QML_DECLARE_TYPE(QDeclarativeOrganizerItemLocation)
970QML_DECLARE_TYPE(QDeclarativeOrganizerItemParent)
971QML_DECLARE_TYPE(QDeclarativeOrganizerItemPriority)
972QML_DECLARE_TYPE(QDeclarativeOrganizerItemRecurrence)
973QML_DECLARE_TYPE(QDeclarativeOrganizerItemTag)
974QML_DECLARE_TYPE(QDeclarativeOrganizerItemTimestamp)
975QML_DECLARE_TYPE(QDeclarativeOrganizerItemType)
976QML_DECLARE_TYPE(QDeclarativeOrganizerJournalTime)
977QML_DECLARE_TYPE(QDeclarativeOrganizerTodoProgress)
978QML_DECLARE_TYPE(QDeclarativeOrganizerTodoTime)
979QML_DECLARE_TYPE(QDeclarativeOrganizerItemReminder)
980QML_DECLARE_TYPE(QDeclarativeOrganizerItemAudibleReminder)
981QML_DECLARE_TYPE(QDeclarativeOrganizerItemEmailReminder)
982QML_DECLARE_TYPE(QDeclarativeOrganizerItemVisualReminder)
983QML_DECLARE_TYPE(QDeclarativeOrganizerItemExtendedDetail)
984QML_DECLARE_TYPE(QDeclarativeOrganizerEventAttendee)
985QML_DECLARE_TYPE(QDeclarativeOrganizerEventRsvp)
986QML_DECLARE_TYPE(QDeclarativeOrganizerItemClassification)
987QML_DECLARE_TYPE(QDeclarativeOrganizerItemVersion)
988
989#endif // QDECLARATIVEORGANIZERITEMDETAIL_H
990

source code of qtpim/src/imports/organizer/qdeclarativeorganizeritemdetail_p.h