| GPE Manual: libtododb Reference |
|---|
Todo DBTodo DB — Todo Database |
enum item_state; struct todo_item; #define PRIORITY_HIGH #define PRIORITY_STANDARD #define PRIORITY_LOW struct todo_item* todo_db_new_item (void); gboolean todo_db_push_item (struct todo_item *i); void todo_db_delete_item (struct todo_item *i); void todo_db_destroy_item (struct todo_item *i); GSList* todo_db_get_items_list (void); int todo_db_start (void); void todo_db_stop (void); int todo_db_refresh (void);
typedef enum
{
NOT_STARTED,
IN_PROGRESS,
COMPLETED,
ABANDONED
} item_state;
Type to describe the progress status of a todo item.
| NOT_STARTED | Indicates a task which isn't started. |
| IN_PROGRESS | Task currently in progress. |
| COMPLETED | Task is marked as completed. |
| ABANDONED | Indicates an abandoned task. |
struct todo_item {
int id, pos;
time_t time;
const char *what;
const char *summary;
item_state state;
gboolean was_complete;
GSList *categories;
guint priority;
};
Data type describing a todo item including description and current status.
| int id; | Unique id. |
| int pos; | Position marker. |
| time_t time; | Timestamp holding due date. |
| const char *what; | Item title. |
| const char *summary; | Item description. |
| item_state state; | Item status (see item_state). |
| gboolean was_complete; | |
| GSList *categories; | List of categories the item belongs to. |
| guint priority; | Priority information. |
struct todo_item* todo_db_new_item (void);
Create a new todo item and add it to list and database.
| Returns : | New todo item. |
void todo_db_delete_item (struct todo_item *i);
Deletes an item from the list and database.
| i : | Todo item to delete. |
void todo_db_destroy_item (struct todo_item *i);
Frees a todo list item struct.
| i : | Todo item to destroy. |
GSList* todo_db_get_items_list (void);
Get a list of all todo items. The returned list points to the internal list used by libtododb and doesn't need to be freed. It is a good idea to consider it to be read only.
| Returns : | List of todo items. |
int todo_db_start (void);
Initialises libtododb for use.
| Returns : | 0 on success, -1 on failure. |
| << Programmers Interface | About >> |