KCalendarCore::FreeBusy Class
class KCalendarCore::FreeBusyProvides information about the free/busy time of a calendar. More...
Header: | #include <KCalendarCore/FreeBusy> |
CMake: | find_package(KF6 REQUIRED COMPONENTS CalendarCore) target_link_libraries(mytarget PRIVATE KF6::CalendarCore) |
Inherits: | KCalendarCore::IncidenceBase |
Public Types
Public Functions
FreeBusy() | |
FreeBusy(const KCalendarCore::FreeBusyPeriod::List &busyPeriods) | |
FreeBusy(const KCalendarCore::Period::List &busyPeriods) | |
FreeBusy(const QDateTime &start, const QDateTime &end) | |
FreeBusy(const KCalendarCore::Event::List &events, const QDateTime &start, const QDateTime &end) | |
FreeBusy(const KCalendarCore::FreeBusy &other) | |
virtual | ~FreeBusy() override |
void | addPeriod(const QDateTime &start, const KCalendarCore::Duration &duration) |
void | addPeriod(const QDateTime &start, const QDateTime &end) |
void | addPeriods(const KCalendarCore::FreeBusyPeriod::List &list) |
void | addPeriods(const KCalendarCore::Period::List &list) |
KCalendarCore::Period::List | busyPeriods() const |
virtual QDateTime | dtEnd() const |
KCalendarCore::FreeBusyPeriod::List | fullBusyPeriods() const |
void | merge(const KCalendarCore::FreeBusy::Ptr &freebusy) |
void | setDtEnd(const QDateTime &end) |
void | sortList() |
Reimplemented Public Functions
virtual QDateTime | dateTime(KCalendarCore::IncidenceBase::DateTimeRole role) const override |
virtual QLatin1String | mimeType() const override |
virtual void | setDateTime(const QDateTime &dateTime, KCalendarCore::IncidenceBase::DateTimeRole role) override |
virtual void | setDtStart(const QDateTime &start) override |
virtual void | shiftTimes(const QTimeZone &oldZone, const QTimeZone &newZone) override |
virtual KCalendarCore::IncidenceBase::IncidenceType | type() const override |
virtual QByteArray | typeStr() const override |
Static Public Members
QLatin1String | freeBusyMimeType() |
Reimplemented Protected Functions
virtual KCalendarCore::IncidenceBase & | assign(const KCalendarCore::IncidenceBase &other) override |
virtual bool | equals(const KCalendarCore::IncidenceBase &freebusy) const override |
virtual void | virtual_hook(KCalendarCore::IncidenceBase::VirtualHook id, void *data) override |
Detailed Description
A free/busy is a collection of Periods.
See also Period.
Member Type Documentation
FreeBusy::List
List of FreeBusy objects.
FreeBusy::Ptr
A shared pointer to a FreeBusy object.
Member Function Documentation
FreeBusy::FreeBusy()
Constructs an free/busy without any periods.
[explicit]
FreeBusy::FreeBusy(const KCalendarCore::FreeBusyPeriod::List &busyPeriods)
Constructs a free/busy from a list of periods.
busyPeriods is a list of periods.
[explicit]
FreeBusy::FreeBusy(const KCalendarCore::Period::List &busyPeriods)
Constructs a free/busy from a list of periods.
busyPeriods is a list of periods.
FreeBusy::FreeBusy(const QDateTime &start, const QDateTime &end)
Constructs a free/busy from a single period.
start is the start date/time of the period.
end is the end date/time of the period.
FreeBusy::FreeBusy(const KCalendarCore::Event::List &events, const QDateTime &start, const QDateTime &end)
Constructs a freebusy for a specified list of events given a single period.
events is a list of events.
start is the start date/time of the period.
end is the end date/time of the period.
FreeBusy::FreeBusy(const KCalendarCore::FreeBusy &other)
Copy constructor.
other is the free/busy to copy.
[override virtual noexcept]
FreeBusy::~FreeBusy()
Destroys a free/busy.
void FreeBusy::addPeriod(const QDateTime &start, const KCalendarCore::Duration &duration)
Adds a period to the freebusy list and sorts the list.
start is the start datetime of the period.
duration is the Duration of the period.
void FreeBusy::addPeriod(const QDateTime &start, const QDateTime &end)
Adds a period to the freebusy list and sorts the list.
start is the start datetime of the period.
end is the end datetime of the period.
void FreeBusy::addPeriods(const KCalendarCore::FreeBusyPeriod::List &list)
Adds a list of periods to the freebusy object and then sorts that list. Use this if you are adding many items, instead of the addPeriod method, to avoid sorting repeatedly.
list is a list of FreeBusyPeriod objects.
void FreeBusy::addPeriods(const KCalendarCore::Period::List &list)
Adds a list of periods to the freebusy object and then sorts that list. Use this if you are adding many items, instead of the addPeriod method, to avoid sorting repeatedly.
list is a list of Period objects.
[override virtual protected]
KCalendarCore::IncidenceBase &FreeBusy::assign(const KCalendarCore::IncidenceBase &other)
Reimplements: IncidenceBase::assign(const KCalendarCore::IncidenceBase &other).
KCalendarCore::Period::List FreeBusy::busyPeriods() const
Returns the list of all periods within the free/busy.
[override virtual]
QDateTime FreeBusy::dateTime(KCalendarCore::IncidenceBase::DateTimeRole role) const
Reimplements: IncidenceBase::dateTime(KCalendarCore::IncidenceBase::DateTimeRole role) const.
See also setDateTime().
[virtual]
QDateTime FreeBusy::dtEnd() const
Returns the end datetime for the free/busy. FIXME: calling addPeriod() does not change mDtEnd. Is that incorrect?
See also setDtEnd().
[override virtual protected]
bool FreeBusy::equals(const KCalendarCore::IncidenceBase &freebusy) const
Reimplements: IncidenceBase::equals(const KCalendarCore::IncidenceBase &incidenceBase) const.
Compare this with freebusy for equality.
freebusy is the FreeBusy to compare.
Returns true if freebusy is equal to this object, or false if they are different.
[static]
QLatin1String FreeBusy::freeBusyMimeType()
Returns the Akonadi specific sub MIME type of a KCalendarCore::FreeBusy.
KCalendarCore::FreeBusyPeriod::List FreeBusy::fullBusyPeriods() const
Returns the list of all periods within the free/busy.
void FreeBusy::merge(const KCalendarCore::FreeBusy::Ptr &freebusy)
Merges another free/busy into this free/busy.
freebusy is a pointer to a valid FreeBusy object.
[override virtual]
QLatin1String FreeBusy::mimeType() const
Reimplements: IncidenceBase::mimeType() const.
[override virtual]
void FreeBusy::setDateTime(const QDateTime &dateTime, KCalendarCore::IncidenceBase::DateTimeRole role)
Reimplements: IncidenceBase::setDateTime(const QDateTime &dateTime, KCalendarCore::IncidenceBase::DateTimeRole role).
See also dateTime().
void FreeBusy::setDtEnd(const QDateTime &end)
Sets the end datetime for the free/busy. Note that this datetime may be later or earlier than all periods within the free/busy.
end is a QDateTime specifying an end datetime.
See also dtEnd() and setDtStart().
[override virtual]
void FreeBusy::setDtStart(const QDateTime &start)
Reimplements: IncidenceBase::setDtStart(const QDateTime &dtStart).
Sets the start date/time for the free/busy. Note that this date/time may be later or earlier than all periods within the free/busy.
start is a QDateTime specifying an start datetime.
See also IncidenceBase::dtStart() and setDtEnd().
[override virtual]
void FreeBusy::shiftTimes(const QTimeZone &oldZone, const QTimeZone &newZone)
Reimplements: IncidenceBase::shiftTimes(const QTimeZone &oldZone, const QTimeZone &newZone).
void FreeBusy::sortList()
Sorts the list of free/busy periods into ascending order.
[override virtual]
KCalendarCore::IncidenceBase::IncidenceType FreeBusy::type() const
Reimplements: IncidenceBase::type() const.
[override virtual]
QByteArray FreeBusy::typeStr() const
Reimplements: IncidenceBase::typeStr() const.
[override virtual protected]
void FreeBusy::virtual_hook(KCalendarCore::IncidenceBase::VirtualHook id, void *data)
Reimplements: IncidenceBase::virtual_hook(KCalendarCore::IncidenceBase::VirtualHook id, void *data).