GtdActivatable

GtdActivatable — entry point for plugins

Stability Level

Unstable, unless otherwise indicated

Properties

Types and Values

Object Hierarchy

    GInterface
    ╰── GtdActivatable

Prerequisites

GtdActivatable requires GObject.

Description

The GtdActivatable interface is the interface plugins must implement in order to be seen by GNOME To Do.

When plugins are loaded, the gtd_activatable_activate() vfunc is called. Use this vfunc to load anything that depends on GNOME To Do.

When plugins are unloaded, the gtd_activatable_deactivate() vfunc if called. Ideally, the implementation should undo everything that was done on gtd_activatable_activate().

A plugin implementation may expose one or more GtdProvider instances, which are the data sources of GNOME To Do. See the 'eds' plugin for a reference on how to expose one ('local') and multiple (Online Accounts) providers.

Plugins may also expose one or more GtdPanel implementations.

Optionally, a plugin may expose a preferences panel. See gtd_activatable_get_preferences_panel().

Functions

gtd_activatable_activate ()

void
gtd_activatable_activate (GtdActivatable *activatable);

Activates the extension. This is the starting point where the implementation does everything it needs to do. Avoid doing it earlier than this call.

This function is called after the extension is loaded and the signals are connected. If you want to do anything before that, the _init function should be used instead.

Parameters

activatable

a GtdActivatable

 

gtd_activatable_deactivate ()

void
gtd_activatable_deactivate (GtdActivatable *activatable);

Deactivates the extension. Here, the extension should remove all providers and panels it set.

This function is called before the extension is removed. At this point, the plugin manager already removed all providers and widgets this extension exported. If you want to do anything after the extension is removed, use GObject::finalize instead.

Parameters

activatable

a GtdActivatable

 

gtd_activatable_get_header_widgets ()

GList *
gtd_activatable_get_header_widgets (GtdActivatable *activatable);

Retrieve the list header widgets of activatable if any.

Parameters

activatable

a GtdActivatable

 

Returns

a GList.

[transfer container][element-type Gtk.Widget]


gtd_activatable_get_preferences_panel ()

GtkWidget *
gtd_activatable_get_preferences_panel (GtdActivatable *activatable);

Retrieve the preferences panel of activatable if any.

Parameters

activatable

a GtdActivatable

 

Returns

a GtkWidget, or NULL.

[transfer none]


gtd_activatable_get_panels ()

GList *
gtd_activatable_get_panels (GtdActivatable *activatable);

Retrieve the panel list of activatable if any.

Parameters

activatable

a GtdActivatable

 

Returns

a GList.

[transfer none][element-type Gtd.Panel]


gtd_activatable_get_providers ()

GList *
gtd_activatable_get_providers (GtdActivatable *activatable);

Retrieve the providers of activatable if any.

Parameters

activatable

a GtdActivatable

 

Returns

a GList.

[transfer none][element-type Gtd.Provider]

Types and Values

GTD_TYPE_ACTIVATABLE

#define GTD_TYPE_ACTIVATABLE (gtd_activatable_get_type ())

struct GtdActivatableInterface

struct GtdActivatableInterface {
  GTypeInterface    parent;

  void             (*activate)                             (GtdActivatable     *activatable);

  void             (*deactivate)                           (GtdActivatable     *activatable);

  GList*           (*get_header_widgets)                   (GtdActivatable     *activatable);

  GtkWidget*       (*get_preferences_panel)                (GtdActivatable     *activatable);

  GList*           (*get_panels)                           (GtdActivatable     *activatable);

  GList*           (*get_providers)                        (GtdActivatable     *activatable);
};

GtdActivatable

typedef struct _GtdActivatable GtdActivatable;

Property Details

The “preferences-panel” property

  “preferences-panel”        GtkWidget *

The preferences panel of the plugins.

Flags: Read

Signal Details

The “panel-added” signal

void
user_function (GtdActivatable *activatable,
               GtdPanel       *panel,
               gpointer        user_data)

The ::panel-added signal is emmited after a GtdPanel is connected.

Parameters

activatable

a GtdActivatable

 

panel

a GtdPanel

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “panel-removed” signal

void
user_function (GtdActivatable *activatable,
               GtdPanel       *panel,
               gpointer        user_data)

The ::panel-removed signal is emmited after a GtdPanel is removed from the list.

Parameters

activatable

a GtdActivatable

 

panel

a GtdPanel

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “provider-added” signal

void
user_function (GtdActivatable *activatable,
               GtdProvider    *provider,
               gpointer        user_data)

The ::provider-added signal is emmited after a GtdProvider is connected.

Parameters

activatable

a GtdActivatable

 

provider

a GtdProvider

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “provider-changed” signal

void
user_function (GtdActivatable *activatable,
               GtdProvider    *provider,
               gpointer        user_data)

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

Parameters

activatable

a GtdActivatable

 

provider

a GtdProvider

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “provider-removed” signal

void
user_function (GtdActivatable *activatable,
               GtdProvider    *provider,
               gpointer        user_data)

The ::provider-removed signal is emmited after a GtdProvider is disconnected.

Parameters

activatable

a GtdActivatable

 

provider

a GtdProvider

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last