ZeitgeistEvent 3 ZEITGEIST-2.0 Library
ZeitgeistEvent Event objects abstract Zeitgeist events

## Functions

ZeitgeistSubject * | zeitgeist_event_get_subject ()
gint | zeitgeist_event_num_subjects ()
void | zeitgeist_event_add_subject ()
void | zeitgeist_event_take_subject ()
void | zeitgeist_event_set_actor_from_app_info ()
GVariant * | zeitgeist_event_to_variant ()
void | zeitgeist_event_debug_print ()
gboolean | zeitgeist_event_matches_template ()
ZeitgeistEvent * | zeitgeist_event_new_full ()
ZeitgeistEvent * | zeitgeist_event_new_from_variant ()
ZeitgeistEvent * | zeitgeist_event_new ()
guint32 | zeitgeist_event_get_id ()
void | zeitgeist_event_set_id ()
gint64 | zeitgeist_event_get_timestamp ()
void | zeitgeist_event_set_timestamp ()
const gchar * | zeitgeist_event_get_origin ()
void | zeitgeist_event_set_origin ()
const gchar * | zeitgeist_event_get_actor ()
void | zeitgeist_event_set_actor ()
const gchar * | zeitgeist_event_get_interpretation ()
void | zeitgeist_event_set_interpretation ()
const gchar * | zeitgeist_event_get_manifestation ()
void | zeitgeist_event_set_manifestation ()
GPtrArray * | zeitgeist_event_get_subjects ()
void | zeitgeist_event_set_subjects ()
GByteArray * | zeitgeist_event_get_payload ()
void | zeitgeist_event_set_payload ()
GPtrArray * | zeitgeist_events_from_variant ()
GVariant * | zeitgeist_events_to_variant ()
GVariant * | zeitgeist_events_to_variant_with_limit ()

## Properties

gchar * | actor | Read / Write
guint | id | Read / Write
gchar * | interpretation | Read / Write
gchar * | manifestation | Read / Write
gchar * | origin | Read / Write
GByteArray * | payload | Read / Write
GPtrArray * | subjects | Read / Write
gint64 | timestamp | Read / Write

## Types and Values

#define | ZEITGEIST_TYPE_EVENT
#define | ZEITGEIST_EVENT_SIGNATURE
struct | ZeitgeistEvent
struct | ZeitgeistEventClass

## Object Hierarchy

        GObject
        ╰── ZeitgeistEvent

## Description

The Event class is one of the primary elements for communicating with the Zeitgeist daemon. Events serve two purposes Unsurprisingly, they represent events that have happened, but they can also act as templates. See also ZeitgeistSubject.

An event in the Zeitgeist world is characterized by two main properties. "What happened", also called the interpretation, and "How did it happen", also called the manifestation. Besides these properties, an event also has an actor which identifies the party responsible for triggering the event which in most cases will be an application. Lastly there is an event timestamp and an event ID. The timestamp is calculated as the number of milliseconds since the Unix epoch and the event ID is a number assigned to the event by the Zeitgeist engine when it's logged. These five properties are collectively known as the event metadata.

An event must also describe what it happened to. For this we have event subjects. Most events have one subject, but they may also have more. The metadata of the subjects are recorded at the time of logging, and are encapsulated by the Subject class. It's important to understand that it's just the subject metadata at the time of logging, not necessarily the subject metadata as it exists right now.

In addition to the listed properties, events may also carry a free form binary payload. The usage of this is application specific and is generally useless unless you have some contextual information to figure out what's in it.

A large part of the Zeitgeist query and monitoring API revolves around a concept of template matching. A query is simply a list of event templates that you want to look for in the log. An unset property on an event template indicates that anything is allowed in that field. If the property is set it indicates that the property must be an exact match, unless a special operator is used.

## Functions

### zeitgeist_event_get_subject ()

    ZeitgeistSubject *
    zeitgeist_event_get_subject (ZeitgeistEvent *self,
                                 gint index);

#### Parameters

self | the ZeitgeistEvent instance |
index |  |

zeitgeist_event_get_subject

