From 63703e8da040ddf4991334007b8233da6b52d015 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Tue, 29 Mar 2016 15:21:48 +0200 Subject: [PATCH] add some docs --- server/time/calendaritem.cpp | 23 +++++++++++++++++++++++ server/time/repeatingoption.cpp | 11 +++++++++++ server/time/timedescriptor.cpp | 21 +++++++++++++++++++++ 3 files changed, 55 insertions(+) diff --git a/server/time/calendaritem.cpp b/server/time/calendaritem.cpp index 8b5c8ec8..a19a3b72 100644 --- a/server/time/calendaritem.cpp +++ b/server/time/calendaritem.cpp @@ -18,15 +18,28 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/*! + \class guhserver::CalendarItem + \brief Describes a clendar item for a time based \l{guhserver::Rule}{Rule}. + + \ingroup rules + \inmodule core + + \sa Rule, TimeDescriptor +*/ + #include "calendaritem.h" namespace guhserver { + +/*! Construct a invalid \l{CalendarItem}.*/ CalendarItem::CalendarItem() { } +/*! Construct a \l{CalendarItem} with the given \a startTime, \a duration and \a repeatingOption.*/ CalendarItem::CalendarItem(const QTime &startTime, const QTime &duration, const RepeatingOption &repeatingOption) : m_startTime(startTime), m_duration(duration), @@ -35,21 +48,31 @@ CalendarItem::CalendarItem(const QTime &startTime, const QTime &duration, const } +/*! Returns the start time of this \l{CalendarItem}.*/ QTime CalendarItem::startTime() const { return m_startTime; } +/*! Returns the duratiorn of this \l{CalendarItem}.*/ QTime CalendarItem::duration() const { return m_duration; } +/*! Returns the \l{RepeatingOption} of this \l{CalendarItem}.*/ +RepeatingOption CalendarItem::repeatingOption() const +{ + return m_repeatingOption; +} + +/*! Returns true if this \l{CalendarItem} is valid. A \l{CalendarItem} is valid if the start time and the duration are set.*/ bool CalendarItem::isValid() const { return !m_startTime.isNull() && !m_duration.isNull(); } +/*! Returns true, if the given \a dateTime matches this \l{CalendarItem}.*/ bool CalendarItem::evaluate(const QDateTime &dateTime) const { Q_UNUSED(dateTime) diff --git a/server/time/repeatingoption.cpp b/server/time/repeatingoption.cpp index 43ec7845..45517d0c 100644 --- a/server/time/repeatingoption.cpp +++ b/server/time/repeatingoption.cpp @@ -18,6 +18,17 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/*! + \class guhserver::RepeatingOption + \brief Describes a clendar item for a time based \l{guhserver::Rule}{Rule}. + + \ingroup rules + \inmodule core + + \sa Rule, TimeDescriptor +*/ + + #include "repeatingoption.h" namespace guhserver { diff --git a/server/time/timedescriptor.cpp b/server/time/timedescriptor.cpp index ca1ea8a9..36ca0daa 100644 --- a/server/time/timedescriptor.cpp +++ b/server/time/timedescriptor.cpp @@ -18,35 +18,56 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/*! + \class guhserver::TimeDescriptor + \brief Describes the time elements of a time based \l{guhserver::Rule}{Rule}. + + \ingroup rules + \inmodule core + + A time based rule can be described with a \l{TimeDescriptor}. The \l{TimeDescriptor} + can have either a list of \l{TimeEventItem}{TimeEventItems} or a list of \l{CalendarItem}{CalendarItems}, + never both. + + \sa Rule, TimeEventItem, CalendarItem +*/ + #include "timedescriptor.h" namespace guhserver { +/*! Constructs an invalid \l{TimeDescriptor}.*/ TimeDescriptor::TimeDescriptor() { } +/*! Returns the list of \l{TimeEventItem}{TimeEventItems} of this \l{TimeDescriptor}.*/ QList TimeDescriptor::timeEventItems() const { return m_timeEventItems; } +/*! Set the list of \l{TimeEventItem}{TimeEventItems} of this \l{TimeDescriptor} to the given \a timeEventItems.*/ void TimeDescriptor::setTimeEventItems(const QList &timeEventItems) { m_timeEventItems = timeEventItems; } +/*! Returns the list of \l{CalendarItem}{CalendarItems} of this \l{TimeDescriptor}.*/ QList TimeDescriptor::calendarItems() const { return m_calendarItems; } +/*! Set the list of \l{CalendarItem}{CalendarItems} of this \l{TimeDescriptor} to the given \a calendarItems.*/ void TimeDescriptor::setCalendarItems(const QList &calendarItems) { m_calendarItems = calendarItems; } +/*! Returns true if either the calendarItems list is not empty or the timeEventItems list.*/ bool TimeDescriptor::isValid() const { return !m_timeEventItems.isEmpty() || !m_calendarItems.isEmpty();