GnuCash 2.4.99
gnc-tree-model-selection.h
00001 /*
00002  * gnc-tree-model-selection.h -- GtkTreeModel which supports a
00003  *      selectable column.
00004  *
00005  * Copyright (C) 2003 Jan Arne Petersen
00006  * Author: Jan Arne Petersen <jpetersen@uni-bonn.de>
00007  *
00008  * This program is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU General Public License as
00010  * published by the Free Software Foundation; either version 2 of
00011  * the License, or (at your option) any later version.
00012  *
00013  * This program is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program; if not, contact:
00020  *
00021  * Free Software Foundation           Voice:  +1-617-542-5942
00022  * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652
00023  * Boston, MA  02110-1301,  USA       gnu@gnu.org
00024  */
00025 
00026 /*
00027  * This file creates a GtkTreeModel that extends an existing
00028  * GtkTreeModel by a single column.  This new column holds a single
00029  * boolean value per row.
00030  *
00031  * GtkTreeViews allow the creation of columns in any order, not just
00032  * the order they appear in the underlying model.  The most likely use
00033  * of this code will have the first view column mapped to this extra
00034  * boolean model column, and the column value diaplayed by a checkbox.
00035  */
00036 
00037 #ifndef __GNC_TREE_MODEL_SELECTION_H
00038 #define __GNC_TREE_MODEL_SELECTION_H
00039 
00040 #include <gtk/gtk.h>
00041 
00042 G_BEGIN_DECLS
00043 
00044 /* type macros */
00045 #define GNC_TYPE_TREE_MODEL_SELECTION            (gnc_tree_model_selection_get_type ())
00046 #define GNC_TREE_MODEL_SELECTION(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_TREE_MODEL_SELECTION, GncTreeModelSelection))
00047 #define GNC_TREE_MODEL_SELECTION_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_TREE_MODEL_SELECTION, GncTreeModelSelectionClass))
00048 #define GNC_IS_TREE_MODEL_SELECTION(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_TREE_MODEL_SELECTION))
00049 #define GNC_IS_TREE_MODEL_SELECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_TREE_MODEL_SELECTION))
00050 #define GNC_TREE_MODEL_SELECTION_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_TREE_MODEL_SELECTION, GncTreeModelSelectionClass))
00051 
00052 /* typedefs & structures */
00053 typedef struct
00054 {
00055     GObject gobject;
00056     int stamp;
00057 } GncTreeModelSelection;
00058 
00059 typedef struct
00060 {
00061     GObjectClass gobject;
00062 } GncTreeModelSelectionClass;
00063 
00064 /* function prototypes */
00065 GType              gnc_tree_model_selection_get_type                   (void);
00066 
00067 GtkTreeModel      *gnc_tree_model_selection_new                        (GtkTreeModel *child_model);
00068 
00069 void               gnc_tree_model_selection_convert_child_iter_to_iter (GncTreeModelSelection *model,
00070         GtkTreeIter *selection_iter,
00071         GtkTreeIter *child_iter);
00072 void               gnc_tree_model_selection_convert_iter_to_child_iter (GncTreeModelSelection *model,
00073         GtkTreeIter *child_iter,
00074         GtkTreeIter *selection_iter);
00075 
00076 void               gnc_tree_model_selection_set_selected               (GncTreeModelSelection *model,
00077         GtkTreeIter *iter,
00078         gboolean selected);
00079 
00080 G_END_DECLS
00081 
00082 #endif /* __GNC_TREE_MODEL_SELECTION_H */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines