CalendarEvents::CalendarEventsPlugin Class

class CalendarEvents::CalendarEventsPlugin

Plugin for feeding events to a calendar instance. More...

Header: #include <CalendarEvents/CalendarEventsPlugin>
CMake: find_package(KF6 REQUIRED COMPONENTS CalendarEvents)
target_link_libraries(mytarget PRIVATE KF6::CalendarEvents)
Inherits: QObject

Public Types

struct SubLabel
enum class SubLabelPriority { Low, Default, High, Urgent }

Public Functions

CalendarEventsPlugin(QObject *parent = nullptr)
virtual void loadEventsForDateRange(const QDate &startDate, const QDate &endDate) = 0

Signals

(since 6.0) void alternateCalendarDateReady(const QHash<QDate, QCalendar::YearMonthDay> &data)
void dataReady(const QMultiHash<QDate, CalendarEvents::EventData> &data)
void eventModified(const CalendarEvents::EventData &modifiedEvent)
void eventRemoved(const QString &uid)
void subLabelReady(const QHash<QDate, CalendarEvents::CalendarEventsPlugin::SubLabel> &data)

Detailed Description

Member Type Documentation

enum class CalendarEventsPlugin::SubLabelPriority

ConstantValueDescription
CalendarEvents::CalendarEventsPlugin::SubLabelPriority::Low0Usually used in alternate calendars
CalendarEvents::CalendarEventsPlugin::SubLabelPriority::Default1For holidays or normal events
CalendarEvents::CalendarEventsPlugin::SubLabelPriority::High2For flagged or marked events
CalendarEvents::CalendarEventsPlugin::SubLabelPriority::Urgent3 

Member Function Documentation

[explicit] CalendarEventsPlugin::CalendarEventsPlugin(QObject *parent = nullptr)

[signal, since 6.0] void CalendarEventsPlugin::alternateCalendarDateReady(const QHash<QDate, QCalendar::YearMonthDay> &data)

Emitted when the plugin has loaded the alternate dates

data A hash containing a QDate key from Gregorian calendar for the alternate date in the value, QDate.

This function was introduced in 6.0.

[signal] void CalendarEventsPlugin::dataReady(const QMultiHash<QDate, CalendarEvents::EventData> &data)

Emitted when the plugin has loaded the events data

data A hash containing a QDate key for the event in the value, CalendarEvents::EventData, which holds all the details for the given event It's a multihash as there can be multiple events in the same day For multi-day events, insert just one with the key being the startdate of the event

[signal] void CalendarEventsPlugin::eventModified(const CalendarEvents::EventData &modifiedEvent)

Should be emitted when there is a modification of an event that was previously returned via the dataReady() signal

event The modified event data

[signal] void CalendarEventsPlugin::eventRemoved(const QString &uid)

Should be emitted when the plugin removes some event from its collection

uid The uid of the event that was removed

[pure virtual] void CalendarEventsPlugin::loadEventsForDateRange(const QDate &startDate, const QDate &endDate)

When this is called, the plugin should load all events data between those two date ranges. Once the data are ready, it should just emit the dataReady() signal. The range is usually one month

startDate the start of the range

endDate the end of the range

[signal] void CalendarEventsPlugin::subLabelReady(const QHash<QDate, CalendarEvents::CalendarEventsPlugin::SubLabel> &data)

Emitted when the plugin has loaded the sublabels

data A hash containing a QDate key for the sublabels in the value, SubLabel.