ZeitgeistMonitor: Zeitgeist Reference Manual

## ZeitgeistMonitor ZeitgeistMonitor — Listens for updates to the Zeitgeist event log |

## Functions

#define | ZEITGEIST_TYPE_MONITOR
GPtrArray * | zeitgeist_monitor_get_templates ()
char * | zeitgeist_monitor_get_path ()
ZeitgeistMonitor * | zeitgeist_monitor_new ()
ZeitgeistTimeRange * | zeitgeist_monitor_get_time_range ()
void | zeitgeist_monitor_set_time_range ()
GPtrArray * | zeitgeist_monitor_get_event_templates ()
void | zeitgeist_monitor_set_event_templates ()

## Properties

GPtrArray * | event-templates | Read / Write / Construct
ZeitgeistTimeRange * | time-range | Read / Write / Construct

## Signals

void | events-deleted | Run Last
void | events-inserted | Run Last

## Types and Values

struct | ZeitgeistMonitor
struct | ZeitgeistMonitorClass

## Object Hierarchy

        GObject
        ╰── ZeitgeistMonitor

## Implemented Interfaces

ZeitgeistMonitor implements ZeitgeistRemoteMonitor.

## Description

A Monitor listens for updates to the Zeitgeist event log matching a given set of templates and with timestamps in some predefined time range.

A monitor must be installed into the running Zeitgeist daemon by calling `zeitgeist_log_install_monitor()`. The monitor will not emit any of the ::events-added or ::events-deleted signals before this.

## Functions

### ZEITGEIST_TYPE_MONITOR

    #define ZEITGEIST_TYPE_MONITOR (zeitgeist_monitor_get_type ())

The type for ZeitgeistMonitor.

### zeitgeist_monitor_get_templates ()

    GPtrArray *
    zeitgeist_monitor_get_templates (ZeitgeistMonitor *self);

#### Parameters

self | the ZeitgeistMonitor instance |

### zeitgeist_monitor_get_path ()

    char *
    zeitgeist_monitor_get_path (ZeitgeistMonitor *self);

#### Parameters

self | the ZeitgeistMonitor instance |

### zeitgeist_monitor_new ()

    ZeitgeistMonitor *
    zeitgeist_monitor_new (ZeitgeistTimeRange *time_range,
                           GPtrArray *event_templates);

zeitgeist_monitor_new

Create a new monitor. Before you can receive signals from the monitor you need to install it in the running Zeitgeist daemon by calling `zeitgeist_log_install_monitor()`.

#### Parameters

time_range | . The monitor will only listen for events with timestamps within this time range. Note that it is legal for applications to insert events that are "in the past". . | [in]
event_templates | . A GPtrArray of ZeitgeistEvent<!-- -->s. Only listen for events that match any of these templates. . | [in][transfer full]

#### Returns

A reference to a newly allocated monitor

### zeitgeist_monitor_get_time_range ()

    ZeitgeistTimeRange *
    zeitgeist_monitor_get_time_range (ZeitgeistMonitor *self);

Get and return the current value of the "time-range" property.

#### Parameters

self | the ZeitgeistMonitor instance to query |

#### Returns

the value of the "time-range" property

### zeitgeist_monitor_set_time_range ()

    void
    zeitgeist_monitor_set_time_range (ZeitgeistMonitor *self,
                                      ZeitgeistTimeRange *value);

Set the value of the "time-range" property to `value` .

#### Parameters

self | the ZeitgeistMonitor instance to modify |
value | the new value of the "time-range" property |

### zeitgeist_monitor_get_event_templates ()

    GPtrArray *
    zeitgeist_monitor_get_event_templates (ZeitgeistMonitor *self);

Get and return the current value of the "event-templates" property.

#### Parameters

self | the ZeitgeistMonitor instance to query |

#### Returns

the value of the "event-templates" property

### zeitgeist_monitor_set_event_templates ()

    void
    zeitgeist_monitor_set_event_templates (ZeitgeistMonitor *self,
                                           GPtrArray *value);

Set the value of the "event-templates" property to `value` .

#### Parameters

self | the ZeitgeistMonitor instance to modify |
value | the new value of the "event-templates" property |

## Types and Values

### struct ZeitgeistMonitor

    struct ZeitgeistMonitor;

Listens for updates to the Zeitgeist event log

A Monitor listens for updates to the Zeitgeist event log matching a given set of templates and with timestamps in some predefined time range.

A monitor must be installed into the running Zeitgeist daemon by calling `zeitgeist_log_install_monitor()`. The monitor will not emit any of the ::events-added or ::events-deleted signals before this.

### struct ZeitgeistMonitorClass

    struct ZeitgeistMonitorClass {
    	GObjectClass parent_class;
    };

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

#### Members

GObjectClass `parent_class`; | the parent class structure |

## Property Details

### The `“event-templates”` property

      “event-templates”          GPtrArray *

event-templates.

Flags: Read / Write / Construct

### The `“time-range”` property

      “time-range”               ZeitgeistTimeRange *

time-range.

Flags: Read / Write / Construct

## Signal Details

### The `“events-deleted”` signal

    void
    user_function (ZeitgeistMonitor   *monitor,
                   ZeitgeistTimeRange *event_ids_length1,
                   gpointer            time_range,
                   gint                event_ids,
                   gpointer            user_data)

ZeitgeistMonitor::events-deleted:

Emitted when events with timestamps within the time range of this monitor have been deleted from the log. Note that the deleted events may not match the event templates for the monitor.

#### Parameters

monitor | the ZeitgeistMonitor instance that received the signal |
event_ids_length1 | length of the `event_ids` array |
time_range | . A ZeitgeistTimeRange that specifies the minimum and maximum timestamps of the deleted events |
event_ids | . A GArray of guint32<!-- -->s holding the IDs of the deleted events |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“events-inserted”` signal

    void
    user_function (ZeitgeistMonitor   *monitor,
                   ZeitgeistTimeRange *time_range,
                   ZeitgeistResultSet *events,
                   gpointer            user_data)

ZeitgeistMonitor::events-inserted:

Emitted when events matching the event templates and with timestamps within the time range of the monitor has been inserted into the log.

#### Parameters

monitor | the ZeitgeistMonitor instance that received the signal |
time_range | . A ZeitgeistTimeRange that specifies the minimum and maximum of the timestamps in `events` |
events | . A ZeitgeistResultSet holding the "ZeitgeistEvent"s that have been inserted into the log |
user_data | user data set when the signal handler was connected. |

Flags: Run Last