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

## Functions

void | zeitgeist_log_insert_event ()
GArray * | zeitgeist_log_insert_event_finish ()
void | zeitgeist_log_insert_events ()
GArray * | zeitgeist_log_insert_events_finish ()
void | zeitgeist_log_insert_event_no_reply ()
void | zeitgeist_log_insert_events_no_reply ()
void | zeitgeist_log_find_events ()
ZeitgeistResultSet * | zeitgeist_log_find_events_finish ()
void | zeitgeist_log_find_event_ids ()
guint32 * | zeitgeist_log_find_event_ids_finish ()
void | zeitgeist_log_get_events ()
ZeitgeistResultSet * | zeitgeist_log_get_events_finish ()
void | zeitgeist_log_find_related_uris ()
gchar ** | zeitgeist_log_find_related_uris_finish ()
void | zeitgeist_log_delete_events ()
ZeitgeistTimeRange * | zeitgeist_log_delete_events_finish ()
void | zeitgeist_log_quit ()
void | zeitgeist_log_quit_finish ()
void | zeitgeist_log_install_monitor ()
void | zeitgeist_log_remove_monitor ()
void | zeitgeist_log_get_version ()
gchar ** | zeitgeist_log_get_extensions ()
gchar * | zeitgeist_log_datapath ()
ZeitgeistLog * | zeitgeist_log_new ()
ZeitgeistLog * | zeitgeist_log_get_default ()

## Types and Values

#define | ZEITGEIST_TYPE_LOG
struct | ZeitgeistLog
struct | ZeitgeistLogClass

## Object Hierarchy

        GObject
        ╰── ZeitgeistQueuedProxyWrapper
            ╰── ZeitgeistLog

## Description

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

## Functions

### zeitgeist_log_insert_event ()

    void
    zeitgeist_log_insert_event (ZeitgeistLog *self,
                                ZeitgeistEvent *event,
                                GCancellable *cancellable,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_);

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

See also: `zeitgeist_log_insert_event_finish()`

#### Parameters

self | the ZeitgeistLog instance |
event | . A ZeitgeistEvent . | [in]
cancellable | . a GCancellable to cancel the operation or `NULL` . | [in][allow-none]
_callback_ | callback to call when the request is satisfied. | [scope async]
_user_data_ | the data to pass to `_callback_` function. | [closure]

### zeitgeist_log_insert_event_finish ()

    GArray *
    zeitgeist_log_insert_event_finish (ZeitgeistLog *self,
                                       GAsyncResult *_res_,
                                       GError **error);

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

See also: `zeitgeist_log_insert_event()`

#### Parameters

self | the ZeitgeistLog instance |
_res_ | a GAsyncResult |
error | location to store the error occuring, or `NULL` to ignore |

