mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-03 10:13:42 +00:00
Support multiple files
This commit is contained in:
parent
f8f49233dc
commit
689eea07a7
22 changed files with 528 additions and 131 deletions
|
@ -8,24 +8,39 @@
|
|||
#define MIRAI_TASKITEM_H
|
||||
|
||||
#include "using.h"
|
||||
#include "utils.h"
|
||||
#include <ctime>
|
||||
#include <fstream>
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <regex>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace mirai
|
||||
{
|
||||
enum TaskItemState { TODO, DONE };
|
||||
|
||||
struct TaskItem {
|
||||
struct TaskItemData {
|
||||
std::string text;
|
||||
TaskItemState state;
|
||||
std::string date;
|
||||
std::string startTime;
|
||||
std::string endTime;
|
||||
Tags tags;
|
||||
};
|
||||
|
||||
class TasksFile;
|
||||
|
||||
class TaskItem
|
||||
{
|
||||
friend TasksFile;
|
||||
|
||||
private:
|
||||
public:
|
||||
TaskItem(TasksFile *parent, const TaskItemData data);
|
||||
|
||||
TaskItem &operator=(const TaskItemData &newData)
|
||||
{
|
||||
data = newData;
|
||||
onChange();
|
||||
return *this;
|
||||
};
|
||||
|
||||
void markAsDone();
|
||||
|
||||
void markAsUndone();
|
||||
|
@ -43,12 +58,11 @@ struct TaskItem {
|
|||
bool hasTag(const std::string &tag) const;
|
||||
bool hasDate() const;
|
||||
|
||||
std::string text;
|
||||
TaskItemState state;
|
||||
std::string date;
|
||||
std::string startTime;
|
||||
std::string endTime;
|
||||
Tags tags;
|
||||
private:
|
||||
void onChange();
|
||||
|
||||
TasksFile *parent;
|
||||
TaskItemData data;
|
||||
};
|
||||
} // namespace mirai
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue