~zeitgeist/zeitgeist/bluebird_basedir

« back to all changes in this revision

Viewing changes to src/extension.vala

  • Committer: Siegfried-Angel Gevatter Pujals
  • Date: 2011-07-28 13:02:50 UTC
  • Revision ID: siegfried@gevatter.com-20110728130250-6qbae8da3msow1t7
Fix some event_id type declarations, documentation indentation and
add FIXME about PUBLIC_METHODS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
namespace Zeitgeist.Extension
21
21
{
22
22
    /**
23
 
    * Base class for all extensions
24
 
    *
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.
28
 
    *
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.
32
 
    */
 
23
     * Base class for all extensions
 
24
     *
 
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.
 
31
     * ---
 
32
     *
 
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.
 
36
     */
33
37
    public abstract class Extension : Object
34
38
    {
35
39
        /**
36
 
        * This method gets called before Zeitgeist stops.
37
 
        * 
38
 
        * Execution of this method isn't guaranteed, and you shouldn't do
39
 
        * anything slow in there.
40
 
        */
 
40
         * This method gets called before Zeitgeist stops.
 
41
         * 
 
42
         * Execution of this method isn't guaranteed, and you shouldn't do
 
43
         * anything slow in there.
 
44
         */
41
45
        public abstract void unload();
42
46
    
43
47
        /**
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.
47
 
        *
48
 
        * To block an event completely simply return null.
49
 
        * The event may also be modified or completely substituted for
50
 
        * another event.
51
 
        *
52
 
        * The default implementation of this method simply returns the
53
 
        * event as is.
54
 
        *
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
58
 
        */
 
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.
 
51
         *
 
52
         * To block an event completely simply return null.
 
53
         * The event may also be modified or completely substituted for
 
54
         * another event.
 
55
         *
 
56
         * The default implementation of this method simply returns the
 
57
         * event as is.
 
58
         *
 
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
 
62
         */
59
63
        public abstract Event pre_insert_event(Event event, BusName sender);
60
64
    
61
65
        /**
62
 
        * Hook applied to all events after they are inserted into the log.
63
 
        * 
64
 
        * @param event: A Event instance
65
 
        * @param sender: The D-Bus bus name of the client
66
 
        * @returns: Nothing
67
 
        */
 
66
         * Hook applied to all events after they are inserted into the log.
 
67
         * 
 
68
         * @param event: A Event instance
 
69
         * @param sender: The D-Bus bus name of the client
 
70
         * @returns: Nothing
 
71
         */
68
72
        public abstract void post_insert_event(Event event, BusName sender);
69
73
    
70
74
        /**
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
74
 
        * the client.
75
 
        *
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.
79
 
        *
80
 
        * The default implementation of this method simply returns the
81
 
        * event as is.
82
 
        *
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
86
 
        */
 
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
 
78
         * the client.
 
79
         *
 
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.
 
83
         *
 
84
         * The default implementation of this method simply returns the
 
85
         * event as is.
 
86
         *
 
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
 
90
         */
87
91
        public abstract Event get_event(Event event, BusName sender);
88
92
    
89
93
        /**
90
 
        * Hook applied after events have been deleted from the log.
91
 
        *
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
94
 
        * @returns: Nothing
95
 
        */
96
 
        public abstract void post_delete_events(uint32 ids, BusName sender);
 
94
         * Hook applied after events have been deleted from the log.
 
95
         *
 
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
 
98
         * @returns: Nothing
 
99
         */
 
100
        public abstract void post_delete_events(uint32[] ids, BusName sender);
97
101
    
98
102
        /**
99
 
        * Hook applied before events are deleted from the log.
100
 
        * 
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
104
 
        */
105
 
        public abstract Event pre_delete_events(uint32 ids, BusName sender);
 
103
         * Hook applied before events are deleted from the log.
 
104
         *
 
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
 
108
         */
 
109
        public abstract Event pre_delete_events(uint32[] ids, BusName sender);
106
110
    }
107
111
}
108
112
// vim:expandtab:ts=4:sw=4