medit/moo/mooutils/mooprefs.h

95 lines
4.0 KiB
C
Raw Normal View History

2005-06-22 18:20:32 +00:00
/*
* mooprefs.h
2005-06-22 18:20:32 +00:00
*
2010-12-21 20:15:45 -08:00
* Copyright (C) 2004-2010 by Yevgen Muntyan <emuntyan@users.sourceforge.net>
2005-06-22 18:20:32 +00:00
*
* This file is part of medit. medit 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.
2005-06-22 18:20:32 +00:00
*
* You should have received a copy of the GNU Lesser General Public
* License along with medit. If not, see <http://www.gnu.org/licenses/>.
2005-07-24 04:58:57 +00:00
*/
2005-06-22 18:20:32 +00:00
#ifndef MOO_PREFS_H
#define MOO_PREFS_H
2005-06-22 18:20:32 +00:00
#include <glib-object.h>
#include <mooutils/moomarkup.h>
2010-11-23 21:54:39 -08:00
#include <mooutils/mooutils-file.h>
2005-06-22 18:20:32 +00:00
G_BEGIN_DECLS
typedef enum {
MOO_PREFS_RC,
MOO_PREFS_STATE
2010-11-07 00:13:15 -07:00
} MooPrefsKind;
2005-06-22 18:20:32 +00:00
2007-10-26 04:46:20 -05:00
gboolean moo_prefs_load (char **sys_files,
const char *file_rc,
const char *file_state,
2005-09-13 15:31:08 +00:00
GError **error);
gboolean moo_prefs_save (const char *file_rc,
const char *file_state,
2005-09-13 15:31:08 +00:00
GError **error);
MooMarkupNode *moo_prefs_get_markup (MooPrefsKind prefs_kind);
2005-09-13 15:31:08 +00:00
void moo_prefs_new_key (const char *key,
GType value_type,
const GValue *default_value,
2010-11-07 00:13:15 -07:00
MooPrefsKind prefs_kind);
2005-09-13 15:31:08 +00:00
void moo_prefs_delete_key (const char *key);
GType moo_prefs_get_key_type (const char *key);
gboolean moo_prefs_key_registered(const char *key);
2010-11-07 00:13:15 -07:00
GSList *moo_prefs_list_keys (MooPrefsKind prefs_kind);
2007-07-13 03:43:10 -05:00
2005-09-13 15:31:08 +00:00
const GValue *moo_prefs_get (const char *key);
const GValue *moo_prefs_get_default (const char *key);
void moo_prefs_set (const char *key,
const GValue *value);
void moo_prefs_set_default (const char *key,
const GValue *value);
void moo_prefs_new_key_bool (const char *key,
gboolean default_val);
void moo_prefs_new_key_int (const char *key,
int default_val);
void moo_prefs_new_key_string(const char *key,
const char *default_val);
2006-11-19 12:35:32 -06:00
void moo_prefs_create_key (const char *key,
2010-11-07 00:13:15 -07:00
MooPrefsKind prefs_kind,
2006-11-19 12:35:32 -06:00
GType value_type,
...);
2005-09-13 15:31:08 +00:00
char *moo_prefs_make_key (const char *first_comp,
...) G_GNUC_NULL_TERMINATED;
2005-09-13 15:31:08 +00:00
char *moo_prefs_make_keyv (const char *first_comp,
va_list var_args);
const char *moo_prefs_get_string (const char *key);
const char *moo_prefs_get_filename (const char *key);
2010-11-23 21:54:39 -08:00
GFile *moo_prefs_get_file (const char *key);
2005-09-13 15:31:08 +00:00
gboolean moo_prefs_get_bool (const char *key);
int moo_prefs_get_int (const char *key);
void moo_prefs_set_string (const char *key,
const char *val);
void moo_prefs_set_filename (const char *key,
const char *val);
2010-11-23 21:54:39 -08:00
void moo_prefs_set_file (const char *key,
GFile *val);
2005-09-13 15:31:08 +00:00
void moo_prefs_set_int (const char *key,
int val);
void moo_prefs_set_bool (const char *key,
gboolean val);
2005-06-22 18:20:32 +00:00
G_END_DECLS
#endif /* MOO_PREFS_H */