KCalendarCore::Event Class

class KCalendarCore::Event

This class provides an Event in the sense of RFC2445. More...

Header: #include <KCalendarCore/Event>
CMake: find_package(KF6 REQUIRED COMPONENTS CalendarCore)
target_link_libraries(mytarget PRIVATE KF6::CalendarCore)
In QML: event
Inherits: KCalendarCore::Incidence

Public Types

List
Ptr
enum Transparency { Opaque, Transparent }

Properties

Public Functions

Event()
(since 4.14) Event(const KCalendarCore::Incidence &other)
Event(const KCalendarCore::Event &other)
virtual ~Event() override
QDate dateEnd() const
virtual QDateTime dtEnd() const
bool hasEndDate() const
bool isMultiDay(const QTimeZone &zone = {}) const
void setDtEnd(const QDateTime &dtEnd)
void setTransparency(KCalendarCore::Event::Transparency transparency)
KCalendarCore::Event::Transparency transparency() const

Reimplemented Public Functions

virtual KCalendarCore::Event *clone() const override
virtual QDateTime dateTime(KCalendarCore::IncidenceBase::DateTimeRole role) const override
virtual QLatin1String iconName(const QDateTime &recurrenceId = {}) const override
virtual QLatin1String mimeType() const override
virtual void setAllDay(bool allDay) override
virtual void setDateTime(const QDateTime &dateTime, KCalendarCore::IncidenceBase::DateTimeRole role) override
virtual void setDtStart(const QDateTime &dt) override
virtual void setDuration(const KCalendarCore::Duration &duration) override
virtual void shiftTimes(const QTimeZone &oldZone, const QTimeZone &newZone) override
virtual bool supportsGroupwareCommunication() const override
virtual KCalendarCore::IncidenceBase::IncidenceType type() const override
virtual QByteArray typeStr() const override

Static Public Members

QLatin1String eventMimeType()

Reimplemented Protected Functions

virtual KCalendarCore::IncidenceBase &assign(const KCalendarCore::IncidenceBase &other) override
virtual bool equals(const KCalendarCore::IncidenceBase &event) const override
virtual void virtual_hook(KCalendarCore::IncidenceBase::VirtualHook id, void *data) override

Detailed Description

Member Type Documentation

Event::List

List of events.

Event::Ptr

A shared pointer to an Event object.

enum Event::Transparency

The different Event transparency types.

ConstantValueDescription
KCalendarCore::Event::Opaque0Event appears in free/busy time.
KCalendarCore::Event::Transparent1Event does not appear in free/busy time.

Property Documentation

dtEnd : QDateTime

Access functions:

virtual QDateTime dtEnd() const
void setDtEnd(const QDateTime &dtEnd)

transparency : KCalendarCore::Event::Transparency

Access functions:

KCalendarCore::Event::Transparency transparency() const
void setTransparency(KCalendarCore::Event::Transparency transparency)

Member Function Documentation

Event::Event()

Constructs an event.

[since 4.14] Event::Event(const KCalendarCore::Incidence &other)

Costructs an event out of an incidence This constructs allows to make it easy to create an event from a todo.

other is the incidence to copy.

This function was introduced in 4.14.

Event::Event(const KCalendarCore::Event &other)

Copy constructor.

other is the event to copy.

[override virtual noexcept] Event::~Event()

Destroys the event.

[override virtual protected] KCalendarCore::IncidenceBase &Event::assign(const KCalendarCore::IncidenceBase &other)

Reimplements: Incidence::assign(const KCalendarCore::IncidenceBase &other).

[override virtual] KCalendarCore::Event *Event::clone() const

Reimplements: Incidence::clone() const.

Returns an exact copy of this Event. The caller owns the returned object.

QDate Event::dateEnd() const

Returns the date when the event ends. This might be different from dtEnd().date, since the end date/time is non-inclusive. So timed events ending at 0:00 have their end date on the day before.

[override virtual] QDateTime Event::dateTime(KCalendarCore::IncidenceBase::DateTimeRole role) const

