GtdProvider: GNOME To Do - Reference Manual

## GtdProvider GtdProvider — data sources for GNOME To do |

## Stability Level

Unstable, unless otherwise indicated

## Functions

const gchar * | gtd_provider_get_id ()
const gchar * | gtd_provider_get_name ()
const gchar * | gtd_provider_get_description ()
gboolean | gtd_provider_get_enabled ()
GIcon * | gtd_provider_get_icon ()
const GtkWidget * | gtd_provider_get_edit_panel ()
void | gtd_provider_create_task ()
void | gtd_provider_update_task ()
void | gtd_provider_remove_task ()
void | gtd_provider_create_task_list ()
void | gtd_provider_update_task_list ()
void | gtd_provider_remove_task_list ()
GList * | gtd_provider_get_task_lists ()
GtdTaskList * | gtd_provider_get_default_task_list ()

## Properties

GtdTaskList * | default-task-list | Read / Write
gchar * | description | Read
gboolean | enabled | Read
GIcon * | icon | Read
gchar * | id | Read
gchar * | name | Read

## Signals

void | list-added | Run Last
void | list-changed | Run Last
void | list-removed | Run Last

## Types and Values

#define | GTD_TYPE_PROVIDER
struct | GtdProviderInterface
| GtdProvider

## Object Hierarchy

        GInterface
        ╰── GtdProvider

## Prerequisites

GtdProvider requires GtdObject.

## Description

The GtdProvider is the interface that GNOME To Do uses to connect to data sources. It must provide ways to create, update and remove tasks and tasklists.

A provider implementation must also expose which is the default tasklist among the tasklists it manages.

## Functions

### gtd_provider_get_id ()

    const gchar *
    gtd_provider_get_id (GtdProvider *provider);

Retrieves the identifier of `provider` .

#### Parameters

provider | a GtdProvider |

#### Returns

the id of `provider` .

[transfer none]

### gtd_provider_get_name ()

    const gchar *
    gtd_provider_get_name (GtdProvider *provider);

Retrieves the user-visible name of `provider` .

#### Parameters

provider | a GtdProvider |

#### Returns

the name of `provider` .

[transfer none]

### gtd_provider_get_description ()

    const gchar *
    gtd_provider_get_description (GtdProvider *provider);

Retrieves the description of `provider` .

#### Parameters

provider | a GtdProvider |

#### Returns

the description of `provider` .

[transfer none]

### gtd_provider_get_enabled ()

    gboolean
    gtd_provider_get_enabled (GtdProvider *provider);

Retrieves whether `provider` is enabled or not. A disabled provider cannot be selected to be default nor be selected to add tasks to it.

#### Parameters

provider | a GtdProvider |

#### Returns

`TRUE` if provider is enabled, `FALSE` otherwise.

### gtd_provider_get_icon ()

    GIcon *
    gtd_provider_get_icon (GtdProvider *provider);

The icon of `provider` .

#### Parameters

provider | a GtdProvider |

#### Returns

a GIcon.

[transfer none]

### gtd_provider_get_edit_panel ()

    const GtkWidget *
    gtd_provider_get_edit_panel (GtdProvider *provider);

### gtd_provider_create_task ()

    void
    gtd_provider_create_task (GtdProvider *provider,
                              GtdTask *task);

Creates the given task in `provider` .

#### Parameters

provider | a GtdProvider |
task | a GtdTask |

### gtd_provider_update_task ()

    void
    gtd_provider_update_task (GtdProvider *provider,
                              GtdTask *task);

Updates the given task in `provider` .

#### Parameters

provider | a GtdProvider |
task | a GtdTask |

### gtd_provider_remove_task ()

    void
    gtd_provider_remove_task (GtdProvider *provider,
                              GtdTask *task);

Removes the given task from `provider` .

#### Parameters

provider | a GtdProvider |
task | a GtdTask |

### gtd_provider_create_task_list ()

    void
    gtd_provider_create_task_list (GtdProvider *provider,
                                   GtdTaskList *list);

Creates the given list in `provider` .

#### Parameters

provider | a GtdProvider |
list | a GtdTaskList |

### gtd_provider_update_task_list ()

    void
    gtd_provider_update_task_list (GtdProvider *provider,
                                   GtdTaskList *list);

Updates the given list in `provider` .

