ZeitgeistEvent

ZeitgeistEvent — Event objects abstract Zeitgeist events

Synopsis

#define             ZEITGEIST_TYPE_EVENT
ZeitgeistSubject *  zeitgeist_event_get_subject         (ZeitgeistEvent *self,
                                                         gint index);
gint                zeitgeist_event_num_subjects        (ZeitgeistEvent *self);
void                zeitgeist_event_add_subject         (ZeitgeistEvent *self,
                                                         ZeitgeistSubject *subject);
void                zeitgeist_event_take_subject        (ZeitgeistEvent *self,
                                                         ZeitgeistSubject *subject);
void                zeitgeist_event_set_actor_from_app_info
                                                        (ZeitgeistEvent *self,
                                                         GAppInfo *info);
GVariant *          zeitgeist_event_to_variant          (ZeitgeistEvent *self);
void                zeitgeist_event_debug_print         (ZeitgeistEvent *self);
gboolean            zeitgeist_event_matches_template    (ZeitgeistEvent *self,
                                                         ZeitgeistEvent *template_event);
#define             ZEITGEIST_EVENT_SIGNATURE
ZeitgeistEvent *    zeitgeist_event_new_full            (const gchar *interpretation,
                                                         const gchar *manifestation,
                                                         const gchar *actor,
                                                         const gchar *origin,
                                                         ...);
ZeitgeistEvent *    zeitgeist_event_new_from_variant    (GVariant *event_variant,
                                                         GError **error);
ZeitgeistEvent *    zeitgeist_event_new                 (void);
guint32             zeitgeist_event_get_id              (ZeitgeistEvent *self);
void                zeitgeist_event_set_id              (ZeitgeistEvent *self,
                                                         guint32 value);
gint64              zeitgeist_event_get_timestamp       (ZeitgeistEvent *self);
void                zeitgeist_event_set_timestamp       (ZeitgeistEvent *self,
                                                         gint64 value);
const gchar *       zeitgeist_event_get_origin          (ZeitgeistEvent *self);
void                zeitgeist_event_set_origin          (ZeitgeistEvent *self,
                                                         const gchar *value);
const gchar *       zeitgeist_event_get_actor           (ZeitgeistEvent *self);
void                zeitgeist_event_set_actor           (ZeitgeistEvent *self,
                                                         const gchar *value);
const gchar *       zeitgeist_event_get_interpretation  (ZeitgeistEvent *self);
void                zeitgeist_event_set_interpretation  (ZeitgeistEvent *self,
                                                         const gchar *value);
const gchar *       zeitgeist_event_get_manifestation   (ZeitgeistEvent *self);
void                zeitgeist_event_set_manifestation   (ZeitgeistEvent *self,
                                                         const gchar *value);
GPtrArray *         zeitgeist_event_get_subjects        (ZeitgeistEvent *self);
void                zeitgeist_event_set_subjects        (ZeitgeistEvent *self,
                                                         GPtrArray *value);
GByteArray *        zeitgeist_event_get_payload         (ZeitgeistEvent *self);
void                zeitgeist_event_set_payload         (ZeitgeistEvent *self,
                                                         GByteArray *value);
struct              ZeitgeistEvent;
struct              ZeitgeistEventClass;
GPtrArray *         zeitgeist_events_from_variant       (GVariant *vevents,
                                                         GError **error);
GVariant *          zeitgeist_events_to_variant         (GPtrArray *events);
GVariant *          zeitgeist_events_to_variant_with_limit
                                                        (GPtrArray *events,
                                                         gsize limit,
                                                         GError **error);

Object Hierarchy

  GObject
   +----ZeitgeistEvent

Properties

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

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.

Details

ZEITGEIST_TYPE_EVENT

#define ZEITGEIST_TYPE_EVENT (zeitgeist_event_get_type ())

The type for ZeitgeistEvent.


zeitgeist_event_get_subject ()

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

self :

the ZeitgeistEvent instance

index :

 

zeitgeist_event_num_subjects ()

gint                zeitgeist_event_num_subjects        (ZeitgeistEvent *self);

self :

the ZeitgeistEvent instance

zeitgeist_event_add_subject ()

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

self :

the ZeitgeistEvent instance

subject :

 

zeitgeist_event_take_subject ()

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

self :

the ZeitgeistEvent instance

subject :

 

zeitgeist_event_set_actor_from_app_info ()

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

self :

the ZeitgeistEvent instance

info :

 

zeitgeist_event_to_variant ()

GVariant *          zeitgeist_event_to_variant          (ZeitgeistEvent *self);

self :

the ZeitgeistEvent instance

zeitgeist_event_debug_print ()

void                zeitgeist_event_debug_print         (ZeitgeistEvent *self);

self :

the ZeitgeistEvent instance

zeitgeist_event_matches_template ()

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

self :

