go-data-cache-source.c 2.16 KB
Newer Older
1 2
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
Morten Welinder's avatar
Morten Welinder committed
3
 * go-data-cache-source.c:
4 5 6 7
 *
 * Copyright (C) 2008 Jody Goldberg (jody@gnome.org)
 *
 * This program is free software; you can redistribute it and/or
8 9 10
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) version 3.
11 12 13 14 15 16 17 18 19 20 21 22
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
 * USA
 */

23
#include <goffice/goffice.h>
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
#include <gnumeric-config.h>
#include "go-data-cache-source.h"

GType
go_data_cache_source_get_type (void)
{
	static GType go_data_cache_source_type = 0;

	if (!go_data_cache_source_type) {
		static GTypeInfo const go_data_cache_source_info = {
			sizeof (GODataCacheSourceClass),	/* class_size */
			NULL,		/* base_init */
			NULL,		/* base_finalize */
		};

		go_data_cache_source_type = g_type_register_static (G_TYPE_INTERFACE,
			"GODataCacheSource", &go_data_cache_source_info, 0);
	}

	return go_data_cache_source_type;
}

/**
 * go_data_cache_source_allocate:
 * @src: a #GODataCacheSource
 *
 * Creates a ref to a new #GODataCache from @src.
 *
 * Returns : a #GODataCache
 **/
GODataCache *
go_data_cache_source_allocate (GODataCacheSource const *src)
{
	g_return_val_if_fail (IS_GO_DATA_CACHE_SOURCE (src), NULL);

	return GO_DATA_CACHE_SOURCE_GET_CLASS (src)->allocate (src);
}

/**
 * go_data_cache_source_needs_update:
 * @src: a #GODataCacheSource
 *
 * Has @src changed since the last call to go_data_cache_source_allocate.
 *
 * Returns: %TRUE if @src has changed.
 **/
gboolean
go_data_cache_source_needs_update (GODataCacheSource const *src)
{
	g_return_val_if_fail (IS_GO_DATA_CACHE_SOURCE (src), FALSE);
	return GO_DATA_CACHE_SOURCE_GET_CLASS (src)->needs_update (src);
}