Rename psppire_dialog_action_get_pointer -> psppire_dialog_action_get_hash_table
[pspp] / src / ui / gui / psppire-dialog-action.h
1 /* PSPPIRE - a graphical user interface for PSPP.
2    Copyright (C) 2012  Free Software Foundation
3
4    This program is free software: you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation, either version 3 of the License, or
7    (at your option) any later version.
8
9    This program 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
12    GNU General Public License for more details.
13
14    You should have received a copy of the GNU General Public License
15    along with this program.  If not, see <http://www.gnu.org/licenses/>. */
16
17 /* 
18    This is a an abstract base class, deriving from GtkAction.
19    It's purpose is to abstract the way in which dialog boxes behave.
20    That is, this action will fire whenever a dialog box is to be 
21    popped up.
22    
23    Additionally, most dialog boxes generate syntax to 
24    be run by the pspp back-end.  This provides an abstraction
25    to do that.  The programmer needs only to provide the function
26    to generate the syntax.  This base class looks after the rest.
27 */
28
29 #ifndef __PSPPIRE_DIALOG_ACTION_H__
30 #define __PSPPIRE_DIALOG_ACTION_H__
31
32 #include <glib-object.h>
33 #include <glib.h>
34
35 #include "psppire-dict.h"
36 #include "psppire-dialog.h"
37 #include <gtk/gtk.h>
38
39 G_BEGIN_DECLS
40
41
42 #define PSPPIRE_TYPE_DIALOG_ACTION (psppire_dialog_action_get_type ())
43
44 #define PSPPIRE_DIALOG_ACTION(obj)      \
45                      (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
46                                                   PSPPIRE_TYPE_DIALOG_ACTION, PsppireDialogAction))
47
48 #define PSPPIRE_DIALOG_ACTION_CLASS(klass) \
49                      (G_TYPE_CHECK_CLASS_CAST ((klass), \
50                                  PSPPIRE_TYPE_DIALOG_ACTION, \
51                                  PsppireDialogActionClass))
52
53 #define PSPPIRE_IS_DIALOG_ACTION(obj) \
54                      (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PSPPIRE_TYPE_DIALOG_ACTION))
55
56 #define PSPPIRE_IS_DIALOG_ACTION_CLASS(klass) \
57                      (G_TYPE_CHECK_CLASS_TYPE ((klass), PSPPIRE_TYPE_DIALOG_ACTION))
58
59
60 #define PSPPIRE_DIALOG_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
61                                    PSPPIRE_TYPE_DIALOG_ACTION, \
62                                    PsppireDialogActionClass))
63
64 typedef struct _PsppireDialogAction       PsppireDialogAction;
65 typedef struct _PsppireDialogActionClass  PsppireDialogActionClass;
66
67
68 struct _PsppireDialogAction
69 {
70   GtkAction parent;
71
72   /*< private >*/
73   GtkUIManager *uim;
74
75   GtkWidget *source;
76   GtkWidget *dialog;
77
78   GtkWidget *toplevel;
79   PsppireDict *dict;
80 };
81
82 struct _PsppireDialogActionClass
83 {
84   GtkActionClass parent_class;
85   void   (*activate) (PsppireDialogAction *);
86   char * (*generate_syntax) (PsppireDialogAction *);
87 };
88
89 GType psppire_dialog_action_get_type (void) ;
90
91 typedef void (*PsppireDialogActionRefresh) (PsppireDialogAction *) ;
92
93 void psppire_dialog_action_set_refresh (PsppireDialogAction *pda, 
94                                         PsppireDialogActionRefresh refresh);
95
96 void psppire_dialog_action_set_valid_predicate (PsppireDialogAction *act, 
97                                                 ContentsAreValid dialog_state_valid);
98
99 typedef void (*activation) (GtkAction *);
100
101 void psppire_dialog_action_set_activation (gpointer class, activation a);
102
103 GHashTable *psppire_dialog_action_get_hash_table (PsppireDialogAction *act);
104
105
106
107 G_END_DECLS
108
109 #endif /* __PSPPIRE_DIALOG_ACTION_H__ */