1 /*
2  * Copyright (C) 2009 - 2011 Vivien Malerba <malerba@gnome-db.org>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17  * Boston, MA  02110-1301, USA.
18  */
19 
20 #ifndef __GDA_TREE_MGR_SELECT_H__
21 #define __GDA_TREE_MGR_SELECT_H__
22 
23 #include <libgda/gda-connection.h>
24 #include "gda-tree-manager.h"
25 
26 G_BEGIN_DECLS
27 
28 #define GDA_TYPE_TREE_MGR_SELECT            (gda_tree_mgr_select_get_type())
29 #define GDA_TREE_MGR_SELECT(obj)            (G_TYPE_CHECK_INSTANCE_CAST (obj, GDA_TYPE_TREE_MGR_SELECT, GdaTreeMgrSelect))
30 #define GDA_TREE_MGR_SELECT_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST (klass, GDA_TYPE_TREE_MGR_SELECT, GdaTreeMgrSelectClass))
31 #define GDA_IS_TREE_MGR_SELECT(obj)         (G_TYPE_CHECK_INSTANCE_TYPE(obj, GDA_TYPE_TREE_MGR_SELECT))
32 #define GDA_IS_TREE_MGR_SELECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GDA_TYPE_TREE_MGR_SELECT))
33 #define GDA_TREE_MGR_SELECT_GET_CLASS(o)    (G_TYPE_INSTANCE_GET_CLASS ((o), GDA_TYPE_TREE_MGR_SELECT, GdaTreeMgrSelectClass))
34 
35 typedef struct _GdaTreeMgrSelect GdaTreeMgrSelect;
36 typedef struct _GdaTreeMgrSelectPriv GdaTreeMgrSelectPriv;
37 typedef struct _GdaTreeMgrSelectClass GdaTreeMgrSelectClass;
38 
39 struct _GdaTreeMgrSelect {
40 	GdaTreeManager        object;
41 	GdaTreeMgrSelectPriv *priv;
42 };
43 
44 struct _GdaTreeMgrSelectClass {
45 	GdaTreeManagerClass   object_class;
46 };
47 
48 /**
49  * SECTION:gda-tree-mgr-select
50  * @short_description: A tree manager which creates a node for each row resulting from the execution of a SELECT statement
51  * @title: GdaTreeMgrSelect
52  * @stability: Stable
53  * @see_also:
54  *
55  * The #GdaTreeMgrSelect is a #GdaTreeManager object which executes a SELECT statement and
56  * creates a node for each row in the result.
57  *
58  * The #GdaConnection and SELECT #GdaStatement to be used need to be specified when the object is created.
59  * If the SELECT statement to be used needs some parameters, then it is possible to give values to some of them
60  * when constructing the object, but not necessary.
61  *
62  * If the SELECT statement needs some parameters which have not been provided during the construction, then
63  * these parameters will be fetched from the #GdaTreeNode below which the nodes will be placed (using
64  * gda_tree_node_fetch_attribute()).
65  *
66  * For each node created, an attribute is set for each column in the SELECT statement: the attribute name is
67  * the column name and the attribute value is the value if that column.
68  */
69 
70 GType              gda_tree_mgr_select_get_type                 (void) G_GNUC_CONST;
71 GdaTreeManager*    gda_tree_mgr_select_new                      (GdaConnection *cnc, GdaStatement *stmt, GdaSet *params);
72 
73 G_END_DECLS
74 
75 #endif
76