Blame gdata/services/calendar/gdata-calendar-feed.c

Packit 4b6dd7
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
Packit 4b6dd7
/*
Packit 4b6dd7
 * GData Client
Packit 4b6dd7
 * Copyright (C) Philip Withnall 2009, 2010, 2014, 2015 <philip@tecnocode.co.uk>
Packit 4b6dd7
 *
Packit 4b6dd7
 * GData Client is free software; you can redistribute it and/or
Packit 4b6dd7
 * modify it under the terms of the GNU Lesser General Public
Packit 4b6dd7
 * License as published by the Free Software Foundation; either
Packit 4b6dd7
 * version 2.1 of the License, or (at your option) any later version.
Packit 4b6dd7
 *
Packit 4b6dd7
 * GData Client is distributed in the hope that it will be useful,
Packit 4b6dd7
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 4b6dd7
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 4b6dd7
 * Lesser General Public License for more details.
Packit 4b6dd7
 *
Packit 4b6dd7
 * You should have received a copy of the GNU Lesser General Public
Packit 4b6dd7
 * License along with GData Client.  If not, see <http://www.gnu.org/licenses/>.
Packit 4b6dd7
 */
Packit 4b6dd7
Packit 4b6dd7
/**
Packit 4b6dd7
 * SECTION:gdata-calendar-feed
Packit 4b6dd7
 * @short_description: GData Calendar feed object
Packit 4b6dd7
 * @stability: Stable
Packit 4b6dd7
 * @include: gdata/services/calendar/gdata-calendar-feed.h
Packit 4b6dd7
 *
Packit 4b6dd7
 * #GDataCalendarFeed is a subclass of #GDataFeed to represent a results feed from Google Calendar. It adds a couple of
Packit 4b6dd7
 * properties which are specific to the Google Calendar API.
Packit 4b6dd7
 */
