#include <freebusy.h>

Public Types | |
typedef QVector< Ptr > | List |
typedef QSharedPointer< FreeBusy > | Ptr |
Public Member Functions | |
FreeBusy () | |
FreeBusy (const FreeBusy &other) | |
FreeBusy (const Period::List &busyPeriods) | |
FreeBusy (const FreeBusyPeriod::List &busyPeriods) | |
FreeBusy (const KDateTime &start, const KDateTime &end) | |
FreeBusy (const Event::List &events, const KDateTime &start, const KDateTime &end) | |
~FreeBusy () | |
void | addPeriod (const KDateTime &start, const KDateTime &end) |
void | addPeriod (const KDateTime &start, const Duration &duration) |
void | addPeriods (const Period::List &list) |
void | addPeriods (const FreeBusyPeriod::List &list) |
Period::List | busyPeriods () const |
KDateTime | dateTime (DateTimeRole role) const |
virtual KDateTime | dtEnd () const |
FreeBusyPeriod::List | fullBusyPeriods () const |
void | merge (FreeBusy::Ptr freebusy) |
QLatin1String | mimeType () const |
void | setDateTime (const KDateTime &dateTime, DateTimeRole role) |
void | setDtEnd (const KDateTime &end) |
virtual void | setDtStart (const KDateTime &start) |
virtual void | shiftTimes (const KDateTime::Spec &oldSpec, const KDateTime::Spec &newSpec) |
void | sortList () |
IncidenceType | type () const |
QByteArray | typeStr () const |
Static Public Member Functions | |
static QLatin1String | freeBusyMimeType () |
Protected Member Functions | |
virtual IncidenceBase & | assign (const IncidenceBase &other) |
virtual bool | equals (const IncidenceBase &freebusy) const |
virtual void | virtual_hook (int id, void *data) |
Friends | |
KCALCORE_EXPORT QDataStream & | operator<< (QDataStream &s, const KCalCore::FreeBusy::Ptr &freebusy) |
KCALCORE_EXPORT QDataStream & | operator>> (QDataStream &s, KCalCore::FreeBusy::Ptr &freebusy) |
Detailed Description
Provides information about the free/busy time of a calendar.
A free/busy is a collection of Periods (
- See also:
- Period).
Definition at line 52 of file freebusy.h.
Member Typedef Documentation
typedef QVector<Ptr> KCalCore::FreeBusy::List |
List of FreeBusy objects.
Definition at line 69 of file freebusy.h.
typedef QSharedPointer<FreeBusy> KCalCore::FreeBusy::Ptr |
A shared pointer to a FreeBusy object.
Reimplemented from KCalCore::IncidenceBase.
Definition at line 64 of file freebusy.h.
Constructor & Destructor Documentation
Constructs an free/busy without any periods.
Definition at line 77 of file freebusy.cpp.
FreeBusy::FreeBusy | ( | const FreeBusy & | other | ) |
Copy constructor.
- Parameters:
-
other is the free/busy to copy.
Definition at line 82 of file freebusy.cpp.
FreeBusy::FreeBusy | ( | const Period::List & | busyPeriods | ) | [explicit] |
Constructs a free/busy from a list of periods.
- Parameters:
-
busyPeriods is a list of periods.
Definition at line 190 of file freebusy.cpp.
FreeBusy::FreeBusy | ( | const FreeBusyPeriod::List & | busyPeriods | ) | [explicit] |
Constructs a free/busy from a list of periods.
- Parameters:
-
busyPeriods is a list of periods.
Definition at line 196 of file freebusy.cpp.
FreeBusy::FreeBusy | ( | const KDateTime & | start, |
const KDateTime & | end | ||
) |
Constructs a free/busy from a single period.
- Parameters:
-
start is the start datetime of the period. end is the end datetime of the period.
Definition at line 88 of file freebusy.cpp.
FreeBusy::FreeBusy | ( | const Event::List & | events, |
const KDateTime & | start, | ||
const KDateTime & | end | ||
) |
Constructs a freebusy for a specified list of events given a single period.
- Parameters:
-
events list of events. start is the start datetime of the period. end is the end datetime of the period.
Definition at line 95 of file freebusy.cpp.
Destroys a free/busy.
Definition at line 201 of file freebusy.cpp.
Member Function Documentation
void FreeBusy::addPeriod | ( | const KDateTime & | start, |
const KDateTime & | end | ||
) |
Adds a period to the freebusy list and sorts the list.
- Parameters:
-
start is the start datetime of the period. end is the end datetime of the period.
Definition at line 268 of file freebusy.cpp.
void FreeBusy::addPeriod | ( | const KDateTime & | start, |
const Duration & | duration | ||
) |
Adds a period to the freebusy list and sorts the list.
- Parameters:
-
start is the start datetime of the period. duration is the Duration of the period.
Definition at line 274 of file freebusy.cpp.
void FreeBusy::addPeriods | ( | const 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.
- Parameters:
-
list is a list of Period objects.
Definition at line 254 of file freebusy.cpp.
void FreeBusy::addPeriods | ( | const 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.
- Parameters:
-
list is a list of FreeBusyPeriod objects.
Definition at line 262 of file freebusy.cpp.
IncidenceBase & FreeBusy::assign | ( | const IncidenceBase & | other | ) | [protected, virtual] |
Provides polymorfic assignment.
- Parameters:
-
other is the IncidenceBase to assign.
Reimplemented from KCalCore::IncidenceBase.
Definition at line 311 of file freebusy.cpp.
Period::List FreeBusy::busyPeriods | ( | ) | const |
Returns the list of all periods within the free/busy.
Definition at line 232 of file freebusy.cpp.
KDateTime FreeBusy::dateTime | ( | DateTimeRole | role | ) | const [virtual] |
Returns a date/time corresponding to the specified DateTimeRole.
- Parameters:
-
role is a DateTimeRole.
Implements KCalCore::IncidenceBase.
Definition at line 339 of file freebusy.cpp.
KDateTime FreeBusy::dtEnd | ( | ) | const [virtual] |
Returns the end datetime for the free/busy.
FIXME: calling addPeriod() does not change mDtEnd. Is that incorrect?
- See also:
- setDtEnd().
Definition at line 227 of file freebusy.cpp.
bool FreeBusy::equals | ( | const IncidenceBase & | freebusy | ) | const [protected, virtual] |
Compare this with freebusy
for equality.
- Parameters:
-
freebusy is the FreeBusy to compare.
Reimplemented from KCalCore::IncidenceBase.
Definition at line 321 of file freebusy.cpp.
QLatin1String KCalCore::FreeBusy::freeBusyMimeType | ( | ) | [static] |
Returns the Akonadi specific sub MIME type of a KCalCore::FreeBusy.
Definition at line 401 of file freebusy.cpp.
Returns the list of all periods within the free/busy.
Definition at line 243 of file freebusy.cpp.
void FreeBusy::merge | ( | FreeBusy::Ptr | freebusy | ) |
Merges another free/busy into this free/busy.
- Parameters:
-
freebusy is a pointer to a valid FreeBusy object.
Definition at line 280 of file freebusy.cpp.
QLatin1String FreeBusy::mimeType | ( | ) | const [virtual] |
Returns the Akonadi specific sub MIME type of a KCalCore::IncidenceBase item, e.g.
getting "application/x-vnd.akonadi.calendar.event" for a KCalCore::Event.
Implements KCalCore::IncidenceBase.
Definition at line 396 of file freebusy.cpp.
void FreeBusy::setDateTime | ( | const KDateTime & | dateTime, |
DateTimeRole | role | ||
) | [virtual] |
Sets the date/time corresponding to the specified DateTimeRole.
- Parameters:
-
dateTime is KDateTime value to set. role is a DateTimeRole.
Implements KCalCore::IncidenceBase.
Definition at line 346 of file freebusy.cpp.
void FreeBusy::setDtEnd | ( | const KDateTime & | 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.
- Parameters:
-
end is a KDateTime specifying an end datetime.
- See also:
- dtEnd(), setDtStart().
Definition at line 222 of file freebusy.cpp.
void FreeBusy::setDtStart | ( | const KDateTime & | start | ) | [virtual] |
Sets the start datetime for the free/busy.
Note that this datetime may be later or earlier than all periods within the free/busy.
- Parameters:
-
start is a KDateTime specifying an start datetime.
- See also:
- IncidenceBase::dtStart(), setDtEnd().
Reimplemented from KCalCore::IncidenceBase.
Definition at line 216 of file freebusy.cpp.
void FreeBusy::shiftTimes | ( | const KDateTime::Spec & | oldSpec, |
const KDateTime::Spec & | newSpec | ||
) | [virtual] |
Shift the times of the incidence so that they appear at the same clock time as before but in a new time zone.
The shift is done from a viewing time zone rather than from the actual incidence time zone.
For example, shifting an incidence whose start time is 09:00 America/New York, using an old viewing time zone (oldSpec
) of Europe/London, to a new time zone (newSpec
) of Europe/Paris, will result in the time being shifted from 14:00 (which is the London time of the incidence start) to 14:00 Paris time.
- Parameters:
-
oldSpec the time specification which provides the clock times newSpec the new time specification
Reimplemented from KCalCore::IncidenceBase.
Definition at line 298 of file freebusy.cpp.
void FreeBusy::sortList | ( | ) |
Sorts the list of free/busy periods into ascending order.
Definition at line 248 of file freebusy.cpp.
IncidenceBase::IncidenceType FreeBusy::type | ( | ) | const [virtual] |
Returns the incidence type.
Implements KCalCore::IncidenceBase.
Definition at line 206 of file freebusy.cpp.
QByteArray FreeBusy::typeStr | ( | ) | const [virtual] |
Prints the type of incidence as a string.
Implements KCalCore::IncidenceBase.
Definition at line 211 of file freebusy.cpp.
void FreeBusy::virtual_hook | ( | int | id, |
void * | data | ||
) | [protected, virtual] |
Standard trick to add virtuals later.
- Parameters:
-
id is any integer unique to this class which we will use to identify the method to be called. data is a pointer to some glob of data, typically a struct.
Implements KCalCore::IncidenceBase.
Definition at line 352 of file freebusy.cpp.
Friends And Related Function Documentation
KCALCORE_EXPORT QDataStream& operator<< | ( | QDataStream & | s, |
const KCalCore::FreeBusy::Ptr & | freebusy | ||
) | [friend] |
Serializes the fb
object into the stream
.
KCALCORE_EXPORT QDataStream& operator>> | ( | QDataStream & | s, |
KCalCore::FreeBusy::Ptr & | freebusy | ||
) | [friend] |
Initializes the fb
object from the stream
.
The documentation for this class was generated from the following files: