Logo Search packages:      
Sourcecode: libdesktop-agnostic version File versions  Download package

config-schema-type.h

/* 
 * Desktop Agnostic Library: Configuration Schema Abstract Type.
 *
 * Copyright (C) 2008, 2009 Mark Lee <libdesktop-agnostic@lazymalevolence.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 *
 * Author : Mark Lee <libdesktop-agnostic@lazymalevolence.com>
 */

#ifndef __LIBDESKTOP_AGNOSTIC_CONFIG_SCHEMA_TYPE_H__
#define __LIBDESKTOP_AGNOSTIC_CONFIG_SCHEMA_TYPE_H__

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>

G_BEGIN_DECLS


#define DESKTOP_AGNOSTIC_CONFIG_TYPE_SCHEMA_TYPE (desktop_agnostic_config_schema_type_get_type ())
#define DESKTOP_AGNOSTIC_CONFIG_SCHEMA_TYPE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DESKTOP_AGNOSTIC_CONFIG_TYPE_SCHEMA_TYPE, DesktopAgnosticConfigSchemaType))
#define DESKTOP_AGNOSTIC_CONFIG_SCHEMA_TYPE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DESKTOP_AGNOSTIC_CONFIG_TYPE_SCHEMA_TYPE, DesktopAgnosticConfigSchemaTypeClass))
#define DESKTOP_AGNOSTIC_CONFIG_IS_SCHEMA_TYPE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DESKTOP_AGNOSTIC_CONFIG_TYPE_SCHEMA_TYPE))
#define DESKTOP_AGNOSTIC_CONFIG_IS_SCHEMA_TYPE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DESKTOP_AGNOSTIC_CONFIG_TYPE_SCHEMA_TYPE))
#define DESKTOP_AGNOSTIC_CONFIG_SCHEMA_TYPE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DESKTOP_AGNOSTIC_CONFIG_TYPE_SCHEMA_TYPE, DesktopAgnosticConfigSchemaTypeClass))

typedef struct _DesktopAgnosticConfigSchemaType DesktopAgnosticConfigSchemaType;
typedef struct _DesktopAgnosticConfigSchemaTypeClass DesktopAgnosticConfigSchemaTypeClass;
typedef struct _DesktopAgnosticConfigSchemaTypePrivate DesktopAgnosticConfigSchemaTypePrivate;

/**
   * The definition of a custom schema type. That is, a schema type which is
   * neither one of the primitive types (boolean, integer, float, string) nor
   * a list.
   */
00050 struct _DesktopAgnosticConfigSchemaType {
      GObject parent_instance;
      DesktopAgnosticConfigSchemaTypePrivate * priv;
};

struct _DesktopAgnosticConfigSchemaTypeClass {
      GObjectClass parent_class;
      char* (*serialize) (DesktopAgnosticConfigSchemaType* self, const GValue* val, GError** error);
      GValue (*deserialize) (DesktopAgnosticConfigSchemaType* self, const char* serialized, GError** error);
      GValue (*parse_default_value) (DesktopAgnosticConfigSchemaType* self, GKeyFile* schema, const char* group, GError** error);
      GValueArray* (*parse_default_list_value) (DesktopAgnosticConfigSchemaType* self, GKeyFile* schema, const char* group, GError** error);
      char* (*get_name) (DesktopAgnosticConfigSchemaType* self);
      GType (*get_schema_type) (DesktopAgnosticConfigSchemaType* self);
};


char* desktop_agnostic_config_schema_type_serialize (DesktopAgnosticConfigSchemaType* self, const GValue* val, GError** error);
GValue desktop_agnostic_config_schema_type_deserialize (DesktopAgnosticConfigSchemaType* self, const char* serialized, GError** error);
GValue desktop_agnostic_config_schema_type_parse_default_value (DesktopAgnosticConfigSchemaType* self, GKeyFile* schema, const char* group, GError** error);
GValueArray* desktop_agnostic_config_schema_type_parse_default_list_value (DesktopAgnosticConfigSchemaType* self, GKeyFile* schema, const char* group, GError** error);
char* desktop_agnostic_config_schema_type_get_name (DesktopAgnosticConfigSchemaType* self);
GType desktop_agnostic_config_schema_type_get_schema_type (DesktopAgnosticConfigSchemaType* self);
GType desktop_agnostic_config_schema_type_get_type (void);


G_END_DECLS

#endif

Generated by  Doxygen 1.6.0   Back to index