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, 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
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
82 struct _PsppireDialogActionClass
84 GtkActionClass parent_class;
85 void (*activate) (PsppireDialogAction *);
86 char * (*generate_syntax) (PsppireDialogAction *);
89 GType psppire_dialog_action_get_type (void) ;
91 typedef void (*PsppireDialogActionRefresh) (PsppireDialogAction *) ;
93 void psppire_dialog_action_set_refresh (PsppireDialogAction *pda,
94 PsppireDialogActionRefresh refresh);
96 void psppire_dialog_action_set_valid_predicate (PsppireDialogAction *act,
97 ContentsAreValid dialog_state_valid);
101 #endif /* __PSPPIRE_DIALOG_ACTION_H__ */