ZeitgeistDataSourceRegistry

ZeitgeistDataSourceRegistry — Query the Zeitgeist Data Source Registry extension

Functions

Signals

void source-disconnected Run First
void source-enabled Run First
void source-registered Run First

Types and Values

Object Hierarchy

    GObject
    ╰── ZeitgeistDataSourceRegistry

Includes

#include <zeitgeist.h>

Description

The Zeitgeist engine maintains a publicly available list of recognized data-sources (components inserting information into Zeitgeist). ZeitgeistDataSourceRegistry is used to register new data sources, get information about them and gives the ability to enable or disable the data sources.

Functions

zeitgeist_data_source_registry_get_data_sources ()

void
zeitgeist_data_source_registry_get_data_sources
                               (ZeitgeistDataSourceRegistry *self,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

zeitgeist_data_source_registry_get_data_sources_finish ()

GPtrArray *
zeitgeist_data_source_registry_get_data_sources_finish
                               (ZeitgeistDataSourceRegistry *self,
                                GAsyncResult *res,
                                GError **error);

Parameters

self

Instance of ZeitgeistDataSourceRegistry.

 

res

a GAsyncResult.

 

error

a GError or NULL.

 

Returns

Newly created GPtrArray containing ZeitgeistDataSource(s) registered in Zeitgeist. Free using g_ptr_array_unref() once you're done using it.


zeitgeist_data_source_registry_new ()

ZeitgeistDataSourceRegistry *
zeitgeist_data_source_registry_new (void);

Create a new data source registry instance.

DataSourceRegistry instances are not overly expensive for neither client or the Zeitgeist daemon so there's no need to go to lengths to keep singleton instances around.

Returns

A reference to a newly allocated registry.


zeitgeist_data_source_registry_register_data_source ()

void
zeitgeist_data_source_registry_register_data_source
                               (ZeitgeistDataSourceRegistry *self,
                                ZeitgeistDataSource *source,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Registers new data source in the registry, the source parameter needs to have unique-id, name, description and optionally event_templates set, therefore it is useful to pass ZeitgeistDataSource instance created using zeitgeist_data_source_new_full(). The registry will assume its ownership.

Parameters

self

Instance of ZeitgeistDataSourceRegistry.

 

source

Data source to register. If this is a floating reference it will be consumed

 

cancellable

a GCancellable or NULL.

 

callback

a GAsyncReadyCallback to call when the request is finished.

 

user_data

the data to pass to callback function.

 

zeitgeist_data_source_registry_register_data_source_finish ()

gboolean
zeitgeist_data_source_registry_register_data_source_finish
                               (ZeitgeistDataSourceRegistry *self,
                                GAsyncResult *res,
                                GError **error);

Parameters

self

Instance of ZeitgeistDataSourceRegistry.

 

res

Result of the asynchronous operation.

 

error

a GError or NULL.

 

Returns

If error is unset, returns whether this data source is enabled.


zeitgeist_data_source_registry_set_data_source_enabled ()

void
zeitgeist_data_source_registry_set_data_source_enabled
                               (ZeitgeistDataSourceRegistry *self,
                                const gchar *unique_id,
                                gboolean enabled,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

zeitgeist_data_source_registry_set_data_source_enabled_finish ()

gboolean
zeitgeist_data_source_registry_set_data_source_enabled_finish
                               (ZeitgeistDataSourceRegistry *self,
                                GAsyncResult *res,
                                GError **error);

Types and Values

struct ZeitgeistDataSourceRegistry

struct ZeitgeistDataSourceRegistry;

struct ZeitgeistDataSourceRegistryClass

struct ZeitgeistDataSourceRegistryClass {
  GObjectClass parent_class;

  void (*source_registered)   (ZeitgeistDataSourceRegistry *registry,
                               ZeitgeistDataSource *source);
  void (*source_disconnected) (ZeitgeistDataSourceRegistry *registry,
                               ZeitgeistDataSource *source);
  void (*source_enabled)      (ZeitgeistDataSourceRegistry *registry,
                               gchar *unique_id,
                               gboolean enabled);
};

Signal Details

The “source-disconnected” signal

void
user_function (ZeitgeistDataSourceRegistry *zeitgeistdatasourceregistry,
               ZeitgeistDataSource         *arg1,
               gpointer                     user_data)

Flags: Run First


The “source-enabled” signal

void
user_function (ZeitgeistDataSourceRegistry *zeitgeistdatasourceregistry,
               char                        *arg1,
               gboolean                     arg2,
               gpointer                     user_data)

Flags: Run First


The “source-registered” signal

void
user_function (ZeitgeistDataSourceRegistry *zeitgeistdatasourceregistry,
               ZeitgeistDataSource         *arg1,
               gpointer                     user_data)

Flags: Run First