add todo setup
This commit is contained in:
22
include/services/todo.hpp
Normal file
22
include/services/todo.hpp
Normal 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;
|
||||
};
|
||||
Reference in New Issue
Block a user