GtdTaskList: GNOME To Do - Reference Manual

## GtdTaskList GtdTaskList — a list of tasks |

## Stability Level

Unstable, unless otherwise indicated

## Functions

GtdTaskList * | gtd_task_list_new ()
GdkRGBA * | gtd_task_list_get_color ()
void | gtd_task_list_set_color ()
gboolean | gtd_task_list_is_removable ()
void | gtd_task_list_set_is_removable ()
const gchar * | gtd_task_list_get_name ()
void | gtd_task_list_set_name ()
GtdProvider * | gtd_task_list_get_provider ()
void | gtd_task_list_set_provider ()
GList * | gtd_task_list_get_tasks ()
void | gtd_task_list_save_task ()
void | gtd_task_list_remove_task ()
gboolean | gtd_task_list_contains ()

## Properties

GdkRGBA * | color | Read / Write
gboolean | is-removable | Read / Write
char * | name | Read / Write
GtdProvider * | provider | Read / Write

## Signals

void | task-added | Run Last
void | task-removed | Run Last
void | task-updated | Run Last

## Types and Values

#define | GTD_TYPE_TASK_LIST
struct | GtdTaskListClass
| GtdTaskList

## Object Hierarchy

        GObject
        ╰── GtdObject
            ╰── GtdTaskList

## Description

A GtdTaskList represents a task list, and contains a list of tasks, a color, a name and the provider who generated it.

## Functions

### gtd_task_list_new ()

    GtdTaskList *
    gtd_task_list_new (GtdProvider *provider);

Creates a new list.

#### Parameters

provider | a GtdProvider. | [nullable]

#### Returns

the new GtdTaskList.

[transfer full]

### gtd_task_list_get_color ()

    GdkRGBA *
    gtd_task_list_get_color (GtdTaskList *list);

Retrieves the color of `list`. It is guarantee that it always returns a color, given a valid GtdTaskList.

#### Parameters

list | a GtdTaskList |

#### Returns

the color of `list`. Free with `gdk_rgba_free` after use.

[transfer full]

### gtd_task_list_set_color ()

    void
    gtd_task_list_set_color (GtdTaskList *list,
                             const GdkRGBA *color);

sets the color of `list` .

#### Parameters

list | a GtdTaskList color: a GdkRGBA |

### gtd_task_list_is_removable ()

    gboolean
    gtd_task_list_is_removable (GtdTaskList *list);

### gtd_task_list_set_is_removable ()

    void
    gtd_task_list_set_is_removable (GtdTaskList *list,
                                    gboolean is_removable);

Sets whether `list` can be deleted or not.

#### Parameters

list | a GtdTaskList |
is_removable | `TRUE` if `list` can be deleted, `FALSE` otherwise |

### gtd_task_list_get_name ()

    const gchar *
    gtd_task_list_get_name (GtdTaskList *list);

Retrieves the user-visible name of `list` , or `NULL`.

#### Parameters

list | a GtdTaskList |

#### Returns

the internal name of `list` . Do not free after use.

[transfer none]

### gtd_task_list_set_name ()

    void
    gtd_task_list_set_name (GtdTaskList *list,
                            const gchar *name);

Sets the `list` name to `name` .

#### Parameters

list | a GtdTaskList |
name | the name of `list` . | [nullable]

### gtd_task_list_get_provider ()

    GtdProvider *
    gtd_task_list_get_provider (GtdTaskList *list);

Retrieves the GtdProvider who owns this list.

#### Parameters

list | a GtdTaskList |

#### Returns

a GtdProvider.

[transfer none]

### gtd_task_list_set_provider ()

    void
    gtd_task_list_set_provider (GtdTaskList *self,
                                GtdProvider *provider);

Sets the provider of this tasklist.

#### Parameters

self | a GtdTaskList |
provider | a GtdProvider, or `NULL`. | [nullable]

### gtd_task_list_get_tasks ()

    GList *
    gtd_task_list_get_tasks (GtdTaskList *list);

Returns the list's tasks.

#### Parameters

list | a GtdTaskList |

#### Returns

a newly-allocated list of the list's tasks.

[element-type GtdTask][transfer container]

### gtd_task_list_save_task ()

    void
    gtd_task_list_save_task (GtdTaskList *list,
                             GtdTask *task);

Adds or updates `task` to `list` if it's not already present.

#### Parameters

list | a GtdTaskList |
task | a GtdTask |

### gtd_task_list_remove_task ()

    void
    gtd_task_list_remove_task (GtdTaskList *list,
                               GtdTask *task);

Removes `task` from `list` if it's inside the list.

#### Parameters

list | a GtdTaskList |
task | a GtdTask |

### gtd_task_list_contains ()

    gboolean
    gtd_task_list_contains (GtdTaskList *list,
                            GtdTask *task);

Checks if `task` is inside `list` .

#### Parameters

list | a GtdTaskList |
task | a GtdTask |

#### Returns

`TRUE` if `list` contains `task` , `FALSE` otherwise

## Types and Values

### GTD_TYPE_TASK_LIST

    #define GTD_TYPE_TASK_LIST (gtd_task_list_get_type())

### struct GtdTaskListClass

    struct GtdTaskListClass {
      GtdObjectClass        parent;

      void                  (*task_added)                           (GtdTaskList            *list,
                                                                     GtdTask                *task);

      void                  (*task_updated)                         (GtdTaskList            *list,
                                                                     GtdTask                *task);

      void                  (*task_removed)                         (GtdTaskList            *list,
                                                                     GtdTask                *task);

      gpointer              padding[10];
    };

### GtdTaskList

    typedef struct _GtdTaskList GtdTaskList;

## Property Details

### The `“color”` property

      “color”                    GdkRGBA *

The color of the list.

Owner: GtdTaskList

Flags: Read / Write

### The `“is-removable”` property

      “is-removable”             gboolean

Whether the task list can be removed from the system.

Owner: GtdTaskList

Flags: Read / Write

Default value: FALSE

### The `“name”` property

      “name”                     char *

The name of the list.

Owner: GtdTaskList

Flags: Read / Write

Default value: NULL

### The `“provider”` property

      “provider”                 GtdProvider *

The provider that handles the list.

Owner: GtdTaskList

Flags: Read / Write

## Signal Details

### The `“task-added”` signal

    void
    user_function (GtdTaskList *list,
                   GtdTask     *task,
                   gpointer     user_data)

The ::task-added signal is emmited after a GtdTask is added to the list.

#### Parameters

list | a GtdTaskList |
task | a GtdTask |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“task-removed”` signal

    void
    user_function (GtdTaskList *list,
                   GtdTask     *task,
                   gpointer     user_data)

The ::task-removed signal is emmited after a GtdTask is removed from the list.

#### Parameters

list | a GtdTaskList |
task | a GtdTask |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“task-updated”` signal

    void
    user_function (GtdTaskList *list,
                   GtdTask     *task,
                   gpointer     user_data)

The ::task-updated signal is emmited after a GtdTask in the list is updated.

#### Parameters

list | a GtdTaskList |
task | a GtdTask |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

## See Also

GtdTask