fix .desktop file
[gconf-editor] / src / gconf-list-model.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_LIST_MODEL_H__
21 #define __GCONF_LIST_MODEL_H__
22
23 #include <gtk/gtk.h>
24 #include <gconf/gconf-client.h>
25
26 #define GCONF_TYPE_LIST_MODEL             (gconf_list_model_get_type ())
27 #define GCONF_LIST_MODEL(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCONF_TYPE_LIST_MODEL, GConfListModel))
28 #define GCONF_LIST_MODEL_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GCONF_TYPE_LIST_MODEL, GConfListModelClass))
29 #define GCONF_IS_LIST_MODEL(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCONF_TYPE_LIST_MODEL))
30 #define GCONF_IS_LIST_MODEL_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((obj), GCONF_TYPE_LIST_MODEL))
31 #define GCONF_LIST_MODEL_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GCONF_TYPE_LIST_MODEL, GConfListModelClass))
32
33 typedef struct _GConfListModel GConfListModel;
34 typedef struct _GConfListModelClass GConfListModelClass;
35
36 enum {
37         GCONF_LIST_MODEL_ICON_NAME_COLUMN,
38         GCONF_LIST_MODEL_KEY_NAME_COLUMN,
39         GCONF_LIST_MODEL_KEY_PATH_COLUMN,
40         GCONF_LIST_MODEL_VALUE_COLUMN,
41         GCONF_LIST_MODEL_NUM_COLUMNS
42 };
43
44 struct _GConfListModel {
45         GObject parent_instance;
46
47         gchar *root_path;
48         gint stamp;
49
50         GConfClient *client;
51         
52         GSList *values;
53         gint length;
54
55         guint notify_id;
56         GHashTable *key_hash;
57 };
58
59 struct _GConfListModelClass {
60         GObjectClass parent_class;
61 };
62
63 GType gconf_list_model_get_type (void);
64 GtkTreeModel *gconf_list_model_new (void);
65 void gconf_list_model_set_root_path (GConfListModel *model, const gchar *path);
66 void gconf_list_model_set_client (GConfListModel *model, GConfClient *client);
67
68 #endif /* __GCONF_LIST_MODEL_H__ */