20
20
namespace Zeitgeist.Extension
23
* Base class for all extensions
25
* Every extension has to define a list of accessible methods as
26
* 'PUBLIC_METHODS'. The constructor of an Extension object takes the
27
* engine object it extends as the only argument.
29
* In addition each extension has a set of hooks to control how events are
30
* inserted and retrieved from the log. These hooks can either block the
31
* event completely, modify it, or add additional metadata to it.
23
* Base class for all extensions
25
* FIXME: figure out what to do with this. I don't really see
26
* what the point for it is, since D-Bus accessible stuff is
27
* usually exported on a new interface. --RainCT
28
* Every extension has to define a list of accessible methods as
29
* 'PUBLIC_METHODS'. The constructor of an Extension object takes the
30
* engine object it extends as the only argument.
33
* In addition each extension has a set of hooks to control how events are
34
* inserted and retrieved from the log. These hooks can either block the
35
* event completely, modify it, or add additional metadata to it.
33
37
public abstract class Extension : Object
36
* This method gets called before Zeitgeist stops.
38
* Execution of this method isn't guaranteed, and you shouldn't do
39
* anything slow in there.
40
* This method gets called before Zeitgeist stops.
42
* Execution of this method isn't guaranteed, and you shouldn't do
43
* anything slow in there.
41
45
public abstract void unload();
44
* Hook applied to all events before they are inserted into the
45
* log. The returned event is progressively passed through all
46
* extensions before the final result is inserted.
48
* To block an event completely simply return null.
49
* The event may also be modified or completely substituted for
52
* The default implementation of this method simply returns the
55
* @param event: A Event instance
56
* @param sender: The D-Bus bus name of the client
57
* @returns: The filtered event instance to insert into the log
48
* Hook applied to all events before they are inserted into the
49
* log. The returned event is progressively passed through all
50
* extensions before the final result is inserted.
52
* To block an event completely simply return null.
53
* The event may also be modified or completely substituted for
56
* The default implementation of this method simply returns the
59
* @param event: A Event instance
60
* @param sender: The D-Bus bus name of the client
61
* @returns: The filtered event instance to insert into the log
59
63
public abstract Event pre_insert_event(Event event, BusName sender);
62
* Hook applied to all events after they are inserted into the log.
64
* @param event: A Event instance
65
* @param sender: The D-Bus bus name of the client
66
* Hook applied to all events after they are inserted into the log.
68
* @param event: A Event instance
69
* @param sender: The D-Bus bus name of the client
68
72
public abstract void post_insert_event(Event event, BusName sender);
71
* Hook applied to all events before they are returned to a client.
72
* The event returned from this method is progressively passed
73
* through all extensions before they final result is returned to
76
* To prevent an event from ever leaving the server process simply
77
* return null. The event may also be changed in place
78
* or fully substituted for another event.
80
* The default implementation of this method simply returns the
83
* @param event: A Eventinstance or None
84
* @param sender: The D-Bus bus name of the client
85
* @returns: The filtered event instance as the client should see it
75
* Hook applied to all events before they are returned to a client.
76
* The event returned from this method is progressively passed
77
* through all extensions before they final result is returned to
80
* To prevent an event from ever leaving the server process simply
81
* return null. The event may also be changed in place
82
* or fully substituted for another event.
84
* The default implementation of this method simply returns the
87
* @param event: A Eventinstance or None
88
* @param sender: The D-Bus bus name of the client
89
* @returns: The filtered event instance as the client should see it
87
91
public abstract Event get_event(Event event, BusName sender);
90
* Hook applied after events have been deleted from the log.
92
* @param ids: A list of event ids for the events that has been deleted
93
* @param sender: The unique DBus name for the client triggering the delete
96
public abstract void post_delete_events(uint32 ids, BusName sender);
94
* Hook applied after events have been deleted from the log.
96
* @param ids: A list of event ids for the events that has been deleted
97
* @param sender: The unique DBus name for the client triggering the delete
100
public abstract void post_delete_events(uint32[] ids, BusName sender);
99
* Hook applied before events are deleted from the log.
101
* @param ids: A list of event ids for the events requested to be deleted
102
* @param sender: The unique DBus name for the client triggering the delete
103
* @returns: The filtered list of event ids which should be deleted
105
public abstract Event pre_delete_events(uint32 ids, BusName sender);
103
* Hook applied before events are deleted from the log.
105
* @param ids: A list of event ids for the events requested to be deleted
106
* @param sender: The unique DBus name for the client triggering the delete
107
* @returns: The filtered list of event ids which should be deleted
109
public abstract Event pre_delete_events(uint32[] ids, BusName sender);
108
112
// vim:expandtab:ts=4:sw=4