summaryrefslogtreecommitdiffstats
path: root/framework/src/domain/perioddayeventmodel.h
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2018-08-03 13:49:56 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-08-03 13:56:58 +0200
commit2085b83960cbb8e4693cf48a5bd265aa946256de (patch)
tree58f5d6f7ff18cd63ac0aa8827dadfbb66e269083 /framework/src/domain/perioddayeventmodel.h
parent064367aec304708591f5cd4d010ed462119a0323 (diff)
downloadkube-2085b83960cbb8e4693cf48a5bd265aa946256de.tar.gz
kube-2085b83960cbb8e4693cf48a5bd265aa946256de.zip
Weekview with calendar colors
Diffstat (limited to 'framework/src/domain/perioddayeventmodel.h')
-rw-r--r--framework/src/domain/perioddayeventmodel.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/framework/src/domain/perioddayeventmodel.h b/framework/src/domain/perioddayeventmodel.h
index a7d9cea8..a0410e2e 100644
--- a/framework/src/domain/perioddayeventmodel.h
+++ b/framework/src/domain/perioddayeventmodel.h
@@ -78,6 +78,8 @@
78// | '--- List of event pointers for that day 78// | '--- List of event pointers for that day
79// '--- Partition / day 79// '--- Partition / day
80// 80//
81
82class EntityCacheInterface;
81class KUBE_EXPORT PeriodDayEventModel : public QAbstractItemModel 83class KUBE_EXPORT PeriodDayEventModel : public QAbstractItemModel
82{ 84{
83 Q_OBJECT 85 Q_OBJECT
@@ -87,6 +89,7 @@ class KUBE_EXPORT PeriodDayEventModel : public QAbstractItemModel
87 89
88public: 90public:
89 using Event = Sink::ApplicationDomain::Event; 91 using Event = Sink::ApplicationDomain::Event;
92 using Calendar = Sink::ApplicationDomain::Calendar;
90 93
91 enum Roles 94 enum Roles
92 { 95 {
@@ -96,6 +99,7 @@ public:
96 Description, 99 Description,
97 StartTime, 100 StartTime,
98 Duration, 101 Duration,
102 Color
99 }; 103 };
100 Q_ENUM(Roles); 104 Q_ENUM(Roles);
101 PeriodDayEventModel(QObject *parent = nullptr); 105 PeriodDayEventModel(QObject *parent = nullptr);
@@ -120,6 +124,7 @@ public:
120private: 124private:
121 void updateQuery(); 125 void updateQuery();
122 void partitionData(); 126 void partitionData();
127 QByteArray getColor(const QByteArray &calendar) const;
123 128
124 int bucketOf(const QDate &candidate) const; 129 int bucketOf(const QDate &candidate) const;
125 130
@@ -128,6 +133,7 @@ private:
128 133
129 QSharedPointer<QAbstractItemModel> eventModel; 134 QSharedPointer<QAbstractItemModel> eventModel;
130 QVector<QList<QSharedPointer<Event>>> partitionedEvents; 135 QVector<QList<QSharedPointer<Event>>> partitionedEvents;
136 QSharedPointer<EntityCacheInterface> mCalendarCache;
131 137
132 static const constexpr quintptr DAY_ID = std::numeric_limits<quintptr>::max(); 138 static const constexpr quintptr DAY_ID = std::numeric_limits<quintptr>::max();
133}; 139};