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 : QString etag; ///< DAV ETag for incremental sync
36 : QString color; ///< Inherited from parent calendar
37 : QDateTime lastModified; ///< LAST-MODIFIED timestamp
38 : };
39 :
40 : /// Single TODO/task parsed from VTODO (RFC 5545)
41 : struct CalendarTask {
42 : qint64 id = 0; ///< Database primary key
43 : QString uid; ///< iCal UID
44 : QString calendarPath; ///< DAV path of parent calendar
45 : QString accountId; ///< Owning DAV account id
46 : QString resourceHref; ///< DAV href of the VTODO resource
47 : QString summary; ///< Task title (SUMMARY)
48 : QString description; ///< Task description (DESCRIPTION)
49 : QDateTime dtStart; ///< Start date (DTSTART)
50 : QDateTime due; ///< Due date (DUE)
51 : int percentComplete = 0; ///< 0–100 (PERCENT-COMPLETE)
52 : int priority = 0; ///< 0–9 (PRIORITY, 0 = undefined, 1 = starred/important)
53 : QString status; ///< NEEDS-ACTION | COMPLETED | IN-PROCESS | CANCELLED
54 : QDateTime completedAt; ///< Completion timestamp (COMPLETED)
55 : QDateTime created; ///< Creation timestamp (CREATED)
56 : QString organizer; ///< Creator/organizer (ORGANIZER CN or mailto)
57 : QString etag; ///< DAV ETag
58 : QDateTime lastModified; ///< LAST-MODIFIED timestamp
59 : QString color; ///< Inherited from parent calendar
60 : QString calendarDisplayName; ///< Display name of parent calendar
61 :
62 : /// Nextcloud Tasks: priority 1 = starred/important
63 397 : bool isStarred() const { return priority == 1; }
64 : };
|