1 /* gom-command.h
2  *
3  * Copyright (C) 2011 Christian Hergert <chris@dronelabs.com>
4  *
5  * This file is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This file 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  * Lesser 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, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef GOM_COMMAND_H
20 #define GOM_COMMAND_H
21 
22 #include <glib-object.h>
23 
24 #include "gom-cursor.h"
25 
26 G_BEGIN_DECLS
27 
28 #define GOM_TYPE_COMMAND            (gom_command_get_type())
29 #define GOM_COMMAND(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOM_TYPE_COMMAND, GomCommand))
30 #define GOM_COMMAND_CONST(obj)      (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOM_TYPE_COMMAND, GomCommand const))
31 #define GOM_COMMAND_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  GOM_TYPE_COMMAND, GomCommandClass))
32 #define GOM_IS_COMMAND(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOM_TYPE_COMMAND))
33 #define GOM_IS_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  GOM_TYPE_COMMAND))
34 #define GOM_COMMAND_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  GOM_TYPE_COMMAND, GomCommandClass))
35 
36 typedef struct _GomCommand        GomCommand;
37 typedef struct _GomCommandClass   GomCommandClass;
38 typedef struct _GomCommandPrivate GomCommandPrivate;
39 
40 struct _GomCommand
41 {
42    GObject parent;
43 
44    /*< private >*/
45    GomCommandPrivate *priv;
46 };
47 
48 struct _GomCommandClass
49 {
50    GObjectClass parent_class;
51 };
52 
53 gboolean     gom_command_execute          (GomCommand    *command,
54                                            GomCursor    **cursor,
55                                            GError       **error);
56 GType        gom_command_get_type         (void) G_GNUC_CONST;
57 void         gom_command_set_sql          (GomCommand    *command,
58                                            const gchar   *sql);
59 gint         gom_command_get_param_index  (GomCommand    *command,
60                                            const gchar   *param_name);
61 void         gom_command_reset            (GomCommand    *command);
62 void         gom_command_set_param        (GomCommand    *command,
63                                            guint          param,
64                                            const GValue  *value);
65 void         gom_command_set_param_double (GomCommand    *command,
66                                            guint          param,
67                                            gdouble        value);
68 void         gom_command_set_param_float  (GomCommand    *command,
69                                            guint          param,
70                                            gfloat         value);
71 void         gom_command_set_param_int    (GomCommand    *command,
72                                            guint          param,
73                                            gint           value);
74 void         gom_command_set_param_int64  (GomCommand    *command,
75                                            guint          param,
76                                            gint64         value);
77 void         gom_command_set_param_uint   (GomCommand    *command,
78                                            guint          param,
79                                            guint          value);
80 void         gom_command_set_param_uint64 (GomCommand    *command,
81                                            guint          param,
82                                            guint64        value);
83 void         gom_command_set_param_string (GomCommand    *command,
84                                            guint          param,
85                                            const gchar   *value);
86 
87 G_END_DECLS
88 
89 #endif /* GOM_COMMAND_H */
90