aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/evolution-calendar.idl
blob: 8b9878d78e6897fc90fd88464d71e90220a0cd5f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/* Evolution calendar interface
 *
 * Copyright (C) 2000 Eskil Heyn Olsen
 * Copyright (C) 2000 Helix Code, Inc.
 *
 * Authors: Eskil Heyn Olsen <deity@eskil.dk>
 *          Federico Mena-Quintero <federico@helixcode.com>
 */

#ifndef _EVOLUTION_CALENDAR_IDL_
#define _EVOLUTION_CALENDAR_IDL_

#include <Bonobo.idl>

module Evolution {

module Calendar {
    /* A calendar object (event/todo/journal/etc), represented as an
     * iCalendar string.
     */
    typedef string CalObj;

    /* An unique identifier for a calendar object */
    typedef string CalObjUID;

    /* Used to store a time_t */
    typedef unsigned long Time_t;

    /* An instance of a calendar object that actually occurs.  These are
     * "virtual" objects in that they are used to represent instances of
     * recurring events and alarms.  "Real" objects just contain the
     * information required to figure out the times at which they recur or
     * trigger.  
     */
    struct CalObjInstance {
        CalObj calobj;
        Time_t start;
        Time_t end;
    };

    typedef sequence<CalObjInstance> CalObjInstanceSeq;

    interface Listener;

    /* Calendar client interface */
    interface Cal : Bonobo::Unknown {
        exception NotFound {};
        exception InvalidRange {};

        /* A calendar is identified by its URI */
        readonly attribute string uri;

        /* Gets an object based on its URI */
        CalObj get_object (in CalObjUID uid)
            raises (NotFound);

        /* Gets the events that occur or recur in the specified time range */
        CalObjInstanceSeq get_events_in_range (in Time_t start, in Time_t end)
            raises (InvalidRange);
    };

    /* Listener for changes in a calendar */
    interface Listener : Bonobo::Unknown {
        /* Return status when loading a calendar; we need better error reporting */
        enum LoadStatus {
            SUCCESS,
            ERROR
        };

        /* Called from a CalFactory when a calendar is initially loaded
         * or created.  The listener must remember the cal object.  
         */
        void cal_loaded (in LoadStatus status, in Cal cal);

        /* Called from a Calendar when an object is added */
        void obj_added (in CalObjUID uid);

        /* Called from a Calendar when an object is removed */
        void obj_removed (in CalObjUID uid);

        /* Called from a Calendar when an object is changed */
        void obj_changed (in CalObjUID uid);
    };

    /* A calendar factory, can load and create calendars */
    interface CalFactory : Bonobo::Unknown {
        exception NilListener {};

        /* Load a calendar from an URI */
        void load (in string uri, in Listener listener)
            raises (NilListener);

        /* Create a new calendar at the specified URI */
        void create (in string uri, in Listener listener)
            raises (NilListener);
    };
};

};

#endif