File indexing completed on 2024-05-05 05:28:20

0001 /*
0002  * SPDX-FileCopyrightText: 2019 Nicolas Fella <nicolas.fella@gmx.de>
0003  *
0004  * SPDX-License-Identifier: GPL-3.0-or-later
0005  */
0006 
0007 #ifndef DAYSOFMONTHINCIDENCEMODEL_H
0008 #define DAYSOFMONTHINCIDENCEMODEL_H
0009 
0010 #include "daysofmonthmodel.h"
0011 #include "localcalendar.h"
0012 
0013 class DaysOfMonthIncidenceModel : public DaysOfMonthModel
0014 {
0015     Q_OBJECT
0016     Q_PROPERTY(LocalCalendar *calendar READ calendar WRITE setCalendar NOTIFY calendarChanged)
0017 public:
0018     enum ExtraRoles {
0019         IncidenceCount = TodayRole + 1
0020     };
0021 
0022     QHash<int, QByteArray> roleNames() const override;
0023     QVariant data(const QModelIndex &index, int role) const override;
0024 
0025     LocalCalendar *calendar() const;
0026     void setCalendar(LocalCalendar *calendar);
0027 
0028 Q_SIGNALS:
0029     void calendarChanged();
0030 
0031 private:
0032     LocalCalendar *m_calendar = nullptr;
0033 };
0034 
0035 #endif // DAYSOFMONTHINCIDENCEMODEL_H
0036