Desktop

/* $Id: todo.h,v 1.10 2010/09/14 21:47:07 khorben Exp $ */
/* Copyright (c) 2010 Pierre Pronchery <khorben@defora.org> */
/* This file is part of DeforaOS Desktop Todo */
/* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef TODO_TODO_H
# define TODO_TODO_H
# include "task.h"
# include <gtk/gtk.h>
/* Todo */
/* types */
typedef struct _Todo Todo;
typedef enum _TodoPriority
{
TODO_PRIORITY_UNKNOWN,
TODO_PRIORITY_LOW,
TODO_PRIORITY_MEDIUM,
TODO_PRIORITY_HIGH,
TODO_PRIORITY_URGENT
} TodoPriority;
typedef enum _TodoView
{
TODO_VIEW_ALL_TASKS = 0,
TODO_VIEW_COMPLETED_TASKS,
TODO_VIEW_REMAINING_TASKS
} TodoView;
# define TODO_VIEW_LAST TODO_VIEW_REMAINING_TASKS
# define TODO_VIEW_COUNT (TODO_VIEW_LAST + 1)
/* functions */
Todo * todo_new(void);
void todo_delete(Todo * todo);
/* accessors */
TodoView todo_get_view(Todo * todo);
void todo_set_view(Todo * todo, TodoView view);
/* useful */
void todo_about(Todo * todo);
int todo_error(Todo * todo, char const * message, int ret);
/* tasks */
Task * todo_task_add(Todo * todo, Task * task);
void todo_task_delete_selected(Todo * todo);
void todo_task_remove_all(Todo * todo);
/* accessors */
void todo_task_set_priority(Todo * todo, GtkTreePath * path,
char const * priority);
void todo_task_set_title(Todo * todo, GtkTreePath * path, char const * title);
void todo_task_edit(Todo * todo);
int todo_task_reload_all(Todo * todo);
void todo_task_save_all(Todo * todo);
void todo_task_select_all(Todo * todo);
void todo_task_toggle_done(Todo * todo, GtkTreePath * path);
#endif /* !TODO_TODO_H */