### zeitgeist_event_num_subjects ()

    gint
    zeitgeist_event_num_subjects (ZeitgeistEvent *self);

#### Parameters

self | the ZeitgeistEvent instance |

zeitgeist_event_num_subjects

### zeitgeist_event_add_subject ()

    void
    zeitgeist_event_add_subject (ZeitgeistEvent *self,
                                 ZeitgeistSubject *subject);

#### Parameters

self | the ZeitgeistEvent instance |
subject |  |

zeitgeist_event_add_subject

### zeitgeist_event_take_subject ()

    void
    zeitgeist_event_take_subject (ZeitgeistEvent *self,
                                  ZeitgeistSubject *subject);

#### Parameters

self | the ZeitgeistEvent instance |
subject |  |

zeitgeist_event_take_subject

### zeitgeist_event_set_actor_from_app_info ()

    void
    zeitgeist_event_set_actor_from_app_info
                                   (ZeitgeistEvent *self,
                                    GAppInfo *info);

#### Parameters

self | the ZeitgeistEvent instance |
info |  |

zeitgeist_event_set_actor_from_app_info

### zeitgeist_event_to_variant ()

    GVariant *
    zeitgeist_event_to_variant (ZeitgeistEvent *self);

#### Parameters

self | the ZeitgeistEvent instance |

zeitgeist_event_to_variant

### zeitgeist_event_debug_print ()

    void
    zeitgeist_event_debug_print (ZeitgeistEvent *self);

#### Parameters

self | the ZeitgeistEvent instance |

zeitgeist_event_debug_print

### zeitgeist_event_matches_template ()

    gboolean
    zeitgeist_event_matches_template (ZeitgeistEvent *self,
                                      ZeitgeistEvent *template_event);

#### Parameters

self | the ZeitgeistEvent instance |
template_event |  |

zeitgeist_event_matches_template

### zeitgeist_event_new_full ()

    ZeitgeistEvent *
    zeitgeist_event_new_full (const gchar *interpretation,
                              const gchar *manifestation,
                              const gchar *actor,
                              const gchar *origin,
                              ...);

#### Parameters

interpretation |  |
manifestation |  |
actor |  |
origin |  |
... |  |

zeitgeist_event_new_full

### zeitgeist_event_new_from_variant ()

    ZeitgeistEvent *
    zeitgeist_event_new_from_variant (GVariant *event_variant,
                                      GError **error);

#### Parameters

event_variant |  |
error | location to store the error occuring, or `NULL` to ignore. | [error-domains ZeitgeistDataModelError]

zeitgeist_event_new_from_variant

### zeitgeist_event_new ()

    ZeitgeistEvent *
    zeitgeist_event_new (void);

zeitgeist_event_new

### zeitgeist_event_get_id ()

    guint32
    zeitgeist_event_get_id (ZeitgeistEvent *self);

Get and return the current value of the "id" property.

#### Parameters

self | the ZeitgeistEvent instance to query |

#### Returns

the value of the "id" property

zeitgeist_event_get_id

### zeitgeist_event_set_id ()

    void
    zeitgeist_event_set_id (ZeitgeistEvent *self,
                            guint32 value);

Set the value of the "id" property to value .

#### Parameters

self | the ZeitgeistEvent instance to modify |
value | the new value of the "id" property |

zeitgeist_event_set_id

### zeitgeist_event_get_timestamp ()

    gint64
    zeitgeist_event_get_timestamp (ZeitgeistEvent *self);

Get and return the current value of the "timestamp" property.

#### Parameters

self | the ZeitgeistEvent instance to query |

#### Returns

the value of the "timestamp" property

zeitgeist_event_get_timestamp

### zeitgeist_event_set_timestamp ()

    void
    zeitgeist_event_set_timestamp (ZeitgeistEvent *self,
                                   gint64 value);

Set the value of the "timestamp" property to value .

#### Parameters

self | the ZeitgeistEvent instance to modify |
value | the new value of the "timestamp" property |

zeitgeist_event_set_timestamp

### zeitgeist_event_get_origin ()

    const gchar *
    zeitgeist_event_get_origin (ZeitgeistEvent *self);

