b169b52b64168526fb432223d67feb587851d624
[pspp-builds.git] / src / ui / gui / psppire-var-select.h
1 /*
2     PSPPIRE --- A Graphical User Interface for PSPP
3     Copyright (C) 2007  Free Software Foundation
4
5     This program is free software; you can redistribute it and/or modify
6     it under the terms of the GNU General Public License as published by
7     the Free Software Foundation; either version 2 of the License, or
8     (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
13     GNU 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., 51 Franklin Street, Fifth Floor, Boston, MA
18     02110-1301, USA. */
19
20
21 #ifndef __PSPPIRE_VAR_SELECT_H__
22 #define __PSPPIRE_VAR_SELECT_H__
23
24
25 #include <glib-object.h>
26 #include <glib.h>
27
28 #include <gtk/gtk.h>
29 #include "psppire-dict.h"
30
31 G_BEGIN_DECLS
32
33
34 /* --- type macros --- */
35 #define G_TYPE_PSPPIRE_VAR_SELECT              (psppire_var_select_get_type ())
36 #define PSPPIRE_VAR_SELECT(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), G_TYPE_PSPPIRE_VAR_SELECT, PsppireVarSelect))
37 #define PSPPIRE_VAR_SELECT_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), G_TYPE_PSPPIRE_VAR_SELECT, PsppireVarSelectClass))
38 #define G_IS_PSPPIRE_VAR_SELECT(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), G_TYPE_PSPPIRE_VAR_SELECT))
39 #define G_IS_PSPPIRE_VAR_SELECT_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), G_TYPE_PSPPIRE_VAR_SELECT))
40 #define PSPPIRE_VAR_SELECT_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), G_TYPE_PSPPIRE_VAR_SELECT, PsppireVarSelectClass))
41
42
43
44 /* --- typedefs & structures --- */
45 typedef struct _PsppireVarSelect           PsppireVarSelect;
46 typedef struct _PsppireVarSelectClass PsppireVarSelectClass;
47
48 struct _PsppireVarSelect
49 {
50   GObject             parent;
51   const PsppireDict   *dict;
52
53
54   /* <private> */
55   GtkSelectionMode    mode;
56   GtkWidget           *source;
57   GtkWidget           *dest;
58   GList               *list;
59 };
60
61 struct _PsppireVarSelectClass
62 {
63   GObjectClass parent_class;
64 };
65
66
67 /* -- PsppireVarSelect --- */
68 GType          psppire_var_select_get_type (void);
69
70
71 PsppireVarSelect* psppire_var_select_new    (GtkWidget *,
72                                              GtkWidget *,
73                                              const PsppireDict *);
74
75 /* Remove all variables from the selection */
76 void         psppire_var_select_deselect_all  (PsppireVarSelect *);
77
78 /* Return a list of all the currently selected variables */
79 const GList *psppire_var_select_get_variables (PsppireVarSelect *);
80
81 /* Append VAR to the list of selected variables */
82 void         psppire_var_select_set_variable  (PsppireVarSelect *,
83                                                struct variable *var);
84
85 G_END_DECLS
86
87 #endif /* __PSPPIRE_VAR_SELECT_H__ */