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

config-schema.h

/* 
 * Desktop Agnostic Library: Configuration Schema.
 *
 * 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_H__
#define __LIBDESKTOP_AGNOSTIC_CONFIG_SCHEMA_H__

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <libdesktop-agnostic/config-iface.h>
#include <libdesktop-agnostic/config-schema-type.h>
#include <libdesktop-agnostic/config-schema-option.h>

G_BEGIN_DECLS


#define DESKTOP_AGNOSTIC_CONFIG_TYPE_SCHEMA (desktop_agnostic_config_schema_get_type ())
#define DESKTOP_AGNOSTIC_CONFIG_SCHEMA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DESKTOP_AGNOSTIC_CONFIG_TYPE_SCHEMA, DesktopAgnosticConfigSchema))
#define DESKTOP_AGNOSTIC_CONFIG_SCHEMA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DESKTOP_AGNOSTIC_CONFIG_TYPE_SCHEMA, DesktopAgnosticConfigSchemaClass))
#define DESKTOP_AGNOSTIC_CONFIG_IS_SCHEMA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DESKTOP_AGNOSTIC_CONFIG_TYPE_SCHEMA))
#define DESKTOP_AGNOSTIC_CONFIG_IS_SCHEMA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DESKTOP_AGNOSTIC_CONFIG_TYPE_SCHEMA))
#define DESKTOP_AGNOSTIC_CONFIG_SCHEMA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DESKTOP_AGNOSTIC_CONFIG_TYPE_SCHEMA, DesktopAgnosticConfigSchemaClass))

typedef struct _DesktopAgnosticConfigSchemaPrivate DesktopAgnosticConfigSchemaPrivate;

/**
   * Configuration schema error types.
   */
typedef enum  {
      DESKTOP_AGNOSTIC_CONFIG_SCHEMA_ERROR_PARSE,
      DESKTOP_AGNOSTIC_CONFIG_SCHEMA_ERROR_INVALID_METADATA_OPTION,
      DESKTOP_AGNOSTIC_CONFIG_SCHEMA_ERROR_INVALID_METADATA_TYPE,
      DESKTOP_AGNOSTIC_CONFIG_SCHEMA_ERROR_INVALID_TYPE,
      DESKTOP_AGNOSTIC_CONFIG_SCHEMA_ERROR_INVALID_LIST_TYPE,
      DESKTOP_AGNOSTIC_CONFIG_SCHEMA_ERROR_TYPE_NAME_EXISTS,
      DESKTOP_AGNOSTIC_CONFIG_SCHEMA_ERROR_TYPE_GTYPE_EXISTS
} DesktopAgnosticConfigSchemaError;
#define DESKTOP_AGNOSTIC_CONFIG_SCHEMA_ERROR desktop_agnostic_config_schema_error_quark ()
/**
   * A representation of a configuration schema, comprised of one or more
   * configuration options.
   */
00063 struct _DesktopAgnosticConfigSchema {
      GObject parent_instance;
      DesktopAgnosticConfigSchemaPrivate * priv;
};

struct _DesktopAgnosticConfigSchemaClass {
      GObjectClass parent_class;
};


GQuark desktop_agnostic_config_schema_error_quark (void);
DesktopAgnosticConfigSchema* desktop_agnostic_config_schema_construct (GType object_type, DesktopAgnosticConfigBackend* backend, const char* filename, GError** error);
DesktopAgnosticConfigSchema* desktop_agnostic_config_schema_new (DesktopAgnosticConfigBackend* backend, const char* filename, GError** error);
GList* desktop_agnostic_config_schema_get_groups (DesktopAgnosticConfigSchema* self);
GList* desktop_agnostic_config_schema_get_keys (DesktopAgnosticConfigSchema* self, const char* group);
gboolean desktop_agnostic_config_schema_exists (DesktopAgnosticConfigSchema* self, const char* group, const char* key);
DesktopAgnosticConfigSchemaOption* desktop_agnostic_config_schema_get_option (DesktopAgnosticConfigSchema* self, const char* group, const char* key);
GValue* desktop_agnostic_config_schema_get_metadata_option (DesktopAgnosticConfigSchema* self, const char* name, GError** error);
void desktop_agnostic_config_schema_register_type (DesktopAgnosticConfigSchemaType* st, GError** error);
DesktopAgnosticConfigSchemaType* desktop_agnostic_config_schema_find_type (GType type);
DesktopAgnosticConfigSchemaType* desktop_agnostic_config_schema_find_type_by_name (const char* name);
const char* desktop_agnostic_config_schema_get_app_name (DesktopAgnosticConfigSchema* self);
GType desktop_agnostic_config_schema_get_type (void);


G_END_DECLS

#endif

Generated by  Doxygen 1.6.0   Back to index