Get and return the current value of the "origin" property.

#### Parameters

self | the ZeitgeistEvent instance to query |

#### Returns

the value of the "origin" property

zeitgeist_event_get_origin

### zeitgeist_event_set_origin ()

    void
    zeitgeist_event_set_origin (ZeitgeistEvent *self,
                                const gchar *value);

Set the value of the "origin" property to value .

#### Parameters

self | the ZeitgeistEvent instance to modify |
value | the new value of the "origin" property |

zeitgeist_event_set_origin

### zeitgeist_event_get_actor ()

    const gchar *
    zeitgeist_event_get_actor (ZeitgeistEvent *self);

Get and return the current value of the "actor" property.

#### Parameters

self | the ZeitgeistEvent instance to query |

#### Returns

the value of the "actor" property

zeitgeist_event_get_actor

### zeitgeist_event_set_actor ()

    void
    zeitgeist_event_set_actor (ZeitgeistEvent *self,
                               const gchar *value);

Set the value of the "actor" property to value .

#### Parameters

self | the ZeitgeistEvent instance to modify |
value | the new value of the "actor" property |

zeitgeist_event_set_actor

### zeitgeist_event_get_interpretation ()

    const gchar *
    zeitgeist_event_get_interpretation (ZeitgeistEvent *self);

Get and return the current value of the "interpretation" property.

#### Parameters

self | the ZeitgeistEvent instance to query |

#### Returns

the value of the "interpretation" property

zeitgeist_event_get_interpretation

### zeitgeist_event_set_interpretation ()

    void
    zeitgeist_event_set_interpretation (ZeitgeistEvent *self,
                                        const gchar *value);

Set the value of the "interpretation" property to value .

#### Parameters

self | the ZeitgeistEvent instance to modify |
value | the new value of the "interpretation" property |

zeitgeist_event_set_interpretation

### zeitgeist_event_get_manifestation ()

    const gchar *
    zeitgeist_event_get_manifestation (ZeitgeistEvent *self);

Get and return the current value of the "manifestation" property.

#### Parameters

self | the ZeitgeistEvent instance to query |

#### Returns

the value of the "manifestation" property

zeitgeist_event_get_manifestation

### zeitgeist_event_set_manifestation ()

    void
    zeitgeist_event_set_manifestation (ZeitgeistEvent *self,
                                       const gchar *value);

Set the value of the "manifestation" property to value .

#### Parameters

self | the ZeitgeistEvent instance to modify |
value | the new value of the "manifestation" property |

zeitgeist_event_set_manifestation

### zeitgeist_event_get_subjects ()

    GPtrArray *
    zeitgeist_event_get_subjects (ZeitgeistEvent *self);

Get and return the current value of the "subjects" property.

#### Parameters

self | the ZeitgeistEvent instance to query |

#### Returns

the value of the "subjects" property

zeitgeist_event_get_subjects

### zeitgeist_event_set_subjects ()

    void
    zeitgeist_event_set_subjects (ZeitgeistEvent *self,
                                  GPtrArray *value);

Set the value of the "subjects" property to value .

#### Parameters

self | the ZeitgeistEvent instance to modify |
value | the new value of the "subjects" property |

zeitgeist_event_set_subjects

### zeitgeist_event_get_payload ()

    GByteArray *
    zeitgeist_event_get_payload (ZeitgeistEvent *self);

Get and return the current value of the "payload" property.

#### Parameters

self | the ZeitgeistEvent instance to query |

#### Returns

the value of the "payload" property

zeitgeist_event_get_payload

### zeitgeist_event_set_payload ()

    void
    zeitgeist_event_set_payload (ZeitgeistEvent *self,
                                 GByteArray *value);

Set the value of the "payload" property to value .

#### Parameters

self | the ZeitgeistEvent instance to modify |
value | the new value of the "payload" property |

zeitgeist_event_set_payload

### zeitgeist_events_from_variant ()

    GPtrArray *
    zeitgeist_events_from_variant (GVariant *vevents,
                                   GError **error);

#### Parameters