### zeitgeist_log_insert_events ()

    void
    zeitgeist_log_insert_events (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.

See also: `zeitgeist_log_insert_events_finish()`

#### Parameters

self | the ZeitgeistLog instance |
events | . An GPtrArray of ZeitgeistEvent . | [in]
cancellable | . a GCancellable to cancel the operation or `NULL` . | [in][allow-none]
_callback_ | callback to call when the request is satisfied. | [scope async]
_user_data_ | the data to pass to `_callback_` function. | [closure]

### zeitgeist_log_insert_events_finish ()

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

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

See also: `zeitgeist_log_insert_events()`

#### Parameters

self | the ZeitgeistLog instance |
_res_ | a GAsyncResult |
error | location to store the error occuring, or `NULL` to ignore |

### zeitgeist_log_insert_event_no_reply ()

    void
    zeitgeist_log_insert_event_no_reply (ZeitgeistLog *self,
                                         ZeitgeistEvent *event,
                                         GError **error);

Asynchronously send a set of events to the Zeitgeist daemon, requesting they be inserted into the log. This method is &quot;fire and forget&quot; and the caller will never know whether the events was successfully inserted or not.

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

#### Parameters

self | the ZeitgeistLog instance |
event | . A ZeitgeistEvent . | [in]
error | location to store the error occuring, or `NULL` to ignore |

### zeitgeist_log_insert_events_no_reply ()

    void
    zeitgeist_log_insert_events_no_reply (ZeitgeistLog *self,
                                          GPtrArray *events,
                                          GError **error);

Asynchronously send a set of events to the Zeitgeist daemon, requesting they be inserted into the log. This method is &quot;fire and forget&quot; and the caller will never know whether the events was successfully inserted or not.

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

#### Parameters

self | the ZeitgeistLog instance |
events | . An GPtrArray of ZeitgeistEvent . | [in]
error | location to store the error occuring, or `NULL` to ignore |

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

Send a query matching a collection of ZeitgeistEvent templates to the `zeitgeist_log_new()`. The query will match if an event matches any of the templates. If an event template has more than one ZeitgeistSubject the query will match if any one of the ZeitgeistSubjects templates match.

The query will be done via an asynchronous DBus call and this method will return immediately. The return value will be passed to callback as a list of ZeitgeistEvents. This list must be the sole argument for the callback.

If you need to do a query yielding a large (or unpredictable) result set and you only want to show some of the results at the same time (eg., by paging them), consider using `zeitgeist_log_find_event_ids()`.

In order to use this method there needs to be a mainloop runnning. Both Qt and GLib mainloops are supported.

See also: `zeitgeist_log_find_events_finish()`

#### Parameters

self | the ZeitgeistLog instance |
time_range | . ZeitgeistTimeRange A time range in which the events should be considered in . | [in]
event_templates | . An GPtrArray of ZeitgeistEvent . | [in]
storage_state | . ZeitgeistStorageState storage state . | [in]
num_events | . int represteing the number of events that should be returned . | [in]
result_type | . ZeitgeistResultType how the events should be grouped and sorted . | [in]
cancellable | . a GCancellable to cancel the operation or `NULL` . | [in][allow-none]
_callback_ | callback to call when the request is satisfied. | [scope async]
_user_data_ | the data to pass to `_callback_` function. | [closure]

### zeitgeist_log_find_events_finish ()

    ZeitgeistResultSet *
    zeitgeist_log_find_events_finish (ZeitgeistLog *self,
                                      GAsyncResult *_res_,
                                      GError **error);

Send a query matching a collection of ZeitgeistEvent templates to the `zeitgeist_log_new()`. The query will match if an event matches any of the templates. If an event template has more than one ZeitgeistSubject the query will match if any one of the ZeitgeistSubjects templates match.

The query will be done via an asynchronous DBus call and this method will return immediately. The return value will be passed to callback as a list of ZeitgeistEvents. This list must be the sole argument for the callback.

If you need to do a query yielding a large (or unpredictable) result set and you only want to show some of the results at the same time (eg., by paging them), consider using `zeitgeist_log_find_event_ids()`.

In order to use this method there needs to be a mainloop runnning. Both Qt and GLib mainloops are supported.

See also: `zeitgeist_log_find_events()`

#### Parameters

self | the ZeitgeistLog instance |
_res_ | a GAsyncResult |
error | location to store the error occuring, or `NULL` to ignore |

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

Send a query matching a collection of ZeitgeistEvent templates to the `zeitgeist_log_new()`. The query will match if an event matches any of the templates. If an event template has more than one ZeitgeistSubject the query will match if any one of the ZeitgeistSubjects templates match.

The query will be done via an asynchronous DBus call and this method will return immediately. The return value will be passed to callback as a list of intergers represrting ZeitgeistEvent id's. This list must be the sole argument for the callback.

In order to use this method there needs to be a mainloop runnning. Both Qt and GLib mainloops are supported.

See also: `zeitgeist_log_find_event_ids_finish()`

#### Parameters

self | the ZeitgeistLog instance |
time_range | . ZeitgeistTimeRange A time range in which the events should be considered in . | [in]
event_templates | . An GPtrArray of ZeitgeistEvent . | [in]
storage_state | . ZeitgeistStorageState storage state . | [in]
num_events | . int represteing the number of events that should be returned . | [in]
result_type | . ZeitgeistResultType how the events should be grouped and sorted . | [in]
cancellable | . a GCancellable to cancel the operation or `NULL` . | [in][allow-none]
_callback_ | callback to call when the request is satisfied. | [scope async]
_user_data_ | the data to pass to `_callback_` function. | [closure]

### zeitgeist_log_find_event_ids_finish ()

    guint32 *
    zeitgeist_log_find_event_ids_finish (ZeitgeistLog *self,
                                         GAsyncResult *_res_,
                                         gint *result_length1,
                                         GError **error);

Send a query matching a collection of ZeitgeistEvent templates to the `zeitgeist_log_new()`. The query will match if an event matches any of the templates. If an event template has more than one ZeitgeistSubject the query will match if any one of the ZeitgeistSubjects templates match.

The query will be done via an asynchronous DBus call and this method will return immediately. The return value will be passed to callback as a list of intergers represrting ZeitgeistEvent id's. This list must be the sole argument for the callback.

In order to use this method there needs to be a mainloop runnning. Both Qt and GLib mainloops are supported.

See also: `zeitgeist_log_find_event_ids()`

#### Parameters

self | the ZeitgeistLog instance |
_res_ | a GAsyncResult |
error | location to store the error occuring, or `NULL` to ignore |

### zeitgeist_log_get_events ()

    void
    zeitgeist_log_get_events (ZeitgeistLog *self,
                              GArray *event_ids,
                              GCancellable *cancellable,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_);

Look up a collection of ZeitgeistEvent in the `zeitgeist_log_new()` given a collection of event ids. This is useful for looking up the event data for events found with the find_event_ids_* family of functions.

Each ZeitgeistEvent which is not found in the `zeitgeist_log_new()` is represented by NULL in the resulting collection. The query will be done via an asynchronous DBus call and this method will return immediately. The returned events will be passed to callback as a list of ZeitgeistEvents, which must be the only argument of the function.

In order to use this method there needs to be a mainloop runnning.

See also: `zeitgeist_log_get_events_finish()`

#### Parameters

self | the ZeitgeistLog instance |
event_ids | . a GArray of ZeitgeistEvent ids . | [in]
cancellable | . a GCancellable to cancel the operation or `NULL` . | [in][allow-none]
_callback_ | callback to call when the request is satisfied. | [scope async]
_user_data_ | the data to pass to `_callback_` function. | [closure]

### zeitgeist_log_get_events_finish ()

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

Look up a collection of ZeitgeistEvent in the `zeitgeist_log_new()` given a collection of event ids. This is useful for looking up the event data for events found with the find_event_ids_* family of functions.

Each ZeitgeistEvent which is not found in the `zeitgeist_log_new()` is represented by NULL in the resulting collection. The query will be done via an asynchronous DBus call and this method will return immediately. The returned events will be passed to callback as a list of ZeitgeistEvents, which must be the only argument of the function.

In order to use this method there needs to be a mainloop runnning.

See also: `zeitgeist_log_get_events()`

#### Parameters

self | the ZeitgeistLog instance |
_res_ | a GAsyncResult |
error | location to store the error occuring, or `NULL` to ignore |

### 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,
                                     ZeitgeistRelevantResultType result_type,
                                     GCancellable *cancellable,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);

