#include <calendaritem.h>
Classes | |
struct | Point |
struct | Time |
Public Member Functions | |
CalendarItem ()=default | |
CalendarItem (const Point &point, const std::string &title) | |
bool | init (utility::ErrorState &errorState) override |
virtual bool | active (SystemTimeStamp timeStamp) const =0 |
void | setTitle (const std::string &title) |
const std::string & | getTitle () const |
void | setDescription (const std::string &description) |
const std::string & | getDescription () const |
bool | setPoint (const Point &point) |
const Point & | getPoint () const |
bool | setTime (const Time &time) |
const Time & | getTime () const |
void | setDuration (const Time &duration) |
const Time & | getDuration () const |
![]() | |
Resource () | |
![]() | |
Object () | |
virtual | ~Object () |
virtual void | onDestroy () |
Object (Object &)=delete | |
Object & | operator= (const Object &)=delete |
Object (Object &&)=delete | |
Object & | operator= (Object &&)=delete |
Public Attributes | |
std::string | mTitle = "" |
Property: 'Title' item title. More... | |
Point | mPoint |
Property; 'Point' point in time together with duration. More... | |
std::string | mDescription = "" |
Property: 'Description' item description. More... | |
![]() | |
std::string | mID |
Property: 'mID' unique name of the object. Used as an identifier by the system. More... | |
Additional Inherited Members | |
![]() | |
static bool | isIDProperty (rtti::Instance &object, const rtti::Property &property) |
Base class of all calendar items. Every item has a start time and duration. The title and description are optional. Calendar item resolution is minutes (by default).
Derived classes must override active(). That method defines if the item currently 'occurs' based on the given timestamp.
|
default |
CalendarItem | ( | const Point & | point, |
const std::string & | title | ||
) |
|
pure virtual |
Returns if the current item is active based on the specified 'Time', 'Duration' and other properties of this item. Must be implemented in derived classes.
timeStamp | time to validate, for example the current system time |
Implemented in DailyCalendarItem, WeeklyCalendarItem, MonthlyCalendarItem, YearlyCalendarItem, and UniqueCalendarItem.
const std::string& getDescription | ( | ) | const |
const Time& getDuration | ( | ) | const |
const Point& getPoint | ( | ) | const |
const Time& getTime | ( | ) | const |
const std::string& getTitle | ( | ) | const |
|
overridevirtual |
Initializes the calendar item, always call this in derived classes. Ensures the given time is valid.
Reimplemented from Object.
Reimplemented in DailyCalendarItem, WeeklyCalendarItem, MonthlyCalendarItem, YearlyCalendarItem, and UniqueCalendarItem.
void setDescription | ( | const std::string & | description | ) |
Updates item description
description | new item description |
void setDuration | ( | const Time & | duration | ) |
Updates item duration.
duration | new duration |
bool setPoint | ( | const Point & | point | ) |
Updates item time and duration and ensures new settings are valid.
point | new time and duration |
bool setTime | ( | const Time & | time | ) |
Updates time and ensures it is valid.
time | new time |
void setTitle | ( | const std::string & | title | ) |
Updates item title
title | new item title |
std::string mDescription = "" |
Property: 'Description' item description.
std::string mTitle = "" |
Property: 'Title' item title.