![]() |
![]() |
![]() |
API Documentation for the Zeitgeist Client Library | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
#include <zeitgeist.h> ZeitgeistLog; struct ZeitgeistLogClass; void zeitgeist_log_delete_events (ZeitgeistLog *self
,GArray *event_ids
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean zeitgeist_log_delete_events_finish (ZeitgeistLog *self
,GAsyncResult *res
,GError **error
); void zeitgeist_log_delete_log (ZeitgeistLog *self
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean zeitgeist_log_delete_log_finish (ZeitgeistLog *self
,GAsyncResult *res
,GError **error
); void zeitgeist_log_find_event_ids (ZeitgeistLog *self
,ZeitgeistTimeRange *time_range
,GPtrArray *event_templates
,ZeitgeistStorageState storage_state
,guint32 num_events
,ZeitgeistResultType result_type
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); GArray * zeitgeist_log_find_event_ids_finish (ZeitgeistLog *self
,GAsyncResult *res
,GError **error
); void zeitgeist_log_find_events (ZeitgeistLog *self
,ZeitgeistTimeRange *time_range
,GPtrArray *event_templates
,ZeitgeistStorageState storage_state
,guint32 num_events
,ZeitgeistResultType result_type
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); ZeitgeistResultSet * zeitgeist_log_find_events_finish (ZeitgeistLog *self
,GAsyncResult *res
,GError **error
); void zeitgeist_log_find_related_uris (ZeitgeistLog *self
,ZeitgeistTimeRange *time_range
,GPtrArray *event_templates
,GPtrArray *result_event_templates
,ZeitgeistStorageState storage_state
,guint32 num_events
,ZeitgeistResultType result_type
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); gchar ** zeitgeist_log_find_related_uris_finish (ZeitgeistLog *self
,GAsyncResult *res
,GError **error
); ZeitgeistLog * zeitgeist_log_get_default (void
); void zeitgeist_log_get_events (ZeitgeistLog *self
,GArray *event_ids
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); ZeitgeistResultSet * zeitgeist_log_get_events_finish (ZeitgeistLog *self
,GAsyncResult *res
,GError **error
); void zeitgeist_log_get_version (ZeitgeistLog *self
,gint *major
,gint *minor
,gint *micro
); void zeitgeist_log_insert_events (ZeitgeistLog *self
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
,...
); GArray * zeitgeist_log_insert_events_finish (ZeitgeistLog *self
,GAsyncResult *res
,GError **error
); void zeitgeist_log_insert_events_from_ptrarray (ZeitgeistLog *self
,GPtrArray *events
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); void zeitgeist_log_insert_events_no_reply (ZeitgeistLog *self
,...
); void zeitgeist_log_insert_events_valist (ZeitgeistLog *self
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
,va_list events
); void zeitgeist_log_install_monitor (ZeitgeistLog *self
,ZeitgeistMonitor *monitor
); gboolean zeitgeist_log_is_connected (ZeitgeistLog *self
); ZeitgeistLog * zeitgeist_log_new (void
); void zeitgeist_log_quit (ZeitgeistLog *self
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean zeitgeist_log_quit_finish (ZeitgeistLog *self
,GAsyncResult *res
,GError **error
); void zeitgeist_log_remove_monitor (ZeitgeistLog *self
,ZeitgeistMonitor *monitor
);
ZeitgeistLog encapsulates the low level access to the Zeitgeist daemon. You can use it to manage the log by inserting and deleting entries as well as do queries on the logged data.
It's important to realize that the ZeitgeistLog class does not expose any API that does synchronous communications with the message bus - everything is asynchronous. To ease development some of the methods have variants that are "fire and forget" ignoring the normal return value, so that callbacks does not have to be set up.
void zeitgeist_log_delete_events (ZeitgeistLog *self
,GArray *event_ids
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
gboolean zeitgeist_log_delete_events_finish (ZeitgeistLog *self
,GAsyncResult *res
,GError **error
);
void zeitgeist_log_delete_log (ZeitgeistLog *self
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
gboolean zeitgeist_log_delete_log_finish (ZeitgeistLog *self
,GAsyncResult *res
,GError **error
);
void zeitgeist_log_find_event_ids (ZeitgeistLog *self
,ZeitgeistTimeRange *time_range
,GPtrArray *event_templates
,ZeitgeistStorageState storage_state
,guint32 num_events
,ZeitgeistResultType result_type
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
GArray * zeitgeist_log_find_event_ids_finish (ZeitgeistLog *self
,GAsyncResult *res
,GError **error
);
void zeitgeist_log_find_events (ZeitgeistLog *self
,ZeitgeistTimeRange *time_range
,GPtrArray *event_templates
,ZeitgeistStorageState storage_state
,guint32 num_events
,ZeitgeistResultType result_type
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
ZeitgeistResultSet * zeitgeist_log_find_events_finish (ZeitgeistLog *self
,GAsyncResult *res
,GError **error
);
Retrieve the result from an asynchronous query started with
zeitgeist_log_find_events()
.
Returns : |
A newly allocated ZeitgeistResultSet containing
the ZeitgeistEvents
matching the query. You must free the result set with
g_object_unref() . The events held in the result set will
automatically be unreffed when the result set is finalized. [transfer-full]
|
void zeitgeist_log_find_related_uris (ZeitgeistLog *self
,ZeitgeistTimeRange *time_range
,GPtrArray *event_templates
,GPtrArray *result_event_templates
,ZeitgeistStorageState storage_state
,guint32 num_events
,ZeitgeistResultType result_type
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
gchar ** zeitgeist_log_find_related_uris_finish (ZeitgeistLog *self
,GAsyncResult *res
,GError **error
);
ZeitgeistLog * zeitgeist_log_get_default (void
);
See zeitgeist_log_new()
for more information.
Returns : |
A unique ZeitgeistLog. Do not ref or unref it. [transfer none] |
Since 0.3.14
void zeitgeist_log_get_events (ZeitgeistLog *self
,GArray *event_ids
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
ZeitgeistResultSet * zeitgeist_log_get_events_finish (ZeitgeistLog *self
,GAsyncResult *res
,GError **error
);
void zeitgeist_log_get_version (ZeitgeistLog *self
,gint *major
,gint *minor
,gint *micro
);
Gets version of currently running Zeitgeist daemon.
This method will return the version of Zeitgeist daemon this instance is
connected to. If you call this method right after zeitgeist_log_new()
,
only zeros will be returned, a valid version number will only be returned
once this instance successfully connected to the Zeitgeist daemon - ie
the value of the "connected" property must be TRUE (you can connect
to the "notify::connected" signal otherwise).
|
A ZeitgeistLog instance |
|
Location for the major version. [out] |
|
Location for the minor version. [out] |
|
Location for the micro version. [out] |
void zeitgeist_log_insert_events (ZeitgeistLog *self
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
,...
);
Asynchronously send a set of events to the Zeitgeist daemon, requesting they be inserted into the log.
|
The log logging the events |
|
To cancel the operation or NULL
|
|
GAsyncReadyCallback to invoke once the logging operation has
completed. Set to NULL to ignore the result. In this callback
you can invoke zeitgeist_log_insert_events_finish() to collect
the event ids of the inserted events |
|
Any user data to pass back to callback
|
GArray * zeitgeist_log_insert_events_finish (ZeitgeistLog *self
,GAsyncResult *res
,GError **error
);
void zeitgeist_log_insert_events_from_ptrarray (ZeitgeistLog *self
,GPtrArray *events
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously send a set of events to the Zeitgeist daemon, requesting they be inserted into the log.
|
The log logging the events |
|
A GPtrArray of ZeitgeistEvents to insert. This method
steals the reference to events and consumes all floating refs
on the event members. It is assumed that the free_func on events
is set to g_object_unref() . |
|
To cancel the operation or NULL
|
|
GAsyncReadyCallback to invoke once the logging operation has
completed. Set to NULL to ignore the result. In this callback
you can invoke zeitgeist_log_insert_events_finish() to collect
the event ids of the inserted events |
|
Any user data to pass back to callback
|
void zeitgeist_log_insert_events_no_reply (ZeitgeistLog *self
,...
);
Asynchronously send a set of events to the Zeitgeist daemon, requesting they be inserted into the log. This method is "fire and forget" and the caller will never know whether the events was successfully inserted or not.
This method is exactly equivalent to calling zeitgeist_log_insert_events()
with NULL
set as cancellable
, callback
, and user_data
.
|
The log logging the events |
void zeitgeist_log_insert_events_valist (ZeitgeistLog *self
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
,va_list events
);
This method is intended for language bindings. If calling this function
from C code it's generally more handy to use zeitgeist_log_insert_events()
or zeitgeist_log_insert_events_from_ptrarray()
.
Asynchronously send a set of events to the Zeitgeist daemon, requesting they be inserted into the log.
|
The log logging the events |
|
To cancel the operation or NULL
|
|
GAsyncReadyCallback to invoke once the logging operation has
completed. Set to NULL to ignore the result. In this callback
you can invoke zeitgeist_log_insert_events_finish() to collect
the event ids of the inserted events |
|
Any user data to pass back to callback
|
|
A GPtrArray of ZeitgeistEvents to insert. This method
steals the reference to events and consumes all floating refs
on the event members. |
void zeitgeist_log_install_monitor (ZeitgeistLog *self
,ZeitgeistMonitor *monitor
);
ZeitgeistLog * zeitgeist_log_new (void
);
The ZeitgeistLog object will asynchronously start to connect to the Zeitgeist daemon. Any request you send to via this log object will be queued until the connection is ready - at which point you will get a notify signal on the "connected" property.
It isn't recommended to call this function more than once. If you need to
access ZeitgeistLog from different parts of your codebase, consider using
zeitgeist_log_get_default()
instead.
Returns : |
A reference to a newly allocated log. |
void zeitgeist_log_quit (ZeitgeistLog *self
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
gboolean zeitgeist_log_quit_finish (ZeitgeistLog *self
,GAsyncResult *res
,GError **error
);
void zeitgeist_log_remove_monitor (ZeitgeistLog *self
,ZeitgeistMonitor *monitor
);
"connected"
property"connected" gboolean : Read
Determines if this Log instance is currently connected to Zeitgeist daemon.
Default value: FALSE