fix .desktop file
[gconf-editor] / src / gconf-key-editor.h
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
2 /*
3  * Copyright (C) 2001, 2002 Anders Carlsson <andersca@gnu.org>
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License as
7  * published by the Free Software Foundation; either version 2 of the
8  * License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */
19
20 #ifndef __GCONF_KEY_EDITOR_H__
21 #define __GCONF_KEY_EDITOR_H__
22
23 #include <gtk/gtk.h>
24 #include <gconf/gconf.h>
25
26 #define GCONF_TYPE_KEY_EDITOR             (gconf_key_editor_get_type ())
27 #define GCONF_KEY_EDITOR(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCONF_TYPE_KEY_EDITOR, GConfKeyEditor))
28 #define GCONF_KEY_EDITOR_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GCONF_TYPE_KEY_EDITOR, GConfKeyEditorClass))
29 #define GCONF_IS_KEY_EDITOR(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCONF_TYPE_KEY_EDITOR))
30 #define GCONF_IS_KEY_EDITOR_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((obj), GCONF_TYPE_KEY_EDITOR))
31 #define GCONF_KEY_EDITOR_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GCONF_TYPE_KEY_EDITOR, GConfKeyEditorClass))
32
33 typedef enum {
34         GCONF_KEY_EDITOR_NEW_KEY,
35         GCONF_KEY_EDITOR_EDIT_KEY
36 } GConfKeyEditorAction;
37
38 typedef struct _GConfKeyEditor GConfKeyEditor;
39 typedef struct _GConfKeyEditorClass GConfKeyEditorClass;
40
41 struct _GConfKeyEditor {
42         GtkDialog parent_instance;
43         
44         int active_type;
45         GtkWidget *combobox;
46         GtkWidget *bool_box;
47         GtkWidget *bool_widget;
48         GtkWidget *int_box;     
49         GtkWidget *int_widget;
50         GtkWidget *string_box;
51         GtkWidget *string_widget;
52         GtkWidget *float_box;
53         GtkWidget *float_widget;
54
55         GtkWidget *non_writable_label;
56         
57         GtkWidget *path_label;
58         GtkWidget *path_box;
59         GtkWidget *name_entry;
60
61         /* List editing stuff */
62         GtkWidget *list_box;
63         GtkWidget *list_widget;
64         GtkListStore *list_model;
65         GtkWidget *list_type_menu;
66         GtkWidget *edit_button, *remove_button, *go_up_button, *go_down_button;
67
68 };
69
70 struct _GConfKeyEditorClass {
71         GtkDialogClass parent_class;
72 };
73
74 GType       gconf_key_editor_get_type (void);
75 GtkWidget  *gconf_key_editor_new      (GConfKeyEditorAction action);
76
77 void        gconf_key_editor_set_value (GConfKeyEditor *editor,
78                                         GConfValue     *value);
79 GConfValue *gconf_key_editor_get_value (GConfKeyEditor *editor);
80
81 void  gconf_key_editor_set_key_path      (GConfKeyEditor *editor,
82                                           const char     *path);
83 char *gconf_key_editor_get_full_key_path (GConfKeyEditor *editor);
84
85 void                 gconf_key_editor_set_key_name (GConfKeyEditor *editor,
86                                                     const char     *path);
87 G_CONST_RETURN char *gconf_key_editor_get_key_name (GConfKeyEditor *editor);
88
89 void gconf_key_editor_set_writable      (GConfKeyEditor *editor,
90                                          gboolean        writable);
91
92 #endif /* __GCONF_KEY_EDITOR_H__ */