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
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MIRAI_MIRAI_H
|
|
|
|
#define MIRAI_MIRAI_H
|
|
|
|
|
|
|
|
#include "TaskItem.h"
|
|
|
|
#include "TasksFile.h"
|
|
|
|
#include "TodoMd.h"
|
|
|
|
#include <algorithm>
|
2024-04-14 14:11:41 +02:00
|
|
|
#include <functional>
|
2024-04-10 16:53:18 +02:00
|
|
|
#include <memory>
|
2024-04-14 14:11:41 +02:00
|
|
|
#include <optional>
|
|
|
|
#include <string>
|
2024-04-10 16:53:18 +02:00
|
|
|
|
2024-04-13 11:52:42 +02:00
|
|
|
namespace mirai
|
|
|
|
{
|
|
|
|
|
|
|
|
class Mirai
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
void loadFile(const std::string &path);
|
|
|
|
void save();
|
2024-04-14 14:11:41 +02:00
|
|
|
void addTask(TaskItemData taskItem);
|
2024-04-13 11:52:42 +02:00
|
|
|
void addTask(std::string text, std::string date);
|
|
|
|
void removeTask(const TaskItem *taskItem);
|
2024-04-14 14:11:41 +02:00
|
|
|
void addFile(TasksFileConfig config);
|
|
|
|
std::optional<std::reference_wrapper<TasksFile>> getFileByPath(const std::string &path);
|
2024-04-13 11:52:42 +02:00
|
|
|
|
2024-04-14 14:11:41 +02:00
|
|
|
std::vector<std::unique_ptr<TasksFile>> &getFiles();
|
2024-04-13 11:52:42 +02:00
|
|
|
const std::vector<std::string> &getTags();
|
|
|
|
|
2024-04-15 09:37:28 +02:00
|
|
|
void reloadTags();
|
|
|
|
|
2024-04-13 11:52:42 +02:00
|
|
|
private:
|
2024-04-17 17:34:26 +02:00
|
|
|
std::vector<std::unique_ptr<TasksFile>> files = std::vector<std::unique_ptr<TasksFile>>();
|
2024-04-13 11:52:42 +02:00
|
|
|
std::vector<std::string> tags;
|
|
|
|
};
|
|
|
|
} // namespace mirai
|
2024-04-10 16:53:18 +02:00
|
|
|
#endif
|