Get a list of URIs of subjects which frequently occur together with events matching event_templates. Possibly restricting to time_range or to URIs that occur as subject of events matching result_event_templates.

See also: `zeitgeist_log_find_related_uris_finish()`

#### Parameters

self | the ZeitgeistLog instance |
time_range | . ZeitgeistTimeRange A time range in which the events should be considered in . | [in]
event_templates | . An GPtrArray of ZeitgeistEvent describing the events to relate to . | [in]
result_event_templates | . An GPtrArray of ZeitgeistEvent desrcibing the result to be returned . | [in]
storage_state | . ZeitgeistStorageState storage state . | [in]
num_events | . int represteing the number of events that should be returned . | [in]
result_type | . ZeitgeistResultType how the events should be grouped and sorted . | [in]
cancellable | . a GCancellable to cancel the operation or `NULL` . | [in][allow-none]
_callback_ | callback to call when the request is satisfied. | [scope async]
_user_data_ | the data to pass to `_callback_` function. | [closure]

### zeitgeist_log_find_related_uris_finish ()

    gchar **
    zeitgeist_log_find_related_uris_finish
                                   (ZeitgeistLog *self,
                                    GAsyncResult *_res_,
                                    gint *result_length1,
                                    GError **error);

Get a list of URIs of subjects which frequently occur together with events matching event_templates. Possibly restricting to time_range or to URIs that occur as subject of events matching result_event_templates.

See also: `zeitgeist_log_find_related_uris()`

#### Parameters

self | the ZeitgeistLog instance |
_res_ | a GAsyncResult |
error | location to store the error occuring, or `NULL` to ignore |

### zeitgeist_log_delete_events ()

    void
    zeitgeist_log_delete_events (ZeitgeistLog *self,
                                 GArray *event_ids,
                                 GCancellable *cancellable,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_);

Delete a collection of events from the zeitgeist log given their event ids.

The deletion will be done asynchronously, and this method returns immediately.

See also: `zeitgeist_log_delete_events_finish()`

#### Parameters

self | the ZeitgeistLog instance |
event_ids | . Array<uint32> . | [in]
cancellable | . a GCancellable to cancel the operation or `NULL` . | [in][allow-none]
_callback_ | callback to call when the request is satisfied. | [scope async]
_user_data_ | the data to pass to `_callback_` function. | [closure]

