initial commit
[gconf-editor] / src / gconf-editor-window.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_EDITOR_WINDOW_H__
21 #define __GCONF_EDITOR_WINDOW_H__
22
23 #include <gtk/gtk.h>
24 #include <gconf/gconf-client.h>
25
26 #define GCONF_TYPE_EDITOR_WINDOW                  (gconf_editor_window_get_type ())
27 #define GCONF_EDITOR_WINDOW(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCONF_TYPE_EDITOR_WINDOW, GConfEditorWindow))
28 #define GCONF_EDITOR_WINDOW_CLASS(klass)          (G_TYPE_CHECK_CLASS_CAST ((klass), GCONF_TYPE_EDITOR_WINDOW, GConfEditorWindowClass))
29 #define GCONF_IS_EDITOR_WINDOW(obj)       (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCONF_TYPE_EDITOR_WINDOW))
30 #define GCONF_IS_EDITOR_WINDOW_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((obj), GCONF_TYPE_EDITOR_WINDOW))
31 #define GCONF_EDITOR_WINDOW_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GCONF_TYPE_EDITOR_WINDOW, GConfEditorWindowClass))
32
33 #define RECENT_LIST_MAX_SIZE 20
34
35 enum {
36         GCONF_EDITOR_WINDOW_TYPE_NORMAL,
37         GCONF_EDITOR_WINDOW_TYPE_DEFAULTS,
38         GCONF_EDITOR_WINDOW_TYPE_MANDATORY
39 };
40
41 enum {
42         GCONF_EDITOR_WINDOW_OUTPUT_WINDOW_NONE,
43         GCONF_EDITOR_WINDOW_OUTPUT_WINDOW_SEARCH,
44         GCONF_EDITOR_WINDOW_OUTPUT_WINDOW_RECENTS
45 };
46
47
48 typedef struct _GConfEditorWindow GConfEditorWindow;
49 typedef struct _GConfEditorWindowClass GConfEditorWindowClass;
50
51 struct _GConfEditorWindow {
52         GtkWindow parent_instance;
53
54         int type;
55         GConfClient *client;
56
57         GtkWidget *tree_view;
58         GtkTreeModel *tree_model;
59         GtkTreeModel *sorted_tree_model;
60         
61         GtkWidget *list_view;
62         GtkTreeModel *list_model;
63         GtkTreeModel *sorted_list_model;
64         
65         GtkWidget *output_window;
66         int output_window_type;
67
68         GtkWidget *statusbar;
69
70         GtkUIManager *ui_manager;
71         GtkWidget *popup_menu;
72         GtkTreeViewColumn *value_column;
73
74         GtkWidget *non_writable_label;
75         GtkWidget *key_name_label;
76         GtkWidget *short_desc_label;
77         GtkTextBuffer *long_desc_buffer;
78         GtkWidget *owner_label;
79         GtkWidget *no_schema_label;
80
81         guint tearoffs_notify_id;
82         guint icons_notify_id;
83 };
84
85 struct _GConfEditorWindowClass {
86         GtkWindowClass parent_class;
87 };
88
89 GType gconf_editor_window_get_type (void);
90 GtkWidget *gconf_editor_window_new (void);
91
92 void gconf_editor_window_go_to (GConfEditorWindow *window,
93                                 const char        *location);
94 void gconf_editor_window_expand_first (GConfEditorWindow *window);
95
96 void gconf_editor_window_popup_error_dialog (GtkWindow   *parent,
97                                              const gchar *message,
98                                              GError      *error);
99
100
101 #endif /* __GCONF_EDITOR_WINDOW_H__ */
102