Reimplements: IncidenceBase::dateTime(KCalendarCore::IncidenceBase::DateTimeRole role) const.

See also setDateTime().

[virtual] QDateTime Event::dtEnd() const

Returns the event end date and time. Important note for all day events: the returned end date is inclusive, the event will still occur during dtEnd(). When serializing to iCalendar DTEND will be dtEnd()+1, because the RFC states that DTEND is exclusive.

Note: Getter function for property dtEnd.

See also setDtEnd().

[override virtual protected] bool Event::equals(const KCalendarCore::IncidenceBase &event) const

Reimplements: Incidence::equals(const KCalendarCore::IncidenceBase &incidence) const.

Compares two events for equality.

event is the event to compare.

Returns true if event is equal to this object, or false if they are different.

[static] QLatin1String Event::eventMimeType()

Returns the Akonadi specific sub MIME type of a KCalendarCore::Event.

bool Event::hasEndDate() const

Returns whether the event has an end date/time.

[override virtual] QLatin1String Event::iconName(const QDateTime &recurrenceId = {}) const

Reimplements: Incidence::iconName(const QDateTime &recurrenceId) const.

bool Event::isMultiDay(const QTimeZone &zone = {}) const

Returns true if the event spans multiple days, otherwise return false.

For recurring events, it returns true if the first occurrence spans multiple days, otherwise returns false. Other occurrences might have a different span due to day light savings changes.

zone If set, looks if the event is multiday for the given zone. If not set, looks if event this multiday for its zone.

[override virtual] QLatin1String Event::mimeType() const

Reimplements: IncidenceBase::mimeType() const.

[override virtual] void Event::setAllDay(bool allDay)

Reimplements: Incidence::setAllDay(bool allDay).

[override virtual] void Event::setDateTime(const QDateTime &dateTime, KCalendarCore::IncidenceBase::DateTimeRole role)

Reimplements: IncidenceBase::setDateTime(const QDateTime &dateTime, KCalendarCore::IncidenceBase::DateTimeRole role).

See also dateTime().

void Event::setDtEnd(const QDateTime &dtEnd)

Sets the event end date and time. Important note for all day events: the end date is inclusive, the event will still occur during dtEnd(). When serializing to iCalendar DTEND will be dtEnd()+1, because the RFC states that DTEND is exclusive.

dtEnd is a QDateTime specifying when the event ends.

Note: Setter function for property dtEnd.

See also dtEnd() and dateEnd().

[override virtual] void Event::setDtStart(const QDateTime &dt)

Reimplements: Incidence::setDtStart(const QDateTime &dt).

Sets the incidence starting date/time.

dt is the starting date/time.

See also IncidenceBase::dtStart().

[override virtual] void Event::setDuration(const KCalendarCore::Duration &duration)

Reimplements: IncidenceBase::setDuration(const KCalendarCore::Duration &duration).

Sets the duration of this event.

duration is the event Duration.

void Event::setTransparency(KCalendarCore::Event::Transparency transparency)

Sets the event's time transparency level.

transparency is the event Transparency level.

Note: Setter function for property transparency.

See also transparency().

[override virtual] void Event::shiftTimes(const QTimeZone &oldZone, const QTimeZone &newZone)

Reimplements: Incidence::shiftTimes(const QTimeZone &oldZone, const QTimeZone &newZone).

[override virtual] bool Event::supportsGroupwareCommunication() const

Reimplements: Incidence::supportsGroupwareCommunication() const.

KCalendarCore::Event::Transparency Event::transparency() const

Returns the event's time transparency level.

Note: Getter function for property transparency.

See also setTransparency().

[override virtual] KCalendarCore::IncidenceBase::IncidenceType Event::type() const

Reimplements: IncidenceBase::type() const.

[override virtual] QByteArray Event::typeStr() const

Reimplements: IncidenceBase::typeStr() const.

[override virtual protected] void Event::virtual_hook(KCalendarCore::IncidenceBase::VirtualHook id, void *data)

Reimplements: IncidenceBase::virtual_hook(KCalendarCore::IncidenceBase::VirtualHook id, void *data).