2024-04-13 11:52:42 +02:00
|
|
|
/*
|
2024-04-10 16:53:18 +02:00
|
|
|
* Mirai. Copyright (C) 2024 Vyn
|
|
|
|
* This file is licensed under version 3 of the GNU General Public License (GPL-3.0-only)
|
|
|
|
* The license can be found in the LICENSE file or at https://www.gnu.org/licenses/gpl-3.0.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "TaskItem.h"
|
2024-04-12 20:58:13 +02:00
|
|
|
#include "cpp-utils/vector.h"
|
2024-04-10 16:53:18 +02:00
|
|
|
|
2024-04-13 11:52:42 +02:00
|
|
|
namespace mirai
|
|
|
|
{
|
2024-04-10 16:53:18 +02:00
|
|
|
|
2024-04-13 11:52:42 +02:00
|
|
|
void TaskItem::markAsDone()
|
|
|
|
{
|
|
|
|
state = DONE;
|
|
|
|
}
|
2024-04-10 16:53:18 +02:00
|
|
|
|
2024-04-13 11:52:42 +02:00
|
|
|
void TaskItem::markAsUndone()
|
|
|
|
{
|
|
|
|
state = TODO;
|
|
|
|
}
|
2024-04-10 16:53:18 +02:00
|
|
|
|
2024-04-13 11:52:42 +02:00
|
|
|
void TaskItem::setDate(const std::string &date)
|
|
|
|
{
|
|
|
|
this->date = date;
|
|
|
|
}
|
2024-04-10 16:53:18 +02:00
|
|
|
|
2024-04-13 11:52:42 +02:00
|
|
|
void TaskItem::setText(const std::string &text)
|
|
|
|
{
|
|
|
|
this->text = text;
|
|
|
|
}
|
2024-04-10 16:53:18 +02:00
|
|
|
|
2024-04-13 11:52:42 +02:00
|
|
|
const std::string &TaskItem::getText() const
|
|
|
|
{
|
|
|
|
return text;
|
|
|
|
}
|
|
|
|
|
|
|
|
const TaskItemState &TaskItem::getState() const
|
|
|
|
{
|
|
|
|
return state;
|
|
|
|
}
|
2024-04-11 11:42:13 +02:00
|
|
|
|
2024-04-13 11:52:42 +02:00
|
|
|
const std::string &TaskItem::getDate() const
|
|
|
|
{
|
|
|
|
return date;
|
|
|
|
}
|
|
|
|
|
|
|
|
const std::string &TaskItem::getStartTime() const
|
|
|
|
{
|
|
|
|
return startTime;
|
|
|
|
}
|
|
|
|
|
|
|
|
const std::string &TaskItem::getEndTime() const
|
|
|
|
{
|
|
|
|
return endTime;
|
|
|
|
}
|
|
|
|
|
|
|
|
const Tags &TaskItem::getTags() const
|
|
|
|
{
|
|
|
|
return tags;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool TaskItem::hasDate() const
|
|
|
|
{
|
|
|
|
return isDate(date);
|
|
|
|
}
|
2024-04-11 11:42:13 +02:00
|
|
|
|
2024-04-13 11:52:42 +02:00
|
|
|
bool TaskItem::hasTag(const std::string &tag) const
|
|
|
|
{
|
|
|
|
return vectorUtils::contains(tags, tag);
|
2024-04-10 16:53:18 +02:00
|
|
|
}
|
2024-04-13 11:52:42 +02:00
|
|
|
} // namespace mirai
|