2005-06-22 18:20:32 +00:00
|
|
|
/*
|
2005-10-13 14:08:18 +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
|
|
|
*
|
2008-09-05 17:20:50 -05: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
|
|
|
*
|
2008-09-05 17:20:50 -05: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
|
|
|
|
2007-04-12 10:31:28 -05:00
|
|
|
#ifndef MOO_PREFS_H
|
|
|
|
#define MOO_PREFS_H
|
2005-06-22 18:20:32 +00:00
|
|
|
|
|
|
|
#include <glib-object.h>
|
2005-10-13 14:08:18 +00:00
|
|
|
#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
|
|
|
|
|
2006-11-15 01:29:32 -06:00
|
|
|
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,
|
2006-11-15 01:29:32 -06:00
|
|
|
const char *file_state,
|
2005-09-13 15:31:08 +00:00
|
|
|
GError **error);
|
2006-11-15 01:29:32 -06:00
|
|
|
gboolean moo_prefs_save (const char *file_rc,
|
|
|
|
const char *file_state,
|
2005-09-13 15:31:08 +00:00
|
|
|
GError **error);
|
|
|
|
|
2011-01-04 03:10:10 -08:00
|
|
|
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,
|
2006-11-15 01:29:32 -06:00
|
|
|
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,
|
|
|
|
...);
|
2006-11-15 01:29:32 -06:00
|
|
|
|
2005-09-13 15:31:08 +00:00
|
|
|
char *moo_prefs_make_key (const char *first_comp,
|
2006-06-20 21:20:58 -05:00
|
|
|
...) 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
|
|
|
|
|
2007-04-12 10:31:28 -05:00
|
|
|
#endif /* MOO_PREFS_H */
|