Fix FSF address (Tobias Mueller, #470445)
[platform/upstream/evolution-data-server.git] / calendar / backends / file / e-cal-backend-file-todos.c
1 /* Evolution calendar - iCalendar file backend for tasks
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 #include "e-cal-backend-file-todos.h"
24
25 \f
26
27 /* Private part of the ECalBackendFileTodos structure */
28 struct _ECalBackendFileTodosPrivate {
29         guint reserved;
30 };
31
32 \f
33
34 static void e_cal_backend_file_todos_class_init (ECalBackendFileTodosClass *class);
35 static void e_cal_backend_file_todos_init (ECalBackendFileTodos *cbfile, ECalBackendFileTodosClass *class);
36 static void e_cal_backend_file_todos_dispose (GObject *object);
37 static void e_cal_backend_file_todos_finalize (GObject *object);
38
39 static ECalBackendFileClass *parent_class;
40
41 \f
42
43 /**
44  * e_cal_backend_file_todos_get_type:
45  * @void: 
46  * 
47  * Registers the #ECalBackendFileTodos class if necessary, and returns the type ID
48  * associated to it.
49  * 
50  * Return value: The type ID of the #ECalBackendFileTodos class.
51  **/
52 GType
53 e_cal_backend_file_todos_get_type (void)
54 {
55         static GType e_cal_backend_file_todos_type = 0;
56
57         if (!e_cal_backend_file_todos_type) {
58                 static GTypeInfo info = {
59                         sizeof (ECalBackendFileTodosClass),
60                         (GBaseInitFunc) NULL,
61                         (GBaseFinalizeFunc) NULL,
62                         (GClassInitFunc) e_cal_backend_file_todos_class_init,
63                         NULL, NULL,
64                         sizeof (ECalBackendFileTodos),
65                         0,
66                         (GInstanceInitFunc) e_cal_backend_file_todos_init
67                 };
68                 e_cal_backend_file_todos_type = g_type_register_static (E_TYPE_CAL_BACKEND_FILE,
69                                                                       "ECalBackendFileTodos", &info, 0);
70         }
71
72         return e_cal_backend_file_todos_type;
73 }
74
75 /* Class initialization function for the file backend */
76 static void
77 e_cal_backend_file_todos_class_init (ECalBackendFileTodosClass *klass)
78 {
79         GObjectClass *object_class;
80         ECalBackendClass *backend_class;
81
82         object_class = G_OBJECT_CLASS (klass);
83         backend_class = E_CAL_BACKEND_CLASS (klass);
84
85         parent_class = g_type_class_peek_parent (klass);
86
87         object_class->dispose = e_cal_backend_file_todos_dispose;
88         object_class->finalize = e_cal_backend_file_todos_finalize;
89
90 //      backend_class->get_uri = e_cal_backend_file_todos_get_uri;
91 }
92
93 /* Object initialization function for the file backend */
94 static void
95 e_cal_backend_file_todos_init (ECalBackendFileTodos *cbfile, ECalBackendFileTodosClass *class)
96 {
97         ECalBackendFileTodosPrivate *priv;
98
99         priv = g_new0 (ECalBackendFileTodosPrivate, 1);
100         cbfile->priv = priv;
101
102         e_cal_backend_file_set_file_name (E_CAL_BACKEND_FILE (cbfile), "tasks.ics");
103 }
104
105 /* Dispose handler for the file backend */
106 static void
107 e_cal_backend_file_todos_dispose (GObject *object)
108 {
109         ECalBackendFileTodos *cbfile;
110         ECalBackendFileTodosPrivate *priv;
111
112         cbfile = E_CAL_BACKEND_FILE_TODOS (object);
113         priv = cbfile->priv;
114
115         if (G_OBJECT_CLASS (parent_class)->dispose)
116                 (* G_OBJECT_CLASS (parent_class)->dispose) (object);
117 }
118
119 /* Finalize handler for the file backend */
120 static void
121 e_cal_backend_file_todos_finalize (GObject *object)
122 {
123         ECalBackendFileTodos *cbfile;
124         ECalBackendFileTodosPrivate *priv;
125
126         g_return_if_fail (object != NULL);
127         g_return_if_fail (E_IS_CAL_BACKEND_FILE_TODOS (object));
128
129         cbfile = E_CAL_BACKEND_FILE_TODOS (object);
130         priv = cbfile->priv;
131
132         if (G_OBJECT_CLASS (parent_class)->finalize)
133                 (* G_OBJECT_CLASS (parent_class)->finalize) (object);
134 }
135