1 /* Evolution calendar - iCalendar file backend
3 * Copyright (C) 2000 Ximian, Inc.
4 * Copyright (C) 2000 Ximian, Inc.
6 * Authors: Federico Mena-Quintero <federico@ximian.com>
7 * Rodrigo Moya <rodrigo@ximian.com>
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.
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.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
27 #include "e-cal-backend-file-events.h"
31 /* Private part of the CalBackendFileEvents structure */
32 struct _ECalBackendFileEventsPrivate {
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);
43 static GObjectClass *parent_class;
48 * e_cal_backend_file_events_get_type:
51 * Registers the #ECalBackendFileEvents class if necessary, and returns the type ID
54 * Return value: The type ID of the #ECalBackendFileEvents class.
57 e_cal_backend_file_events_get_type (void)
59 static GType e_cal_backend_file_events_type = 0;
61 if (!e_cal_backend_file_events_type) {
62 static GTypeInfo info = {
63 sizeof (ECalBackendFileEventsClass),
65 (GBaseFinalizeFunc) NULL,
66 (GClassInitFunc) e_cal_backend_file_events_class_init,
68 sizeof (ECalBackendFileEvents),
70 (GInstanceInitFunc) e_cal_backend_file_events_init
72 e_cal_backend_file_events_type = g_type_register_static (E_TYPE_CAL_BACKEND_FILE,
73 "ECalBackendFileEvents", &info, 0);
76 return e_cal_backend_file_events_type;
79 /* Class initialization function for the file backend */
81 e_cal_backend_file_events_class_init (ECalBackendFileEventsClass *klass)
83 GObjectClass *object_class;
84 ECalBackendClass *backend_class;
86 object_class = G_OBJECT_CLASS (klass);
87 backend_class = E_CAL_BACKEND_CLASS (klass);
89 parent_class = g_type_class_peek_parent (klass);
91 object_class->dispose = e_cal_backend_file_events_dispose;
92 object_class->finalize = e_cal_backend_file_events_finalize;
94 // backend_class->get_uri = e_cal_backend_file_events_get_uri;
97 /* Object initialization function for the file backend */
99 e_cal_backend_file_events_init (ECalBackendFileEvents *cbfile, ECalBackendFileEventsClass *class)
101 ECalBackendFileEventsPrivate *priv;
103 priv = g_new0 (ECalBackendFileEventsPrivate, 1);
106 e_cal_backend_file_set_file_name (E_CAL_BACKEND_FILE (cbfile), "calendar.ics");
109 /* Dispose handler for the file backend */
111 e_cal_backend_file_events_dispose (GObject *object)
113 ECalBackendFileEvents *cbfile;
114 ECalBackendFileEventsPrivate *priv;
116 cbfile = E_CAL_BACKEND_FILE_EVENTS (object);
119 if (G_OBJECT_CLASS (parent_class)->dispose)
120 (* G_OBJECT_CLASS (parent_class)->dispose) (object);
123 /* Finalize handler for the file backend */
125 e_cal_backend_file_events_finalize (GObject *object)
127 ECalBackendFileEvents *cbfile;
128 ECalBackendFileEventsPrivate *priv;
130 g_return_if_fail (object != NULL);
131 g_return_if_fail (E_IS_CAL_BACKEND_FILE_EVENTS (object));
133 cbfile = E_CAL_BACKEND_FILE_EVENTS (object);
136 if (G_OBJECT_CLASS (parent_class)->finalize)
137 (* G_OBJECT_CLASS (parent_class)->finalize) (object);