CalendarEvents::EventData Class

class CalendarEvents::EventData

Data about an event. More...

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

Public Types

enum EventType { Holiday, Event, Todo }

Public Functions

EventData()
QString description() const
QDateTime endDateTime() const
QString eventColor() const
bool isAllDay() const
bool isMinor() const
void setDescription(const QString &description)
void setEndDateTime(const QDateTime &endDateTime)
void setEventColor(const QString &color)
void setEventType(CalendarEvents::EventData::EventType type)
void setIsAllDay(bool isAllDay)
void setIsMinor(bool isMinor)
void setStartDateTime(const QDateTime &startDateTime)
void setTitle(const QString &title)
void setUid(const QString &uid)
QDateTime startDateTime() const
QString title() const
CalendarEvents::EventData::EventType type() const
QString uid() const

Detailed Description

Member Type Documentation

enum EventData::EventType

ConstantValueDescription
CalendarEvents::EventData::Holiday0Any holiday
CalendarEvents::EventData::Event1General Event
CalendarEvents::EventData::Todo2A Todo item

Member Function Documentation

EventData::EventData()

QString EventData::description() const

Event description, can provide more details about the event

See also setDescription().

QDateTime EventData::endDateTime() const

The end date and time of this event

See also setEndDateTime().

QString EventData::eventColor() const

The color that should be used to mark this event with It comes in the HTML hex format, eg. #AARRGGBB or #RRGGBB

See also setEventColor().

bool EventData::isAllDay() const

If true, this event goes on the whole day (eg. a holiday)

See also setIsAllDay().

bool EventData::isMinor() const

If true, this event won't mark the day in the calendar grid The main purpose for this flag is to support namedays, where in some countries the calendars have different name in them every day. This is just a minor holiday and as such should not mark the calendar grid, otherwise the whole grid would be in a different color.

See also setIsMinor().

void EventData::setDescription(const QString &description)

Sets the event description, which allows to add more details about this event

description The description

See also description().

void EventData::setEndDateTime(const QDateTime &endDateTime)

Set the end date-time of this event

endDateTime the date-time of when the event is ending

See also endDateTime().

void EventData::setEventColor(const QString &color)

This is to support various calendar colors the user might have configured elsewhere

color The color for this event in the HTML hex format eg. #AARRGGBB or #RRGGBB (this is passed directly to QML)

See also eventColor().

void EventData::setEventType(CalendarEvents::EventData::EventType type)

Sets the event type, eg. a holiday, an event or a todo item

type The event type,

void EventData::setIsAllDay(bool isAllDay)

If set to true, it will be displayed in the Calendar agenda without any time besides it, marked as "going on all day"

This is useful for single-day events only, for multiple-day events, leave to false (default)

isAllDay set to true if the event takes all day, false otherwise (defaults to false)

See also isAllDay().

void EventData::setIsMinor(bool isMinor)

If set to true, it won't be marked in the calendar grid

isMinor true if it's a minor event (like a nameday holiday), false otherwise (defaults to false)

See also isMinor().

void EventData::setStartDateTime(const QDateTime &startDateTime)

Set the start date-time of this event

startDateTime the date-time of when the event is starting

See also startDateTime().

void EventData::setTitle(const QString &title)

Sets the title of the event

title The event title

See also title().

void EventData::setUid(const QString &uid)

Sets the uid of the event

This is a mandatory field only if you want to use the eventModified/eventRemoved signals, otherwise setting it is optional

uid A unique id, recommended is to use the plugin name as prefix (to keep it unique)

See also uid().

QDateTime EventData::startDateTime() const

The start date and time of this event

See also setStartDateTime().

QString EventData::title() const

Event title

See also setTitle().

CalendarEvents::EventData::EventType EventData::type() const

Type of the current event, eg. a holiday, an event or a todo item

QString EventData::uid() const

Unique ID of the event

See also setUid().