Update French translation
[geany-mirror.git] / src / stash.h
blob24fc65f0ecce09a6c16ae66825af53ee4f3ced5d
1 /*
2 * stash.h - this file is part of Geany, a fast and lightweight IDE
4 * Copyright 2008 The Geany contributors
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #ifndef GEANY_STASH_H
22 #define GEANY_STASH_H 1
24 #include "gtkcompat.h"
26 G_BEGIN_DECLS
28 /** Opaque type for a group of settings. */
29 typedef struct StashGroup StashGroup;
31 /** Can be @c GtkWidget* or @c gchar* depending on whether the @a owner argument is used for
32 * stash_group_display() and stash_group_update(). */
33 typedef gconstpointer StashWidgetID;
35 GType stash_group_get_type(void);
37 StashGroup *stash_group_new(const gchar *name);
39 void stash_group_add_boolean(StashGroup *group, gboolean *setting,
40 const gchar *key_name, gboolean default_value);
42 void stash_group_add_integer(StashGroup *group, gint *setting,
43 const gchar *key_name, gint default_value);
45 void stash_group_add_string(StashGroup *group, gchar **setting,
46 const gchar *key_name, const gchar *default_value);
48 void stash_group_add_string_vector(StashGroup *group, gchar ***setting,
49 const gchar *key_name, const gchar **default_value);
51 void stash_group_load_from_key_file(StashGroup *group, GKeyFile *keyfile);
53 void stash_group_save_to_key_file(StashGroup *group, GKeyFile *keyfile);
55 void stash_group_free(StashGroup *group);
57 gboolean stash_group_load_from_file(StashGroup *group, const gchar *filename);
59 gint stash_group_save_to_file(StashGroup *group, const gchar *filename,
60 GKeyFileFlags flags);
62 /* *** GTK-related functions *** */
64 void stash_group_add_toggle_button(StashGroup *group, gboolean *setting,
65 const gchar *key_name, gboolean default_value, StashWidgetID widget_id);
67 void stash_group_add_radio_buttons(StashGroup *group, gint *setting,
68 const gchar *key_name, gint default_value,
69 StashWidgetID widget_id, gint enum_id, ...) G_GNUC_NULL_TERMINATED;
71 void stash_group_add_spin_button_integer(StashGroup *group, gint *setting,
72 const gchar *key_name, gint default_value, StashWidgetID widget_id);
74 void stash_group_add_combo_box(StashGroup *group, gint *setting,
75 const gchar *key_name, gint default_value, StashWidgetID widget_id);
77 void stash_group_add_combo_box_entry(StashGroup *group, gchar **setting,
78 const gchar *key_name, const gchar *default_value, StashWidgetID widget_id);
80 void stash_group_add_entry(StashGroup *group, gchar **setting,
81 const gchar *key_name, const gchar *default_value, StashWidgetID widget_id);
83 void stash_group_add_widget_property(StashGroup *group, gpointer setting,
84 const gchar *key_name, gpointer default_value, StashWidgetID widget_id,
85 const gchar *property_name, GType type);
87 void stash_group_display(StashGroup *group, GtkWidget *owner);
89 void stash_group_update(StashGroup *group, GtkWidget *owner);
91 void stash_group_free_settings(StashGroup *group);
94 #ifdef GEANY_PRIVATE
96 void stash_group_set_various(StashGroup *group, gboolean various,
97 const gchar *prefix);
99 void stash_group_set_use_defaults(StashGroup *group, gboolean use_defaults);
101 /* *** GTK-related functions *** */
103 void stash_tree_setup(GPtrArray *group_array, GtkTreeView *tree);
105 void stash_tree_display(GtkTreeView *tree);
107 void stash_tree_update(GtkTreeView *tree);
109 #endif /* GEANY_PRIVATE */
111 G_END_DECLS
113 #endif /* GEANY_STASH_H */