1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 /* e-tree-model-generator.h - Model wrapper that permutes underlying rows.
5 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of version 2 of the GNU Lesser General Public
9 * License as published by the Free Software Foundation.
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 Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser 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 * Authors: Hans Petter Jansson <hpj@novell.com>
23 #if !defined (__LIBEDATASERVERUI_H_INSIDE__) && !defined (LIBEDATASERVERUI_COMPILATION)
24 #error "Only <libedataserverui/libedataserverui.h> should be included directly."
27 #ifndef E_TREE_MODEL_GENERATOR_H
28 #define E_TREE_MODEL_GENERATOR_H
32 /* Standard GObject macros */
33 #define E_TYPE_TREE_MODEL_GENERATOR \
34 (e_tree_model_generator_get_type ())
35 #define E_TREE_MODEL_GENERATOR(obj) \
36 (G_TYPE_CHECK_INSTANCE_CAST \
37 ((obj), E_TYPE_TREE_MODEL_GENERATOR, ETreeModelGenerator))
38 #define E_TREE_MODEL_GENERATOR_CLASS(cls) \
39 (G_TYPE_CHECK_CLASS_CAST \
40 ((cls), E_TYPE_TREE_MODEL_GENERATOR, ETreeModelGeneratorClass))
41 #define E_IS_TREE_MODEL_GENERATOR(obj) \
42 (G_TYPE_CHECK_INSTANCE_TYPE \
43 ((obj), E_TYPE_TREE_MODEL_GENERATOR))
44 #define E_IS_TREE_MODEL_GENERATOR_CLASS(cls) \
45 (G_TYPE_CHECK_CLASS_TYPE \
46 ((cls), E_TYPE_TREE_MODEL_GENERATOR))
47 #define E_TREE_MODEL_GENERATOR_GET_CLASS(obj) \
48 (G_TYPE_INSTANCE_GET_CLASS \
49 ((obj), E_TYPE_TREE_MODEL_GENERATOR, ETreeModelGeneratorClass))
53 typedef gint (*ETreeModelGeneratorGenerateFunc) (GtkTreeModel *model, GtkTreeIter *child_iter,
55 typedef void (*ETreeModelGeneratorModifyFunc) (GtkTreeModel *model, GtkTreeIter *child_iter,
56 gint permutation_n, gint column, GValue *value,
59 typedef struct _ETreeModelGenerator ETreeModelGenerator;
60 typedef struct _ETreeModelGeneratorClass ETreeModelGeneratorClass;
61 typedef struct _ETreeModelGeneratorPrivate ETreeModelGeneratorPrivate;
63 struct _ETreeModelGenerator {
65 ETreeModelGeneratorPrivate *priv;
68 struct _ETreeModelGeneratorClass {
69 GObjectClass parent_class;
72 GType e_tree_model_generator_get_type (void);
74 e_tree_model_generator_new (GtkTreeModel *child_model);
75 GtkTreeModel * e_tree_model_generator_get_model (ETreeModelGenerator *tree_model_generator);
76 void e_tree_model_generator_set_generate_func
77 (ETreeModelGenerator *tree_model_generator,
78 ETreeModelGeneratorGenerateFunc func,
80 GDestroyNotify destroy);
81 void e_tree_model_generator_set_modify_func
82 (ETreeModelGenerator *tree_model_generator,
83 ETreeModelGeneratorModifyFunc func,
85 GDestroyNotify destroy);
86 GtkTreePath * e_tree_model_generator_convert_child_path_to_path
87 (ETreeModelGenerator *tree_model_generator,
88 GtkTreePath *child_path);
89 void e_tree_model_generator_convert_child_iter_to_iter
90 (ETreeModelGenerator *tree_model_generator,
91 GtkTreeIter *generator_iter,
92 GtkTreeIter *child_iter);
93 GtkTreePath * e_tree_model_generator_convert_path_to_child_path
94 (ETreeModelGenerator *tree_model_generator,
95 GtkTreePath *generator_path);
96 void e_tree_model_generator_convert_iter_to_child_iter
97 (ETreeModelGenerator *tree_model_generator,
98 GtkTreeIter *child_iter,
100 GtkTreeIter *generator_iter);
104 #endif /* E_TREE_MODEL_GENERATOR_H */