the ZeitgeistEvent instance

template_event :

 

ZEITGEIST_EVENT_SIGNATURE

#define ZEITGEIST_EVENT_SIGNATURE "asaasay"

zeitgeist_event_new_full ()

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

interpretation :

 

manifestation :

 

actor :

 

origin :

 

... :

 

zeitgeist_event_new_from_variant ()

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

event_variant :

 

error :

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

zeitgeist_event_new ()

ZeitgeistEvent *    zeitgeist_event_new                 (void);

zeitgeist_event_get_id ()

guint32             zeitgeist_event_get_id              (ZeitgeistEvent *self);

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

self :

the ZeitgeistEvent instance to query

Returns :

the value of the "id" property

zeitgeist_event_set_id ()

void                zeitgeist_event_set_id              (ZeitgeistEvent *self,
                                                         guint32 value);

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

self :

the ZeitgeistEvent instance to modify

value :

the new value of the "id" property

zeitgeist_event_get_timestamp ()

gint64              zeitgeist_event_get_timestamp       (ZeitgeistEvent *self);

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

self :

the ZeitgeistEvent instance to query

Returns :

the value of the "timestamp" property

zeitgeist_event_set_timestamp ()

void                zeitgeist_event_set_timestamp       (ZeitgeistEvent *self,
                                                         gint64 value);

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

self :

the ZeitgeistEvent instance to modify

value :

the new value of the "timestamp" property

zeitgeist_event_get_origin ()

const gchar *       zeitgeist_event_get_origin          (ZeitgeistEvent *self);

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

self :

the ZeitgeistEvent instance to query

Returns :

the value of the "origin" property

zeitgeist_event_set_origin ()

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

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

self :

the ZeitgeistEvent instance to modify

value :

the new value of the "origin" property

zeitgeist_event_get_actor ()

const gchar *       zeitgeist_event_get_actor           (ZeitgeistEvent *self);

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

self :

the ZeitgeistEvent instance to query

Returns :

the value of the "actor" property

zeitgeist_event_set_actor ()

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

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

self :

the ZeitgeistEvent instance to modify

value :

the new value of the "actor" property

zeitgeist_event_get_interpretation ()

const gchar *       zeitgeist_event_get_interpretation  (ZeitgeistEvent *self);

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

self :

the ZeitgeistEvent instance to query

Returns :

the value of the "interpretation" property

zeitgeist_event_set_interpretation ()

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

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

self :

the ZeitgeistEvent instance to modify

value :

the new value of the "interpretation" property

zeitgeist_event_get_manifestation ()

const gchar *       zeitgeist_event_get_manifestation   (ZeitgeistEvent *self);

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

self :

the ZeitgeistEvent instance to query

Returns :

the value of the "manifestation" property

zeitgeist_event_set_manifestation ()

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

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

self :

the ZeitgeistEvent instance to modify

value :

the new value of the "manifestation" property

zeitgeist_event_get_subjects ()

GPtrArray *         zeitgeist_event_get_subjects        (ZeitgeistEvent *self);

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

self :

the ZeitgeistEvent instance to query

Returns :

the value of the "subjects" property

zeitgeist_event_set_subjects ()

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

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

self :

the ZeitgeistEvent instance to modify

value :

the new value of the "subjects" property

zeitgeist_event_get_payload ()

GByteArray *        zeitgeist_event_get_payload         (ZeitgeistEvent *self);

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

self :

the ZeitgeistEvent instance to query

Returns :

the value of the "payload" property

zeitgeist_event_set_payload ()

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

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

self :

the ZeitgeistEvent instance to modify

value :

the new value of the "payload" property

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.


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.

GObjectClass parent_class;

the parent class structure

zeitgeist_events_from_variant ()

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

self :

the (null) instance

vevents :

 

error :

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

zeitgeist_events_to_variant ()

GVariant *          zeitgeist_events_to_variant         (GPtrArray *events);

self :

the (null) instance

events :

 

zeitgeist_events_to_variant_with_limit ()

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

self :

the (null) instance

events :

 

limit :

 

error :

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

Property Details

The "actor" property

  "actor"                    gchar*                : Read / Write

actor.

Default value: NULL


The "id" property

  "id"                       guint                 : Read / Write

id.

Default value: 0


The "interpretation" property

  "interpretation"           gchar*                : Read / Write

interpretation.

Default value: NULL


The "manifestation" property

  "manifestation"            gchar*                : Read / Write

manifestation.

Default value: NULL


The "origin" property

  "origin"                   gchar*                : Read / Write

origin.

Default value: NULL


The "payload" property

  "payload"                  GByteArray*           : Read / Write

payload.


The "subjects" property

  "subjects"                 GPtrArray*            : Read / Write

subjects.


The "timestamp" property

  "timestamp"                gint64                : Read / Write

timestamp.

Default value: 0