Line data Source code
1 : #pragma once
2 :
3 : #include <QDateTime>
4 : #include <QString>
5 : #include <QStringList>
6 :
7 : // ═══════════════════════════════════════════════════════
8 : // CalDAV data models (Sprint 32 – T-330)
9 : // ═══════════════════════════════════════════════════════
10 :
11 : /// Info about a discovered CalDAV calendar (PROPFIND result)
12 : struct CalendarInfo {
13 : QString path; ///< DAV href path (unique per server)
14 : QString accountId; ///< Owning DAV account id; path is only unique per account
15 : QString displayName; ///< Human-readable name, e.g. "Persönlich"
16 : QString color; ///< Hex color from APPLE:calendar-color, e.g. "#FF6600"
17 : QString ctag; ///< Calendar CTag for sync change detection
18 : bool readOnly = false; ///< User-marked as read-only (no write ops)
19 : };
20 :
21 : /// Single calendar event parsed from VEVENT (RFC 5545)
22 : struct CalendarEvent {
23 : qint64 id = 0; ///< Database primary key
24 : QString uid; ///< iCal UID (unique within calendar)
25 : QString calendarPath; ///< DAV path of parent calendar
26 : QString accountId; ///< Owning DAV account id
27 : QString resourceHref; ///< DAV href of the VEVENT resource
28 : QString summary; ///< Event title (SUMMARY)
29 : QString description; ///< Event description (DESCRIPTION)
30 : QString location; ///< Event location (LOCATION)
31 : QDateTime dtStart; ///< Start date/time (DTSTART)
32 : QDateTime dtEnd; ///< End date/time (DTEND)
33 : bool allDay = false; ///< True if VALUE=DATE (no time component)
34 : QString rrule; ///< Recurrence rule string (RRULE), stored as-is
35 : QList<QDateTime> exdates; ///< Deleted occurrences (EXDATE, T-79.C1/H3)
36 : QString etag; ///< DAV ETag for incremental sync
37 : QString color; ///< Inherited from parent calendar
38 : QDateTime lastModified; ///< LAST-MODIFIED timestamp
39 : };
40 :
41 : /// Single TODO/task parsed from VTODO (RFC 5545)
42 : struct CalendarTask {
43 : qint64 id = 0; ///< Database primary key
44 : QString uid; ///< iCal UID
45 : QString calendarPath; ///< DAV path of parent calendar
46 : QString accountId; ///< Owning DAV account id
47 : QString resourceHref; ///< DAV href of the VTODO resource
48 : QString summary; ///< Task title (SUMMARY)
49 : QString description; ///< Task description (DESCRIPTION)
50 : QDateTime dtStart; ///< Start date (DTSTART)
51 : QDateTime due; ///< Due date (DUE)
52 : int percentComplete = 0; ///< 0–100 (PERCENT-COMPLETE)
53 : int priority = 0; ///< 0–9 (PRIORITY, 0 = undefined, 1 = starred/important)
54 : QString status; ///< NEEDS-ACTION | COMPLETED | IN-PROCESS | CANCELLED
55 : QDateTime completedAt; ///< Completion timestamp (COMPLETED)
56 : QDateTime created; ///< Creation timestamp (CREATED)
57 : QString organizer; ///< Creator/organizer (ORGANIZER CN or mailto)
58 : QString etag; ///< DAV ETag
59 : QDateTime lastModified; ///< LAST-MODIFIED timestamp
60 : QString color; ///< Inherited from parent calendar
61 : QString calendarDisplayName; ///< Display name of parent calendar
62 :
63 : /// Nextcloud Tasks: priority 1 = starred/important
64 397 : bool isStarred() const { return priority == 1; }
65 : };
|