grim/guifications3

moved guifications-gtk to cmake
cmake
2010-12-13, Gary Kramlich
36e02fafe588
moved guifications-gtk to cmake
/*
* Guifications - The end-all, be-all notification framework
* Copyright (C) 2003-2009 Gary Kramlich <grim@reaperworld.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef GF_PREFERENCE_H
#define GF_PREFERENCE_H
#define GF_TYPE_PREFERENCE (gf_preference_get_g_type())
typedef struct _GfPreference GfPreference;
#include <gflib/gf_enum.h>
/**
* GfPreferenceType:
* @GF_PREFERENCE_TYPE_UNKNOWN: The preference has an unknown type.
* @GF_PREFERENCE_TYPE_SECTION: The prefernce is a section.
* @GF_PREFERENCE_TYPE_STRING: The preference is a string.
* @GF_PREFERENCE_TYPE_INT: The preference is an integer.
* @GF_PREFERENCE_TYPE_BOOL: The preference is a boolean.
* @GF_PREFERENCE_TYPES: The number of preferences.
*
* The different types that a #GfPreference can be.
*/
typedef enum {
GF_PREFERENCE_TYPE_UNKNOWN = -1, /*< skip >*/
GF_PREFERENCE_TYPE_SECTION = 0, /*< nick=Section >*/
GF_PREFERENCE_TYPE_STRING, /*< nick=String >*/
GF_PREFERENCE_TYPE_INT, /*< nick=Integer >*/
GF_PREFERENCE_TYPE_BOOL, /*< nick=Boolean >*/
GF_PREFERENCE_TYPES /*< skip >*/
} GfPreferenceType;
/**
* GfPreference:
* @name: The name.
* @path: The path.
* @type: The #GfPreferenceType.
* @value: The value.
*
* A boxed representation of a preference.
*/
struct _GfPreference {
gchar *name;
gchar *path;
GfPreferenceType type;
GValue *value;
};
G_BEGIN_DECLS
GType gf_preference_get_g_type(void);
GfPreference *gf_preference_copy(const GfPreference *pref);
void gf_preference_free(GfPreference *pref);
void gf_preference_freev(GfPreference **prefs);
GfPreference *gf_preference_new(const gchar *name, const gchar *path, GfPreferenceType type, const GValue *value);
gchar *gf_preference_get_full_name(const GfPreference *pref);
void gf_preference_set_name(GfPreference *pref, const gchar *name);
const gchar *gf_preference_get_name(const GfPreference *pref);
void gf_preference_set_path(GfPreference *pref, const gchar *path);
const gchar *gf_preference_get_path(const GfPreference *pref);
void gf_preference_set_type(GfPreference *pref, GfPreferenceType type);
GfPreferenceType gf_preference_get_type(const GfPreference *pref);
void gf_preference_set_string(GfPreference *pref, const gchar *value);
const gchar *gf_preference_get_string(const GfPreference *pref);
void gf_preference_set_int(GfPreference *pref, gint value);
gint gf_preference_get_int(const GfPreference *pref);
void gf_preference_set_bool(GfPreference *pref, gboolean value);
gboolean gf_preference_get_bool(const GfPreference *pref);
#define gf_preference_type_from_string(str) \
gf_enum_from_string(GF_TYPE_PREFERENCE_TYPE, (str))
#define gf_preference_type_to_string(type, i18n) \
gf_enum_to_string(GF_TYPE_PREFERENCE_TYPE, (type), (i18n))
G_END_DECLS
#endif /* GF_PREFERENCE_H */