### zeitgeist_log_delete_events_finish ()

    ZeitgeistTimeRange *
    zeitgeist_log_delete_events_finish (ZeitgeistLog *self,
                                        GAsyncResult *_res_,
                                        GError **error);

Delete a collection of events from the zeitgeist log given their event ids.

The deletion will be done asynchronously, and this method returns immediately.

See also: `zeitgeist_log_delete_events()`

#### Parameters

self | the ZeitgeistLog instance |
_res_ | a GAsyncResult |
error | location to store the error occuring, or `NULL` to ignore |

### zeitgeist_log_quit ()

    void
    zeitgeist_log_quit (ZeitgeistLog *self,
                        GCancellable *cancellable,
                        GAsyncReadyCallback _callback_,
                        gpointer _user_data_);

a GCancellable to cancel the operation or `NULL`

See also: `zeitgeist_log_quit_finish()`

#### Parameters

self | the ZeitgeistLog instance |
cancellable | . | [in][allow-none]
_callback_ | callback to call when the request is satisfied. | [scope async]
_user_data_ | the data to pass to `_callback_` function. | [closure]

### zeitgeist_log_quit_finish ()

    void
    zeitgeist_log_quit_finish (ZeitgeistLog *self,
                               GAsyncResult *_res_,
                               GError **error);

a GCancellable to cancel the operation or `NULL`

See also: `zeitgeist_log_quit()`

#### Parameters

self | the ZeitgeistLog instance |
_res_ | a GAsyncResult |
error | location to store the error occuring, or `NULL` to ignore |

### zeitgeist_log_install_monitor ()

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

Install a monitor in the Zeitgeist engine that calls back when events matching event_templates are logged. The matching is done exactly as in the find_* family of methods and in Event.matches_template. Furthermore matched events must also have timestamps lying in time_range.

To remove a monitor call `remove_monitor()` on the returned Monitor instance.

#### Parameters

self | the ZeitgeistLog instance |
monitor | . A ZeitgeistMonitor to report back inserts and deletes . | [in]
error | location to store the error occuring, or `NULL` to ignore |

### zeitgeist_log_remove_monitor ()

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

Remove a monitor from Zeitgeist engine that calls back when events matching event_templates are logged.

#### Parameters

self | the ZeitgeistLog instance |
monitor | . A ZeitgeistMonitor to report back inserts and deletes . | [in][transfer full]
error | location to store the error occuring, or `NULL` to ignore |

### zeitgeist_log_get_version ()

    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 "is-connected" property must be TRUE (you can connect to the "notify::is-connected" signal otherwise).

#### Parameters

self | the ZeitgeistLog instance |
major | . Location for the major version . | [out]
minor | . Location for the minor version . | [out]
micro | . Location for the micro version . | [out]

### zeitgeist_log_get_extensions ()

    gchar **
    zeitgeist_log_get_extensions (ZeitgeistLog *self,
                                  gint *result_length1);

Gets extensions of the running Zeitgeist daemon.

#### Parameters

self | the ZeitgeistLog instance |

#### Returns

array of extenstions names strings

.

[array length=result_length1]

### zeitgeist_log_datapath ()

    gchar *
    zeitgeist_log_datapath (ZeitgeistLog *self);

Gets datapath of the running Zeitgeist daemon.

#### Parameters

self | the ZeitgeistLog instance |

#### Returns

string datapath

### zeitgeist_log_new ()

    ZeitgeistLog *
    zeitgeist_log_new (void);

### zeitgeist_log_get_default ()

    ZeitgeistLog *
    zeitgeist_log_get_default (void);

Get a unique instance of ZeitgeistLog, that you can share in your application without caring about memory management.

See `zeitgeist_log_new()` for more information.

#### Returns

ZeitgeistLog.

## Types and Values

### ZEITGEIST_TYPE_LOG

    #define ZEITGEIST_TYPE_LOG (zeitgeist_log_get_type ())

The type for ZeitgeistLog.

### struct ZeitgeistLog

    struct ZeitgeistLog;

Primary access point for talking to the Zeitgeist daemon

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

### struct ZeitgeistLogClass

    struct ZeitgeistLogClass {
    	ZeitgeistQueuedProxyWrapperClass parent_class;
    };

The class structure for `ZEITGEIST_TYPE_LOG`. All the fields in this structure are private and should never be accessed directly.

#### Members