#### Parameters

provider | a GtdProvider |
list | a GtdTaskList |

### gtd_provider_remove_task_list ()

    void
    gtd_provider_remove_task_list (GtdProvider *provider,
                                   GtdTaskList *list);

Removes the given list from `provider` .

#### Parameters

provider | a GtdProvider |
list | a GtdTaskList |

### gtd_provider_get_task_lists ()

    GList *
    gtd_provider_get_task_lists (GtdProvider *provider);

Retrieves the tasklists that this provider contains.

#### Parameters

provider | a GtdProvider |

#### Returns

the list of tasks, or `NULL`.

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

### gtd_provider_get_default_task_list ()

    GtdTaskList *
    gtd_provider_get_default_task_list (GtdProvider *provider);

Retrieves the default tasklist of `provider` .

#### Parameters

provider | a GtdProvider |

#### Returns

the default tasklist, or `NULL`.

[transfer none][nullable]

## Types and Values

### GTD_TYPE_PROVIDER

    #define GTD_TYPE_PROVIDER (gtd_provider_get_type ())

### struct GtdProviderInterface

    struct GtdProviderInterface {
      GTypeInterface parent;

      /* Information */
      const gchar*       (*get_id)                                   (GtdProvider        *provider);

      const gchar*       (*get_name)                                 (GtdProvider        *provider);

      const gchar*       (*get_description)                          (GtdProvider        *provider);

      gboolean           (*get_enabled)                              (GtdProvider        *provider);

      /* Customs */
      GIcon*             (*get_icon)                                 (GtdProvider        *provider);

      const GtkWidget*   (*get_edit_panel)                           (GtdProvider        *provider);

      /* Tasks */
      void               (*create_task)                              (GtdProvider        *provider,
                                                                      GtdTask            *task);

      void               (*update_task)                              (GtdProvider        *provider,
                                                                      GtdTask            *task);

      void               (*remove_task)                              (GtdProvider        *provider,
                                                                      GtdTask            *task);

      /* Task lists */
      void               (*create_task_list)                         (GtdProvider        *provider,
                                                                      GtdTaskList        *list);

      void               (*update_task_list)                         (GtdProvider        *provider,
                                                                      GtdTaskList        *list);

      void               (*remove_task_list)                         (GtdProvider        *provider,
                                                                      GtdTaskList        *list);

      GList*             (*get_task_lists)                           (GtdProvider        *provider);

      GtdTaskList*       (*get_default_task_list)                    (GtdProvider        *provider);

      void               (*set_default_task_list)                    (GtdProvider        *provider,
                                                                      GtdTaskList        *list);
    };

### GtdProvider

    typedef struct _GtdProvider GtdProvider;

## Property Details

### The `“default-task-list”` property

      “default-task-list”        GtdTaskList *

The default tasklist of the provider.

Flags: Read / Write

### The `“description”` property

      “description”              gchar *

The description of the provider.

Flags: Read

Default value: NULL

### The `“enabled”` property

      “enabled”                  gboolean

The identifier of the provider.

Flags: Read

Default value: FALSE

### The `“icon”` property

      “icon”                     GIcon *

The icon of the provider.

Flags: Read

### The `“id”` property

      “id”                       gchar *

The identifier of the provider.

Flags: Read

Default value: NULL

### The `“name”` property

      “name”                     gchar *

The user-visible name of the provider.

Flags: Read

Default value: NULL

## Signal Details

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

    void
    user_function (GtdProvider *provider,
                   GtdTaskList *list,
                   gpointer     user_data)

The ::list-added signal is emmited after a GtdTaskList is connected.

#### Parameters

provider | a GtdProvider |
list | a GtdTaskList |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“list-changed”` signal

    void
    user_function (GtdProvider *provider,
                   GtdTaskList *list,
                   gpointer     user_data)

The ::list-changed signal is emmited after a GtdTaskList has any of it's properties changed.

#### Parameters

provider | a GtdProvider |
list | a GtdTaskList |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

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

    void
    user_function (GtdProvider *provider,
                   GtdTaskList *list,
                   gpointer     user_data)

The ::list-removed signal is emmited after a GtdTaskList is disconnected.

#### Parameters

provider | a GtdProvider |
list | a GtdTaskList |
user_data | user data set when the signal handler was connected. |

Flags: Run Last