This repository has been archived on 2026-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
powersync-core/server/time/repeatingoption.cpp
2019-04-01 20:48:17 +02:00

71 lines
2.3 KiB
C++

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Copyright (C) 2016 Simon Stuerz <simon.stuerz@guh.guru> *
* *
* This file is part of guh. *
* *
* Guh is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, version 2 of the License. *
* *
* Guh is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with guh. If not, see <http://www.gnu.org/licenses/>. *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*!
\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 {
RepeatingOption::RepeatingOption() :
m_mode(RepeatingModeNone)
{
}
RepeatingOption::RepeatingOption(const RepeatingMode &mode, const QList<int> &weekDays, const QList<int> &monthDays) :
m_mode(mode),
m_weekDays(weekDays),
m_monthDays(monthDays)
{
}
RepeatingOption::RepeatingMode RepeatingOption::mode() const
{
return m_mode;
}
QList<int> RepeatingOption::weekDays() const
{
return m_weekDays;
}
QList<int> RepeatingOption::monthDays() const
{
return m_monthDays;
}
bool RepeatingOption::isEmtpy() const
{
return m_mode == RepeatingModeNone && m_weekDays.isEmpty() && m_monthDays.isEmpty();
}
}