practice-timer/TimerTaskTree.h

37 lines
1.3 KiB
C
Raw Normal View History

2022-08-28 14:20:12 -07:00
#ifndef INCLUDED_TIMER_TASK_TREE_H
#define INCLUDED_TIMER_TASK_TREE_H
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define TIMER_TYPE_TASK_TREE timer_task_tree_get_type()
G_DECLARE_FINAL_TYPE(TimerTaskTree, timer_task_tree, TIMER, TASK_TREE, GtkTreeView)
GtkWidget *timer_task_tree_new();
/* time in seconds */
void timer_task_tree_add_task(TimerTaskTree *self, GDateTime *date, const char *task, gint64 time);
void timer_task_tree_set_task_names(TimerTaskTree *self, const char **names, gsize len);
const char** timer_task_tree_get_task_names(TimerTaskTree *self, gsize *len);
void timer_task_tree_update_header_dates(TimerTaskTree *self);
void timer_task_tree_set_data_path(TimerTaskTree *self, const char *path);
void timer_task_tree_save(TimerTaskTree *self);
void timer_task_tree_add_from_file(TimerTaskTree *self, const char *path);
char *timer_task_tree_get_csv(TimerTaskTree *self);
void timer_task_tree_expand_today(TimerTaskTree *self);
typedef struct {
GDateTime *date;
gint64 lenght;
} TimerDataPoint;
TimerDataPoint *timer_task_tree_get_day_data(TimerTaskTree *self, gsize *length);
TimerDataPoint *timer_task_tree_get_task_data(TimerTaskTree *self, gsize *length);
void timer_free_task_data(TimerDataPoint *data, gsize length);
GDateTime *timer_task_tree_get_last_task_end(TimerTaskTree *self);
G_END_DECLS
#endif /* INCLUDED_TIMER_TASK_TREE_H */