1 /* PSPPIRE - a graphical user interface for PSPP.
2 Copyright (C) 2012 Free Software Foundation
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.
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.
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/>. */
18 This is a an abstract base class, which implements GAction.
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
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.
29 #ifndef __PSPPIRE_DIALOG_ACTION_H__
30 #define __PSPPIRE_DIALOG_ACTION_H__
32 #include <glib-object.h>
35 #include "psppire-dict.h"
36 #include "psppire-dialog.h"
42 #define PSPPIRE_TYPE_DIALOG_ACTION (psppire_dialog_action_get_type ())
44 #define PSPPIRE_DIALOG_ACTION(obj) \
45 (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
46 PSPPIRE_TYPE_DIALOG_ACTION, PsppireDialogAction))
48 #define PSPPIRE_DIALOG_ACTION_CLASS(klass) \
49 (G_TYPE_CHECK_CLASS_CAST ((klass), \
50 PSPPIRE_TYPE_DIALOG_ACTION, \
51 PsppireDialogActionClass))
53 #define PSPPIRE_IS_DIALOG_ACTION(obj) \
54 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PSPPIRE_TYPE_DIALOG_ACTION))
56 #define PSPPIRE_IS_DIALOG_ACTION_CLASS(klass) \
57 (G_TYPE_CHECK_CLASS_TYPE ((klass), PSPPIRE_TYPE_DIALOG_ACTION))
60 #define PSPPIRE_DIALOG_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
61 PSPPIRE_TYPE_DIALOG_ACTION, \
62 PsppireDialogActionClass))
64 typedef struct _PsppireDialogAction PsppireDialogAction;
65 typedef struct _PsppireDialogActionClass PsppireDialogActionClass;
68 struct _PsppireDialogAction
73 GVariantType *parameter_type;
83 struct _PsppireDialogActionClass
85 GObjectClass parent_class;
86 void (*activate) (PsppireDialogAction *, GVariant *);
87 char * (*generate_syntax) (const PsppireDialogAction *);
90 GType psppire_dialog_action_get_type (void) ;
92 typedef void (*PsppireDialogActionRefresh) (PsppireDialogAction *) ;
94 void psppire_dialog_action_set_refresh (PsppireDialogAction *pda,
95 PsppireDialogActionRefresh refresh);
97 void psppire_dialog_action_set_valid_predicate (PsppireDialogAction *act,
98 ContentsAreValid dialog_state_valid);
100 typedef void (*activation) (PsppireDialogAction *);
102 void psppire_dialog_action_set_activation (gpointer class, activation a);
104 GHashTable *psppire_dialog_action_get_hash_table (PsppireDialogAction *act);
106 void psppire_dialog_action_activate_null (PsppireDialogAction *act);
111 #endif /* __PSPPIRE_DIALOG_ACTION_H__ */