Fix FSF address (Tobias Mueller, #470445)
[platform/upstream/evolution-data-server.git] / calendar / backends / file / e-cal-backend-file-events.c
1 /* Evolution calendar - iCalendar file backend
2  *
3  * Copyright (C) 2000 Ximian, Inc.
4  * Copyright (C) 2000 Ximian, Inc.
5  *
6  * Authors: Federico Mena-Quintero <federico@ximian.com>
7  *          Rodrigo Moya <rodrigo@ximian.com>
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of version 2 of the GNU Lesser General Public
11  * License as published by the Free Software Foundation.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  */
22
23 #ifdef HAVE_CONFIG_H
24 #include <config.h>
25 #endif
26
27 #include "e-cal-backend-file-events.h"
28
29 \f
30
31 /* Private part of the CalBackendFileEvents structure */
32 struct _ECalBackendFileEventsPrivate {
33         guint reserved;
34 };
35
36 \f
37
38 static void e_cal_backend_file_events_class_init (ECalBackendFileEventsClass *class);
39 static void e_cal_backend_file_events_init (ECalBackendFileEvents *cbfile, ECalBackendFileEventsClass *class);
40 static void e_cal_backend_file_events_dispose (GObject *object);
41 static void e_cal_backend_file_events_finalize (GObject *object);
42
43 static GObjectClass *parent_class;
44
45 \f
46
47 /**
48  * e_cal_backend_file_events_get_type:
49  * @void: 
50  * 
51  * Registers the #ECalBackendFileEvents class if necessary, and returns the type ID
52  * associated to it.
53  * 
54  * Return value: The type ID of the #ECalBackendFileEvents class.
55  **/
56 GType
57 e_cal_backend_file_events_get_type (void)
58 {
59         static GType e_cal_backend_file_events_type = 0;
60
61         if (!e_cal_backend_file_events_type) {
62                 static GTypeInfo info = {
63                         sizeof (ECalBackendFileEventsClass),
64                         (GBaseInitFunc) NULL,
65                         (GBaseFinalizeFunc) NULL,
66                         (GClassInitFunc) e_cal_backend_file_events_class_init,
67                         NULL, NULL,
68                         sizeof (ECalBackendFileEvents),
69                         0,
70                         (GInstanceInitFunc) e_cal_backend_file_events_init
71                 };
72                 e_cal_backend_file_events_type = g_type_register_static (E_TYPE_CAL_BACKEND_FILE,
73                                                                       "ECalBackendFileEvents", &info, 0);
74         }
75
76         return e_cal_backend_file_events_type;
77 }
78
79 /* Class initialization function for the file backend */
80 static void
81 e_cal_backend_file_events_class_init (ECalBackendFileEventsClass *klass)
82 {
83         GObjectClass *object_class;
84         ECalBackendClass *backend_class;
85
86         object_class = G_OBJECT_CLASS (klass);
87         backend_class = E_CAL_BACKEND_CLASS (klass);
88
89         parent_class = g_type_class_peek_parent (klass);
90
91         object_class->dispose = e_cal_backend_file_events_dispose;
92         object_class->finalize = e_cal_backend_file_events_finalize;
93
94 //      backend_class->get_uri = e_cal_backend_file_events_get_uri;
95 }
96
97 /* Object initialization function for the file backend */
98 static void
99 e_cal_backend_file_events_init (ECalBackendFileEvents *cbfile, ECalBackendFileEventsClass *class)
100 {
101         ECalBackendFileEventsPrivate *priv;
102
103         priv = g_new0 (ECalBackendFileEventsPrivate, 1);
104         cbfile->priv = priv;
105
106         e_cal_backend_file_set_file_name (E_CAL_BACKEND_FILE (cbfile), "calendar.ics");
107 }
108
109 /* Dispose handler for the file backend */
110 static void
111 e_cal_backend_file_events_dispose (GObject *object)
112 {
113         ECalBackendFileEvents *cbfile;
114         ECalBackendFileEventsPrivate *priv;
115
116         cbfile = E_CAL_BACKEND_FILE_EVENTS (object);
117         priv = cbfile->priv;
118
119         if (G_OBJECT_CLASS (parent_class)->dispose)
120                 (* G_OBJECT_CLASS (parent_class)->dispose) (object);
121 }
122
123 /* Finalize handler for the file backend */
124 static void
125 e_cal_backend_file_events_finalize (GObject *object)
126 {
127         ECalBackendFileEvents *cbfile;
128         ECalBackendFileEventsPrivate *priv;
129
130         g_return_if_fail (object != NULL);
131         g_return_if_fail (E_IS_CAL_BACKEND_FILE_EVENTS (object));
132
133         cbfile = E_CAL_BACKEND_FILE_EVENTS (object);
134         priv = cbfile->priv;
135
136         if (G_OBJECT_CLASS (parent_class)->finalize)
137                 (* G_OBJECT_CLASS (parent_class)->finalize) (object);
138 }
139