![]() |
![]() |
![]() |
API Documentation for the Zeitgeist Client Library | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
ZeitgeistDataSourceZeitgeistDataSource — Abstracts data sources used by the ZeitgeistDataSourceRegistry extension |
#include <zeitgeist.h> ZeitgeistDataSource; ZeitgeistDataSourceClass; ZeitgeistDataSource* zeitgeist_data_source_new (void
); ZeitgeistDataSource* zeitgeist_data_source_new_full (const gchar *id
,const gchar *name
,const gchar *desc
,GPtrArray *event_templates
); const gchar* zeitgeist_data_source_get_unique_id (ZeitgeistDataSource *src
); void zeitgeist_data_source_set_unique_id (ZeitgeistDataSource *src
,const gchar *unique_id
); const gchar* zeitgeist_data_source_get_name (ZeitgeistDataSource *src
); void zeitgeist_data_source_set_name (ZeitgeistDataSource *src
,const gchar *name
); const gchar* zeitgeist_data_source_get_description (ZeitgeistDataSource *src
); void zeitgeist_data_source_set_description (ZeitgeistDataSource *src
,const gchar *description
); GPtrArray* zeitgeist_data_source_get_event_templates (ZeitgeistDataSource *src
); void zeitgeist_data_source_set_event_templates (ZeitgeistDataSource *src
,GPtrArray *event_templates
); gboolean zeitgeist_data_source_is_running (ZeitgeistDataSource *src
); void zeitgeist_data_source_set_running (ZeitgeistDataSource *src
,gboolean running
); gint64 zeitgeist_data_source_get_timestamp (ZeitgeistDataSource *src
); void zeitgeist_data_source_set_timestamp (ZeitgeistDataSource *src
,gint64 timestamp
); gboolean zeitgeist_data_source_is_enabled (ZeitgeistDataSource *src
); void zeitgeist_data_source_set_enabled (ZeitgeistDataSource *src
,gboolean enabled
);
ZeitgeistDataSource represents a data source used to insert events into Zeitgeist. The data sources are identified using the unique_id property, and when querying the data source registry you get other interesting information like timestamp of the last action of the data source, flag whether it is currently running etc.
typedef struct { GInitiallyUnownedClass parent_class; } ZeitgeistDataSourceClass;
ZeitgeistDataSource* zeitgeist_data_source_new (void
);
Create a new empty data source structure.
Returns : |
A new instance of ZeitgeistDataSource. The returned src will
have a floating reference which will be consumed if you pass the
data source to any of the methods provided by this library (like
registering the data source). If you do not do that then you
must free the data source youself with g_object_unref() .
|
ZeitgeistDataSource* zeitgeist_data_source_new_full (const gchar *id
,const gchar *name
,const gchar *desc
,GPtrArray *event_templates
);
Creates a new instance of DataSource with the given ID, name and description.
|
Unique ID for the data source. |
|
Name of the data source (may be translated). |
|
Data source description. |
|
A GPtrArray of ZeitgeistEvents. This parameter
is optional and purely informational to let data-source
management applications and other data-sources know what
sort of information the data source logs.
The data source will assume ownership of the events and
the pointer array.
If you want to keep a reference for yourself you must do a
g_ptr_array_ref() on event_templates as well as reffing
the events held by it before calling this method.
|
Returns : |
New instance of ZeitgeistDataSource with floating reference,
if you do not pass the instance to method like
zeitgeist_data_source_registry_register_data_source() , then you
have to free the data source yourself using g_object_unref() .
|
const gchar* zeitgeist_data_source_get_unique_id (ZeitgeistDataSource *src
);
|
|
Returns : |
void zeitgeist_data_source_set_unique_id (ZeitgeistDataSource *src
,const gchar *unique_id
);
|
|
|
const gchar* zeitgeist_data_source_get_name (ZeitgeistDataSource *src
);
|
|
Returns : |
void zeitgeist_data_source_set_name (ZeitgeistDataSource *src
,const gchar *name
);
|
|
|
const gchar* zeitgeist_data_source_get_description
(ZeitgeistDataSource *src
);
|
|
Returns : |
void zeitgeist_data_source_set_description (ZeitgeistDataSource *src
,const gchar *description
);
|
|
|
GPtrArray* zeitgeist_data_source_get_event_templates
(ZeitgeistDataSource *src
);
|
|
Returns : |
void zeitgeist_data_source_set_event_templates (ZeitgeistDataSource *src
,GPtrArray *event_templates
);
Sets event templates which are logged by this ZeitgeistDataSource instance.
|
Instance of ZeitgeistDataSource. |
|
A GPtrArray which contains elements of type
ZeitgeistEvent.
The data source will assume ownership of the events and
the pointer array.
If you want to keep a reference for yourself you must do a
g_ptr_array_ref() on templates as well as reffing
the events held by it before calling this method.
|
gboolean zeitgeist_data_source_is_running (ZeitgeistDataSource *src
);
|
|
Returns : |
void zeitgeist_data_source_set_running (ZeitgeistDataSource *src
,gboolean running
);
|
|
|
gint64 zeitgeist_data_source_get_timestamp (ZeitgeistDataSource *src
);
|
|
Returns : |
void zeitgeist_data_source_set_timestamp (ZeitgeistDataSource *src
,gint64 timestamp
);
|
|
|
gboolean zeitgeist_data_source_is_enabled (ZeitgeistDataSource *src
);
|
|
Returns : |
void zeitgeist_data_source_set_enabled (ZeitgeistDataSource *src
,gboolean enabled
);
|
|
|