Files
bar/include/services/todo.hpp
2025-12-21 00:36:00 +01:00

22 lines
505 B
C++

#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;
};