## ZeitgeistLog ZeitgeistLog — Primary access point for talking to the Zeitgeist daemon |

## Synopsis

    #include <zeitgeist.h>

                        ZeitgeistLog;
    struct              ZeitgeistLogClass;
    ZeitgeistLog *      zeitgeist_log_new                   (void);
    void                zeitgeist_log_insert_events         (ZeitgeistLog *self,
                                                             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_insert_events_from_ptrarray
                                                            (ZeitgeistLog *self,
                                                             GPtrArray *events,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    GArray *            zeitgeist_log_insert_events_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_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_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_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);
    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_quit                  (ZeitgeistLog *self,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            zeitgeist_log_quit_finish           (ZeitgeistLog *self,
                                                             GAsyncResult *res,
                                                             GError **error);
    void                zeitgeist_log_install_monitor       (ZeitgeistLog *self,
                                                             ZeitgeistMonitor *monitor);
    void                zeitgeist_log_remove_monitor        (ZeitgeistLog *self,
                                                             ZeitgeistMonitor *monitor);

## Object Hierarchy

      GObject
       +----ZeitgeistLog

## Properties

      "connected"                gboolean              : Read

## Description

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.

## Details

### ZeitgeistLog

    typedef struct _ZeitgeistLog ZeitgeistLog;

### struct ZeitgeistLogClass

    struct ZeitgeistLogClass {
      GObjectClass parent_class;
    };

### zeitgeist_log_new ()

    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.

Returns : | A reference to a newly allocated log.

### zeitgeist_log_insert_events ()

    void                zeitgeist_log_insert_events         (ZeitgeistLog *self,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data,
                                                             ...);

Asynchrnously send a set of events to the Zeitgeist daemon, requesting they be inserted into the log.

`self` : | The log logging the events
`cancellable` : | To cancel the operation or `NULL`
`callback` : | 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
`user_data` : | Any user data to pass back to `callback`
`...` : | A list of ZeitgeistEvents terminated by a `NULL`

### zeitgeist_log_insert_events_no_reply ()

    void                zeitgeist_log_insert_events_no_reply
                                                            (ZeitgeistLog *self,
                                                             ...);

Asynchrnously 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 succesfully inserted or not.

This method is exactly equivalent to calling `zeitgeist_log_insert_events()` with `NULL` set as `cancellable`, `callback`, and `user_data`.

`self` : | The log logging the events
`...` : | A list of ZeitgeistEvents terminated by a `NULL`

### zeitgeist_log_insert_events_valist ()

    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()`.

Asynchrnously send a set of events to the Zeitgeist daemon, requesting they be inserted into the log.

`self` : | The log logging the events
`cancellable` : | To cancel the operation or `NULL`
`callback` : | 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
`user_data` : | Any user data to pass back to `callback`
`events` : | A GPtrArray of ZeitgeistEvents to insert. This method steals the reference to `events` and consumes all floating refs on the event members.

### zeitgeist_log_insert_events_from_ptrarray ()

    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.

`self` : | The log logging the events
`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()`.
`cancellable` : | To cancel the operation or `NULL`
`callback` : | 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
`user_data` : | Any user data to pass back to `callback`

### zeitgeist_log_insert_events_finish ()

    GArray *            zeitgeist_log_insert_events_finish  (ZeitgeistLog *self,
                                                             GAsyncResult *res,
                                                             GError **error);

### zeitgeist_log_find_events ()

    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);

### zeitgeist_log_find_events_finish ()

    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]

### zeitgeist_log_find_event_ids ()

    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);

### zeitgeist_log_find_event_ids_finish ()

    GArray *            zeitgeist_log_find_event_ids_finish (ZeitgeistLog *self,
                                                             GAsyncResult *res,
                                                             GError **error);

### zeitgeist_log_get_events ()

    void                zeitgeist_log_get_events            (ZeitgeistLog *self,
                                                             GArray *event_ids,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

### zeitgeist_log_get_events_finish ()

    ZeitgeistResultSet * zeitgeist_log_get_events_finish    (ZeitgeistLog *self,
                                                             GAsyncResult *res,
                                                             GError **error);

### zeitgeist_log_find_related_uris ()

    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);

### zeitgeist_log_find_related_uris_finish ()

    gchar **            zeitgeist_log_find_related_uris_finish
                                                            (ZeitgeistLog *self,
                                                             GAsyncResult *res,
                                                             GError **error);

### zeitgeist_log_delete_events ()

    void                zeitgeist_log_delete_events         (ZeitgeistLog *self,
                                                             GArray *event_ids,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

### zeitgeist_log_delete_events_finish ()

    gboolean            zeitgeist_log_delete_events_finish  (ZeitgeistLog *self,
                                                             GAsyncResult *res,
                                                             GError **error);

### zeitgeist_log_delete_log ()

    void                zeitgeist_log_delete_log            (ZeitgeistLog *self,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

### zeitgeist_log_delete_log_finish ()

    gboolean            zeitgeist_log_delete_log_finish     (ZeitgeistLog *self,
                                                             GAsyncResult *res,
                                                             GError **error);

### zeitgeist_log_quit ()

    void                zeitgeist_log_quit                  (ZeitgeistLog *self,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

### zeitgeist_log_quit_finish ()

    gboolean            zeitgeist_log_quit_finish           (ZeitgeistLog *self,
                                                             GAsyncResult *res,
                                                             GError **error);

### zeitgeist_log_install_monitor ()

    void                zeitgeist_log_install_monitor       (ZeitgeistLog *self,
                                                             ZeitgeistMonitor *monitor);

### zeitgeist_log_remove_monitor ()

    void                zeitgeist_log_remove_monitor        (ZeitgeistLog *self,
                                                             ZeitgeistMonitor *monitor);

## Property Details

### The `"connected"` property

      "connected"                gboolean              : Read

Determines if this Log instance is currently connected to Zeitgeist daemon.

Default value: FALSE