1 /* Evolution calendar - iCalendar file backend for tasks
3 * Copyright (C) 2005 Novell, Inc.
5 * Authors: Rodrigo Moya <rodrigo@novell.com>
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.
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.
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.
21 #include "e-cal-backend-file-journal.h"
23 struct _ECalBackendFileJournalPrivate {
27 static void e_cal_backend_file_journal_class_init (ECalBackendFileJournalClass *class);
28 static void e_cal_backend_file_journal_init (ECalBackendFileJournal *cbfile, ECalBackendFileJournalClass *class);
29 static void e_cal_backend_file_journal_dispose (GObject *object);
30 static void e_cal_backend_file_journal_finalize (GObject *object);
32 static ECalBackendFileClass *parent_class;
35 * e_cal_backend_file_journal_get_type:
38 * Registers the #ECalBackendFileJournal class if necessary, and returns the type ID
41 * Return value: The type ID of the #ECalBackendFileJournal class.
44 e_cal_backend_file_journal_get_type (void)
46 static GType e_cal_backend_file_journal_type = 0;
48 if (!e_cal_backend_file_journal_type) {
49 static GTypeInfo info = {
50 sizeof (ECalBackendFileJournalClass),
52 (GBaseFinalizeFunc) NULL,
53 (GClassInitFunc) e_cal_backend_file_journal_class_init,
55 sizeof (ECalBackendFileJournal),
57 (GInstanceInitFunc) e_cal_backend_file_journal_init
59 e_cal_backend_file_journal_type = g_type_register_static (E_TYPE_CAL_BACKEND_FILE,
60 "ECalBackendFileJournal", &info, 0);
63 return e_cal_backend_file_journal_type;
66 /* Class initialization function for the journal file backend */
68 e_cal_backend_file_journal_class_init (ECalBackendFileJournalClass *klass)
70 GObjectClass *object_class;
71 ECalBackendClass *backend_class;
73 object_class = G_OBJECT_CLASS (klass);
74 backend_class = E_CAL_BACKEND_CLASS (klass);
76 parent_class = g_type_class_peek_parent (klass);
78 object_class->dispose = e_cal_backend_file_journal_dispose;
79 object_class->finalize = e_cal_backend_file_journal_finalize;
82 /* Object initialization function for the journal file backend */
84 e_cal_backend_file_journal_init (ECalBackendFileJournal *cbfile, ECalBackendFileJournalClass *klass)
86 ECalBackendFileJournalPrivate *priv;
88 priv = g_new0 (ECalBackendFileJournalPrivate, 1);
91 e_cal_backend_file_set_file_name (E_CAL_BACKEND_FILE (cbfile), "journal.ics");
94 /* Dispose handler for the journal file backend */
96 e_cal_backend_file_journal_dispose (GObject *object)
98 ECalBackendFileJournal *cbfile;
99 ECalBackendFileJournalPrivate *priv;
101 cbfile = E_CAL_BACKEND_FILE_JOURNAL (object);
104 if (G_OBJECT_CLASS (parent_class)->dispose)
105 (* G_OBJECT_CLASS (parent_class)->dispose) (object);
108 /* Finalize handler for the journal file backend */
110 e_cal_backend_file_journal_finalize (GObject *object)
112 ECalBackendFileJournal *cbfile;
113 ECalBackendFileJournalPrivate *priv;
115 g_return_if_fail (object != NULL);
116 g_return_if_fail (E_IS_CAL_BACKEND_FILE_JOURNAL (object));
118 cbfile = E_CAL_BACKEND_FILE_JOURNAL (object);
121 if (G_OBJECT_CLASS (parent_class)->finalize)
122 (* G_OBJECT_CLASS (parent_class)->finalize) (object);