Top |
Functions
Properties
GdkRGBA * | color | Read / Write |
gboolean | handle-subtasks | Read / Write |
gboolean | show-completed | Read / Write |
gboolean | show-due-date | Read / Write |
gboolean | show-list-name | Read / Write |
gboolean | show-new-task-row | Read / Write |
Object Hierarchy
GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkContainer ╰── GtkBin ╰── GtkOverlay ╰── GtdTaskListView
Description
The GtdTaskListView widget shows the tasks of a GtdTaskList with various options to fine-tune the appearance. Alternatively, one can pass a GList of GtdTask objects.
It supports custom sorting and header functions, so the tasks can be sorted in various ways. See the "Today" and "Scheduled" panels for reference implementations.
Example:
1 2 3 4 5 6 7 8 9 |
GtdTaskListView *view = gtd_task_list_view_new (); gtd_task_list_view_set_list (view, list); // Hide the '+ New task' row gtd_task_list_view_set_show_new_task_row (view, FALSE); // Date which tasks will be automatically assigned gtd_task_list_view_set_default_date (view, now); |
Functions
GtdTaskListViewHeaderFunc ()
void (*GtdTaskListViewHeaderFunc) (GtkListBoxRow *row
,GtdTask *row_task
,GtkListBoxRow *before
,GtdTask *before_task
,gpointer user_data
);
The header function called on every task.
Parameters
row |
the current GtkListBoxRow |
|
row_task |
the GtdTask that |
|
before |
the GtkListBoxRow before |
|
before_task |
the GtdTask that |
|
user_data |
user data. |
[closure] |
GtdTaskListViewSortFunc ()
gint (*GtdTaskListViewSortFunc) (GtkListBoxRow *row1
,GtdTask *row1_task
,GtkListBoxRow *row2
,GtdTask *row2_task
,gpointer user_data
);
The sorting function called on every task.
Parameters
row1 |
the current GtkListBoxRow |
|
row1_task |
the GtdTask that |
|
row2 |
the GtkListBoxRow before |
|
row2_task |
the GtdTask that |
|
user_data |
user data. |
[closure] |
gtd_task_list_view_get_list ()
GList *
gtd_task_list_view_get_list (GtdTaskListView *view
);
Retrieves the list of tasks from view
. Note that,
if a GtdTaskList is set, the GtdTaskList's list
of task will be returned.
gtd_task_list_view_set_list ()
void gtd_task_list_view_set_list (GtdTaskListView *view
,GList *list
);
Copies the tasks from list
to view
.
gtd_task_list_view_get_task_list ()
GtdTaskList *
gtd_task_list_view_get_task_list (GtdTaskListView *view
);
Retrieves the GtdTaskList from view
, or NULL
if none was set.
gtd_task_list_view_set_task_list ()
void gtd_task_list_view_set_task_list (GtdTaskListView *view
,GtdTaskList *list
);
Sets the internal GtdTaskList of view
.
gtd_task_list_view_get_show_list_name ()
gboolean
gtd_task_list_view_get_show_list_name (GtdTaskListView *view
);
Whether view
shows the tasks' list names.
gtd_task_list_view_set_show_list_name ()
void gtd_task_list_view_set_show_list_name (GtdTaskListView *view
,gboolean show_list_name
);
Whether view
should should it's tasks' list name.
gtd_task_list_view_get_show_completed ()
gboolean
gtd_task_list_view_get_show_completed (GtdTaskListView *view
);
Returns TRUE
if completed tasks are visible, FALSE
otherwise.
gtd_task_list_view_set_show_completed ()
void gtd_task_list_view_set_show_completed (GtdTaskListView *view
,gboolean show_completed
);
Sets the ::show-completed property to show_completed
.
gtd_task_list_view_set_header_func ()
void gtd_task_list_view_set_header_func (GtdTaskListView *view
,GtdTaskListViewHeaderFunc func
,gpointer user_data
);
Sets func
as the header function of view
. You can safely call
gtk_list_box_row_set_header
from within func
.
Do not unref nor free any of the passed data.
gtd_task_list_view_set_sort_func ()
void gtd_task_list_view_set_sort_func (GtdTaskListView *view
,GtdTaskListViewSortFunc func
,gpointer user_data
);
Sets func
as the sorting function of view
.
Do not unref nor free any of the passed data.
gtd_task_list_view_get_show_new_task_row ()
gboolean
gtd_task_list_view_get_show_new_task_row
(GtdTaskListView *view
);
Gets whether view
shows the new task row or not.
gtd_task_list_view_set_show_new_task_row ()
void gtd_task_list_view_set_show_new_task_row (GtdTaskListView *view
,gboolean show_new_task_row
);
Sets the “show-new-task-mode” property of view
.
gtd_task_list_view_get_default_date ()
GDateTime *
gtd_task_list_view_get_default_date (GtdTaskListView *self
);
Retrieves the current default date which new tasks are set to.
gtd_task_list_view_set_default_date ()
void gtd_task_list_view_set_default_date (GtdTaskListView *self
,GDateTime *default_date
);
Sets the current default date.
gtd_task_list_view_get_color ()
GdkRGBA *
gtd_task_list_view_get_color (GtdTaskListView *self
);
Retrieves the custom color of self
.
gtd_task_list_view_set_color ()
void gtd_task_list_view_set_color (GtdTaskListView *self
,GdkRGBA *color
);
Sets the custom color of self
to color
. If a custom color is set,
the tasklist's color is ignored. Passing NULL
makes the tasklist's
color apply again.
Property Details
The “handle-subtasks”
property
“handle-subtasks” gboolean
Whether the list handles subtasks, or not.
Flags: Read / Write
Default value: TRUE
The “show-completed”
property
“show-completed” gboolean
Whether completed tasks are visible or not.
Flags: Read / Write
Default value: FALSE
The “show-due-date”
property
“show-due-date” gboolean
Whether due dates of the tasks are visible or not.
Flags: Read / Write
Default value: TRUE
The “show-list-name”
property
“show-list-name” gboolean
Whether task rows show the list name at the end of the row.
Flags: Read / Write
Default value: FALSE
The “show-new-task-row”
property
“show-new-task-row” gboolean
Whether the list shows the New Task row, or not.
Flags: Read / Write
Default value: TRUE