Packit 4b6dd7
Packit 4b6dd7
#include <glib.h>
Packit 4b6dd7
#include <libxml/parser.h>
Packit 4b6dd7
Packit 4b6dd7
#include "gdata-calendar-feed.h"
Packit 4b6dd7
#include "gdata-feed.h"
Packit 4b6dd7
#include "gdata-private.h"
Packit 4b6dd7
Packit 4b6dd7
static void gdata_calendar_feed_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
Packit 4b6dd7
Packit 4b6dd7
enum {
Packit 4b6dd7
	PROP_TIMEZONE = 1,
Packit 4b6dd7
	PROP_TIMES_CLEANED
Packit 4b6dd7
};
Packit 4b6dd7
Packit 4b6dd7
G_DEFINE_TYPE (GDataCalendarFeed, gdata_calendar_feed, GDATA_TYPE_FEED)
Packit 4b6dd7
Packit 4b6dd7
static void
Packit 4b6dd7
gdata_calendar_feed_class_init (GDataCalendarFeedClass *klass)
Packit 4b6dd7
{
Packit 4b6dd7
	GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
Packit 4b6dd7
Packit 4b6dd7
	gobject_class->get_property = gdata_calendar_feed_get_property;
Packit 4b6dd7
Packit 4b6dd7
	/**
Packit 4b6dd7
	 * GDataCalendarFeed:timezone:
Packit 4b6dd7
	 *
Packit 4b6dd7
	 * The timezone in which the feed's times are given. This is a timezone name in tz database notation: 
Packit 4b6dd7
	 * url="http://en.wikipedia.org/wiki/Tz_database#Names_of_time_zones">reference</ulink>.
Packit 4b6dd7
	 *
Packit 4b6dd7
	 * Since: 0.3.0
Packit 4b6dd7
	 * Deprecated: 0.17.2: Unsupported by the online API any more. There
Packit 4b6dd7
	 *   is no replacement; this will always return %NULL.
Packit 4b6dd7
	 */
Packit 4b6dd7
	g_object_class_install_property (gobject_class, PROP_TIMEZONE,
Packit 4b6dd7
	                                 g_param_spec_string ("timezone",
Packit 4b6dd7
	                                                      "Timezone", "The timezone in which the feed's times are given.",
Packit 4b6dd7
	                                                      NULL,
Packit 4b6dd7
	                                                      G_PARAM_DEPRECATED |
Packit 4b6dd7
	                                                      G_PARAM_READABLE |
Packit 4b6dd7
	                                                      G_PARAM_STATIC_STRINGS));
Packit 4b6dd7
Packit 4b6dd7
	/**
Packit 4b6dd7
	 * GDataCalendarFeed:times-cleaned:
Packit 4b6dd7
	 *
Packit 4b6dd7
	 * The number of times the feed has been completely cleared of entries.
Packit 4b6dd7
	 *
Packit 4b6dd7
	 * Since: 0.3.0
Packit 4b6dd7
	 * Deprecated: 0.17.2: Unsupported by the online API any more. There
Packit 4b6dd7
	 *   is no replacement; this will always return 0.
Packit 4b6dd7
	 */
Packit 4b6dd7
	g_object_class_install_property (gobject_class, PROP_TIMES_CLEANED,
Packit 4b6dd7
	                                 g_param_spec_uint ("times-cleaned",
Packit 4b6dd7
	                                                    "Times cleaned", "The number of times the feed has been completely cleared of entries.",
Packit 4b6dd7
	                                                    0, G_MAXUINT, 0,
Packit 4b6dd7
	                                                    G_PARAM_DEPRECATED |
Packit 4b6dd7
	                                                    G_PARAM_READABLE |
Packit 4b6dd7
	                                                    G_PARAM_STATIC_STRINGS));
Packit 4b6dd7
}
Packit 4b6dd7
Packit 4b6dd7
static void
Packit 4b6dd7
gdata_calendar_feed_init (GDataCalendarFeed *self)
Packit 4b6dd7
{
Packit 4b6dd7
	/* Nothing to see here. */
Packit 4b6dd7
}
Packit 4b6dd7
Packit 4b6dd7
static void
Packit 4b6dd7
gdata_calendar_feed_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
Packit 4b6dd7
{
Packit 4b6dd7
	GDataCalendarFeed *self = GDATA_CALENDAR_FEED (object);
Packit 4b6dd7
Packit 4b6dd7
	switch (property_id) {
Packit 4b6dd7
		case PROP_TIMEZONE:
Packit 4b6dd7
			G_GNUC_BEGIN_IGNORE_DEPRECATIONS
Packit 4b6dd7
			g_value_set_string (value,
Packit 4b6dd7
			                    gdata_calendar_feed_get_timezone (self));
Packit 4b6dd7
			G_GNUC_END_IGNORE_DEPRECATIONS
Packit 4b6dd7
			break;
Packit 4b6dd7
		case PROP_TIMES_CLEANED:
Packit 4b6dd7
			G_GNUC_BEGIN_IGNORE_DEPRECATIONS
Packit 4b6dd7
			g_value_set_uint (value,
Packit 4b6dd7
			                  gdata_calendar_feed_get_times_cleaned (self));
Packit 4b6dd7
			G_GNUC_END_IGNORE_DEPRECATIONS
Packit 4b6dd7
			break;
Packit 4b6dd7
		default:
Packit 4b6dd7
			/* We don't have any other property... */
Packit 4b6dd7
			G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
Packit 4b6dd7
			break;
Packit 4b6dd7
	}
Packit 4b6dd7
}
Packit 4b6dd7
Packit 4b6dd7
/**
Packit 4b6dd7
 * gdata_calendar_feed_get_timezone:
Packit 4b6dd7
 * @self: a #GDataCalendarFeed
Packit 4b6dd7
 *
Packit 4b6dd7
 * Gets the #GDataCalendarFeed:timezone property.
Packit 4b6dd7
 *
Packit 4b6dd7
 * Return value: the feed's timezone, or %NULL
Packit 4b6dd7
 *
Packit 4b6dd7
 * Since: 0.3.0
Packit 4b6dd7
 * Deprecated: 0.17.2: Unsupported by the online API any more. There is no
Packit 4b6dd7
 *   replacement; this will always return %NULL.
Packit 4b6dd7
 */
Packit 4b6dd7
const gchar *
Packit 4b6dd7
gdata_calendar_feed_get_timezone (GDataCalendarFeed *self)
Packit 4b6dd7
{
Packit 4b6dd7
	/* Not supported any more by version 3 of the API. */
Packit 4b6dd7
	g_return_val_if_fail (GDATA_IS_CALENDAR_FEED (self), NULL);
Packit 4b6dd7
	return NULL;
Packit 4b6dd7
}
Packit 4b6dd7
Packit 4b6dd7
/**
Packit 4b6dd7
 * gdata_calendar_feed_get_times_cleaned:
Packit 4b6dd7
 * @self: a #GDataCalendarFeed
Packit 4b6dd7
 *
Packit 4b6dd7
 * Gets the #GDataCalendarFeed:times-cleaned property.
Packit 4b6dd7
 *
Packit 4b6dd7
 * Return value: the number of times the feed has been totally emptied
Packit 4b6dd7
 *
Packit 4b6dd7
 * Since: 0.3.0
Packit 4b6dd7
 * Deprecated: 0.17.2: Unsupported by the online API any more. There is no
Packit 4b6dd7
 *   replacement; this will always return %NULL.
Packit 4b6dd7
 */
Packit 4b6dd7
guint
Packit 4b6dd7
gdata_calendar_feed_get_times_cleaned (GDataCalendarFeed *self)
Packit 4b6dd7
{
Packit 4b6dd7
	/* Not supported any more by version 3 of the API. */
Packit 4b6dd7
	g_return_val_if_fail (GDATA_IS_CALENDAR_FEED (self), 0);
Packit 4b6dd7
	return 0;
Packit 4b6dd7
}