1 /* Evolution calendar - weather backend source class
3 * Copyright (C) 2005 Novell, Inc (www.novell.com)
5 * Authors: David Trowbridge <trowbrds@cs.colorado.edu>
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-weather-source.h"
22 #include "e-weather-source-ccf.h"
27 e_weather_source_parse (EWeatherSource *source, EWeatherSourceFinished done, gpointer data)
29 EWeatherSourceClass *class;
30 g_return_if_fail (source != NULL);
31 class = (EWeatherSourceClass*) G_OBJECT_GET_CLASS (source);
32 class->parse (source, done, data);
36 e_weather_source_class_init (EWeatherSourceClass *class)
38 /* nothing to do here */
42 e_weather_source_init (EWeatherSource *source)
44 /* nothing to do here */
48 e_weather_source_get_type (void)
50 static GType e_weather_source_type = 0;
52 if (!e_weather_source_type) {
53 static GTypeInfo info = {
54 sizeof (EWeatherSourceClass),
56 (GBaseFinalizeFunc) NULL,
57 (GClassInitFunc) e_weather_source_class_init,
59 sizeof (EWeatherSource),
61 (GInstanceInitFunc) e_weather_source_init
63 e_weather_source_type = g_type_register_static (G_TYPE_OBJECT, "EWeatherSource", &info, 0);
66 return e_weather_source_type;
69 EWeatherSource* e_weather_source_new (const char *uri)
71 const char *base = uri + 10; /* skip weather:// */
73 if (strncmp (base, "ccf/", 4) == 0)
74 return e_weather_source_ccf_new (base);