debug-manager: removed size_request
[anjuta.git] / libanjuta / anjuta-preferences.h
blob256c130d624503b1177a506a0ac0d78fb3bf1534
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
2 /*
3 * preferences.h
4 * Copyright (C) 2000 - 2003 Naba Kumar <naba@gnome.org>
5 *
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
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 #ifndef _ANJUTA_PREFERENCES_H_
21 #define _ANJUTA_PREFERENCES_H_
23 #include <gtk/gtk.h>
24 #include <glib/gi18n.h>
25 #include <gdk/gdkkeysyms.h>
27 #include <libanjuta/anjuta-preferences-dialog.h>
28 #include <libanjuta/anjuta-plugin-manager.h>
30 G_BEGIN_DECLS
32 typedef enum
34 ANJUTA_PROPERTY_OBJECT_TYPE_TOGGLE,
35 ANJUTA_PROPERTY_OBJECT_TYPE_SPIN,
36 ANJUTA_PROPERTY_OBJECT_TYPE_ENTRY,
37 ANJUTA_PROPERTY_OBJECT_TYPE_COMBO,
38 ANJUTA_PROPERTY_OBJECT_TYPE_COLOR,
39 ANJUTA_PROPERTY_OBJECT_TYPE_FONT,
40 ANJUTA_PROPERTY_OBJECT_TYPE_FILE,
41 ANJUTA_PROPERTY_OBJECT_TYPE_FOLDER
42 } AnjutaPropertyObjectType;
44 typedef enum
46 ANJUTA_PROPERTY_DATA_TYPE_BOOL,
47 ANJUTA_PROPERTY_DATA_TYPE_INT,
48 ANJUTA_PROPERTY_DATA_TYPE_TEXT,
49 ANJUTA_PROPERTY_DATA_TYPE_COLOR,
50 ANJUTA_PROPERTY_DATA_TYPE_FONT
51 } AnjutaPropertyDataType;
53 typedef struct _AnjutaProperty AnjutaProperty;
55 /* Get functions. Add more get functions for AnjutaProperty, if required */
56 /* Gets the widget associated with the property */
57 GtkWidget* anjuta_property_get_widget (AnjutaProperty *prop);
59 #define ANJUTA_TYPE_PREFERENCES (anjuta_preferences_get_type ())
60 #define ANJUTA_PREFERENCES(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), ANJUTA_TYPE_PREFERENCES, AnjutaPreferences))
61 #define ANJUTA_PREFERENCES_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), ANJUTA_TYPE_PREFERENCES, AnjutaPreferencesClass))
62 #define ANJUTA_IS_PREFERENCES(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), ANJUTA_TYPE_PREFERENCES))
63 #define ANJUTA_IS_PREFERENCES_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), ANJUTA_TYPE_PREFERENCES))
65 typedef struct _AnjutaPreferences AnjutaPreferences;
66 typedef struct _AnjutaPreferencesClass AnjutaPreferencesClass;
67 typedef struct _AnjutaPreferencesPriv AnjutaPreferencesPriv;
69 struct _AnjutaPreferences
71 GObject parent;
73 /*< private >*/
74 AnjutaPreferencesPriv *priv;
77 struct _AnjutaPreferencesClass
79 GObjectClass parent;
82 typedef gboolean (*AnjutaPreferencesCallback) (AnjutaPreferences *pr,
83 const gchar *key,
84 gpointer data);
86 GType anjuta_preferences_get_type (void);
88 AnjutaPreferences *anjuta_preferences_new (AnjutaPluginManager *plugin_manager);
89 AnjutaPreferences *anjuta_preferences_default (void);
91 void anjuta_preferences_add_from_builder (AnjutaPreferences *pr,
92 GtkBuilder *builder,
93 GSettings *settings,
94 const gchar *glade_widget_name,
95 const gchar *stitle,
96 const gchar *icon_filename);
98 void anjuta_preferences_remove_page (AnjutaPreferences *pr,
99 const gchar *page_name);
102 * Registers all properties defined for widgets below the 'parent' widget
103 * in the given gtkbuilder UI tree
105 void anjuta_preferences_register_all_properties_from_builder_xml (AnjutaPreferences* pr,
106 GtkBuilder *builder,
107 GSettings *settings,
108 GtkWidget *parent);
109 gboolean
110 anjuta_preferences_register_property_from_string (AnjutaPreferences *pr,
111 GSettings *settings,
112 GtkWidget *object,
113 const gchar *property_desc);
115 gboolean
116 anjuta_preferences_register_property_raw (AnjutaPreferences *pr,
117 GSettings *settings,
118 GtkWidget *object,
119 const gchar *key,
120 const gchar *default_value,
121 guint flags,
122 AnjutaPropertyObjectType object_type,
123 AnjutaPropertyDataType data_type);
125 /* Dialog methods */
126 GtkWidget *anjuta_preferences_get_dialog (AnjutaPreferences *pr);
127 gboolean anjuta_preferences_is_dialog_created (AnjutaPreferences *pr);
129 G_END_DECLS
131 #endif