GtdTaskListView: GNOME To Do - Reference Manual

## GtdTaskListView GtdTaskListView — A widget to display tasklists |

## Functions

void | (*GtdTaskListViewHeaderFunc) ()
gint | (*GtdTaskListViewSortFunc) ()
GtkWidget * | gtd_task_list_view_new ()
GList * | gtd_task_list_view_get_list ()
void | gtd_task_list_view_set_list ()
GtdTaskList * | gtd_task_list_view_get_task_list ()
void | gtd_task_list_view_set_task_list ()
gboolean | gtd_task_list_view_get_show_list_name ()
void | gtd_task_list_view_set_show_list_name ()
gboolean | gtd_task_list_view_get_show_completed ()
void | gtd_task_list_view_set_show_completed ()
void | gtd_task_list_view_set_header_func ()
void | gtd_task_list_view_set_sort_func ()
gboolean | gtd_task_list_view_get_show_new_task_row ()
void | gtd_task_list_view_set_show_new_task_row ()
GDateTime * | gtd_task_list_view_get_default_date ()
void | gtd_task_list_view_set_default_date ()
GdkRGBA * | gtd_task_list_view_get_color ()
void | gtd_task_list_view_set_color ()

## 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

## Types and Values

#define | GTD_TYPE_TASK_LIST_VIEW
| GtdTaskListView

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkWidget
                ╰── GtkContainer
                    ╰── GtkBin
                        ╰── GtkOverlay
                            ╰── GtdTaskListView

## Implemented Interfaces

GtdTaskListView implements AtkImplementorIface and GtkBuildable.

## 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 `row` represents |
before | the GtkListBoxRow before `row` |
before_task | the GtdTask that `before` represents |
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 `row` represents |
row2 | the GtkListBoxRow before `row` |
row2_task | the GtdTask that `before` represents |
user_data | user data. | [closure]

### gtd_task_list_view_new ()

    GtkWidget *
    gtd_task_list_view_new (void);

Creates a new GtdTaskListView

#### Returns

a newly allocated GtdTaskListView.

[transfer full]

### 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.

#### Parameters

view | a GtdTaskListView |

#### Returns

the internal list of tasks. Free with `g_list_free` after use.

[element-type Gtd.TaskList][transfer full]

### gtd_task_list_view_set_list ()

    void
    gtd_task_list_view_set_list (GtdTaskListView *view,
                                 GList *list);

Copies the tasks from `list` to `view` .

#### Parameters

view | a GtdTaskListView |
list | a list of tasks. | [element-type Gtd.Task][nullable]

### 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.

#### Parameters

view | a GtdTaskListView |

#### Returns

the `GtdTaskList` of `view` , or `NULL` is none was set.

[transfer none]

### 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` .

#### Parameters

view | a GtdTaskListView |
list | a GtdTaskList |

### 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.

#### Parameters

view | a GtdTaskListView |

#### Returns

`TRUE` if `view` show the tasks' list names, `FALSE` otherwise

### 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.

#### Parameters

view | a GtdTaskListView |
show_list_name | `TRUE` to show list names, `FALSE` to hide it |

### 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.

#### Parameters

view | a GtdTaskListView |

#### Returns

`TRUE` if completed tasks are visible, `FALSE` if they are hidden

### 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` .

#### Parameters

view | a GtdTaskListView |
show_completed | `TRUE` to show completed tasks, `FALSE` to hide them |

### 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.

#### Parameters

view | a GtdTaskListView |
func | the header function. | [closure user_data][scope call][nullable]
user_data | data passed to `func` |

### 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.

#### Parameters

view | a GtdTaskListView |
func | the sort function. | [closure user_data][scope call][nullable]
user_data | data passed to `func` |

### 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.

#### Parameters

view | a GtdTaskListView |

#### Returns

`TRUE` if `view` is shows the new task row, `FALSE` otherwise

### 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` .

#### Parameters

view | a GtdTaskListView |

### 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.

#### Parameters

self | a GtdTaskListView |

#### Returns

a GDateTime, or `NULL`.

[nullable]

### 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.

#### Parameters

self | a GtdTaskListView |
default_date | the default_date, or `NULL`. | [nullable]

### gtd_task_list_view_get_color ()

    GdkRGBA *
    gtd_task_list_view_get_color (GtdTaskListView *self);

Retrieves the custom color of `self` .

#### Parameters

self | a GtdTaskListView |

#### Returns

a GdkRGBA, or `NULL` if none is set.

[nullable]

### 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.

#### Parameters

self | a GtdTaskListView |
color | a GdkRGBA. | [nullable]

## Types and Values

### GTD_TYPE_TASK_LIST_VIEW

    #define GTD_TYPE_TASK_LIST_VIEW (gtd_task_list_view_get_type())

### GtdTaskListView

    typedef struct _GtdTaskListView GtdTaskListView;

## Property Details

### The `“color”` property

      “color”                    GdkRGBA *

The custom color of this task list view.

Flags: Read / Write

### 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