self | the (null) instance |
vevents |  |
error | location to store the error occuring, or `NULL` to ignore. | [error-domains ZeitgeistDataModelError]

zeitgeist_events_from_variant

### zeitgeist_events_to_variant ()

    GVariant *
    zeitgeist_events_to_variant (GPtrArray *events);

#### Parameters

self | the (null) instance |
events |  |

zeitgeist_events_to_variant

### zeitgeist_events_to_variant_with_limit ()

    GVariant *
    zeitgeist_events_to_variant_with_limit
                                   (GPtrArray *events,
                                    gsize limit,
                                    GError **error);

#### Parameters

self | the (null) instance |
events |  |
limit |  |
error | location to store the error occuring, or `NULL` to ignore. | [error-domains ZeitgeistDataModelError]

zeitgeist_events_to_variant_with_limit

## Types and Values

### ZEITGEIST_TYPE_EVENT

    #define ZEITGEIST_TYPE_EVENT (zeitgeist_event_get_type ())

The type for ZeitgeistEvent.

ZEITGEIST_TYPE_EVENT

### ZEITGEIST_EVENT_SIGNATURE

    #define ZEITGEIST_EVENT_SIGNATURE "asaasay"

ZEITGEIST_EVENT_SIGNATURE

### struct ZeitgeistEvent

    struct ZeitgeistEvent;

Event objects abstract Zeitgeist events

The Event class is one of the primary elements for communicating with the Zeitgeist daemon. Events serve two purposes Unsurprisingly, they represent events that have happened, but they can also act as templates. See also ZeitgeistSubject.

An event in the Zeitgeist world is characterized by two main properties. "What happened", also called the interpretation, and "How did it happen", also called the manifestation. Besides these properties, an event also has an actor which identifies the party responsible for triggering the event which in most cases will be an application. Lastly there is an event timestamp and an event ID. The timestamp is calculated as the number of milliseconds since the Unix epoch and the event ID is a number assigned to the event by the Zeitgeist engine when it's logged. These five properties are collectively known as the event metadata.

An event must also describe what it happened to. For this we have event subjects. Most events have one subject, but they may also have more. The metadata of the subjects are recorded at the time of logging, and are encapsulated by the Subject class. It's important to understand that it's just the subject metadata at the time of logging, not necessarily the subject metadata as it exists right now.

In addition to the listed properties, events may also carry a free form binary payload. The usage of this is application specific and is generally useless unless you have some contextual information to figure out what's in it.

A large part of the Zeitgeist query and monitoring API revolves around a concept of template matching. A query is simply a list of event templates that you want to look for in the log. An unset property on an event template indicates that anything is allowed in that field. If the property is set it indicates that the property must be an exact match, unless a special operator is used.

ZeitgeistEvent

### struct ZeitgeistEventClass

    struct ZeitgeistEventClass {
    	GObjectClass parent_class;
    };

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

#### Members

ZeitgeistEventClass

## Property Details

### The `“actor”` property

      “actor”                    gchar *

actor.

Flags: Read / Write

Default value: NULL

ZeitgeistEvent:actor

### The `“id”` property

      “id”                       guint

id.

Flags: Read / Write

Default value: 0

ZeitgeistEvent:id

### The `“interpretation”` property

      “interpretation”           gchar *

interpretation.

Flags: Read / Write

Default value: NULL

ZeitgeistEvent:interpretation

### The `“manifestation”` property

      “manifestation”            gchar *

manifestation.

Flags: Read / Write

Default value: NULL

ZeitgeistEvent:manifestation

### The `“origin”` property

      “origin”                   gchar *

origin.

Flags: Read / Write

Default value: NULL

ZeitgeistEvent:origin

### The `“payload”` property

      “payload”                  GByteArray *

payload.

Flags: Read / Write

ZeitgeistEvent:payload

### The `“subjects”` property

      “subjects”                 GPtrArray *

subjects.

Flags: Read / Write

ZeitgeistEvent:subjects

### The `“timestamp”` property

      “timestamp”                gint64

timestamp.

Flags: Read / Write

Default value: 0

ZeitgeistEvent:timestamp