add todo setup

This commit is contained in:
2025-12-21 00:36:00 +01:00
parent 36f8b6d8b2
commit 22a1b7e369
13 changed files with 277 additions and 31 deletions

22
include/services/todo.hpp Normal file
View File

@@ -0,0 +1,22 @@
#pragma once
#include "components/todoEntry.hpp"
#include <string>
#include <vector>
class TodoService {
public:
TodoService(sigc::signal<void()> refreshSignal);
~TodoService();
std::map<int, TodoEntry *> getTodos();
void init();
void removeTodo(int id);
TodoEntry *addTodo(std::string text, bool emitSignal = true);
void updateTodo(int id, std::string text);
private:
int nextId = 1;
std::map<int, TodoEntry *> todos;
sigc::signal<void()> refreshSignal;
};