Fix FSF address (Tobias Mueller, #470445)
[platform/upstream/evolution-data-server.git] / calendar / libecal / e-cal-listener.h
1 /* Evolution calendar listener
2  *
3  * Copyright (C) 2001 Ximian, Inc.
4  *
5  * Author: Federico Mena-Quintero <federico@ximian.com>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of version 2 of the GNU Lesser General Public
9  * License as published by the Free Software Foundation.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  */
20
21 #ifndef E_CAL_LISTENER_H
22 #define E_CAL_LISTENER_H
23
24 #include <bonobo/bonobo-object.h>
25 #include <libecal/e-cal-types.h>
26
27 #include "Evolution-DataServer-Calendar.h"
28
29 G_BEGIN_DECLS
30
31 \f
32
33 #define E_TYPE_CAL_LISTENER            (e_cal_listener_get_type ())
34 #define E_CAL_LISTENER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_CAL_LISTENER, ECalListener))
35 #define E_CAL_LISTENER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_CAL_LISTENER,  \
36                                       ECalListenerClass))
37 #define E_IS_CAL_LISTENER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_CAL_LISTENER))
38 #define E_IS_CAL_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_CAL_LISTENER))
39
40 typedef struct ECalListenerPrivate ECalListenerPrivate;
41
42 typedef struct {
43         BonoboObject xobject;
44
45         /*< private >*/
46         ECalListenerPrivate *priv;
47 } ECalListener;
48
49 typedef struct {
50         BonoboObjectClass parent_class;
51
52         POA_GNOME_Evolution_Calendar_CalListener__epv epv;
53
54         /* Signals */
55         void (*read_only) (ECalListener *listener, ECalendarStatus status, gboolean read_only);
56         void (*cal_address) (ECalListener *listener, ECalendarStatus status, const char *address);
57         void (*alarm_address) (ECalListener *listener, ECalendarStatus status, const char *address);
58         void (*ldap_attribute) (ECalListener *listener, ECalendarStatus status, const char *ldap_attribute);
59         void (*static_capabilities) (ECalListener *listener, ECalendarStatus status, const char *capabilities);
60
61         void (*open) (ECalListener *listener, ECalendarStatus status);
62         void (*remove) (ECalListener *listener, ECalendarStatus status);
63
64         void (*create_object) (ECalListener *listener, ECalendarStatus status, const char *id);
65         void (*modify_object) (ECalListener *listener, ECalendarStatus status);
66         void (*remove_object) (ECalListener *listener, ECalendarStatus status);
67
68         void (*discard_alarm) (ECalListener *listener, ECalendarStatus status);
69
70         void (*receive_objects) (ECalListener *listener, ECalendarStatus status);
71         void (*send_objects) (ECalListener *listener, ECalendarStatus status, GList *users, const char *object);
72
73         void (*default_object) (ECalListener *listener, ECalendarStatus status, const char *object);
74         void (*object) (ECalListener *listener, ECalendarStatus status, const char *object);
75         void (*object_list) (ECalListener *listener, ECalendarStatus status, GList **objects);
76
77         void (*attachment_list) (ECalListener *listener, ECalendarStatus status, GSList **objects);
78         
79         void (*get_timezone) (ECalListener *listener, ECalendarStatus status, const char *object);
80         void (*add_timezone) (ECalListener *listener, ECalendarStatus status, const char *tzid);
81         void (*set_default_timezone) (ECalListener *listener, ECalendarStatus status, const char *tzid);
82
83         void (*get_changes) (ECalListener *listener, ECalendarStatus status, GList *changes);
84         void (*get_free_busy) (ECalListener *listener, ECalendarStatus status, GList *freebusy);
85         
86         void (*query) (ECalListener *listener, ECalendarStatus status, GNOME_Evolution_Calendar_CalView query);
87
88         void (*auth_required)      (ECalListener *listener);
89         void (*backend_error) (ECalListener *listener, ECalendarStatus status, const char *message);
90 } ECalListenerClass;
91
92 /* Notification functions */
93 typedef void (* ECalListenerCalSetModeFn) (ECalListener *listener,
94                                           GNOME_Evolution_Calendar_CalListener_SetModeStatus status,
95                                           GNOME_Evolution_Calendar_CalMode mode,
96                                           gpointer data);
97
98 GType e_cal_listener_get_type (void);
99
100 ECalListener *e_cal_listener_construct (ECalListener *listener,
101                                      ECalListenerCalSetModeFn cal_set_mode_fn,
102                                      gpointer fn_data);
103
104 ECalListener *e_cal_listener_new (ECalListenerCalSetModeFn cal_set_mode_fn,
105                                gpointer fn_data);
106
107 void e_cal_listener_stop_notification (ECalListener *listener);
108
109 \f
110
111 G_END_DECLS
112
113 #endif