add some docs

This commit is contained in:
Simon Stürz 2016-03-29 15:21:48 +02:00 committed by Michael Zanetti
parent affcb1ddf6
commit 63703e8da0
3 changed files with 55 additions and 0 deletions

View File

@ -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" #include "calendaritem.h"
namespace guhserver { namespace guhserver {
/*! Construct a invalid \l{CalendarItem}.*/
CalendarItem::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) : CalendarItem::CalendarItem(const QTime &startTime, const QTime &duration, const RepeatingOption &repeatingOption) :
m_startTime(startTime), m_startTime(startTime),
m_duration(duration), 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 QTime CalendarItem::startTime() const
{ {
return m_startTime; return m_startTime;
} }
/*! Returns the duratiorn of this \l{CalendarItem}.*/
QTime CalendarItem::duration() const QTime CalendarItem::duration() const
{ {
return m_duration; 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 bool CalendarItem::isValid() const
{ {
return !m_startTime.isNull() && !m_duration.isNull(); 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 bool CalendarItem::evaluate(const QDateTime &dateTime) const
{ {
Q_UNUSED(dateTime) Q_UNUSED(dateTime)

View File

@ -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" #include "repeatingoption.h"
namespace guhserver { namespace guhserver {

View File

@ -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" #include "timedescriptor.h"
namespace guhserver { namespace guhserver {
/*! Constructs an invalid \l{TimeDescriptor}.*/
TimeDescriptor::TimeDescriptor() TimeDescriptor::TimeDescriptor()
{ {
} }
/*! Returns the list of \l{TimeEventItem}{TimeEventItems} of this \l{TimeDescriptor}.*/
QList<TimeEventItem> TimeDescriptor::timeEventItems() const QList<TimeEventItem> TimeDescriptor::timeEventItems() const
{ {
return m_timeEventItems; return m_timeEventItems;
} }
/*! Set the list of \l{TimeEventItem}{TimeEventItems} of this \l{TimeDescriptor} to the given \a timeEventItems.*/
void TimeDescriptor::setTimeEventItems(const QList<TimeEventItem> &timeEventItems) void TimeDescriptor::setTimeEventItems(const QList<TimeEventItem> &timeEventItems)
{ {
m_timeEventItems = timeEventItems; m_timeEventItems = timeEventItems;
} }
/*! Returns the list of \l{CalendarItem}{CalendarItems} of this \l{TimeDescriptor}.*/
QList<CalendarItem> TimeDescriptor::calendarItems() const QList<CalendarItem> TimeDescriptor::calendarItems() const
{ {
return m_calendarItems; return m_calendarItems;
} }
/*! Set the list of \l{CalendarItem}{CalendarItems} of this \l{TimeDescriptor} to the given \a calendarItems.*/
void TimeDescriptor::setCalendarItems(const QList<CalendarItem> &calendarItems) void TimeDescriptor::setCalendarItems(const QList<CalendarItem> &calendarItems)
{ {
m_calendarItems = calendarItems; m_calendarItems = calendarItems;
} }
/*! Returns true if either the calendarItems list is not empty or the timeEventItems list.*/
bool TimeDescriptor::isValid() const bool TimeDescriptor::isValid() const
{ {
return !m_timeEventItems.isEmpty() || !m_calendarItems.isEmpty(); return !m_timeEventItems.isEmpty() || !m_calendarItems.isEmpty();