treewide: Replace <name>_cnt by n_<name>s and <name>_cap by allocated_<name>.
[pspp] / src / ui / gui / psppire-dialog.h
1 /* PSPPIRE - a graphical user interface for PSPP.
2    Copyright (C) 2007, 2010, 2011, 2012, 2015  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 #ifndef __PSPPIRE_DIALOG_H__
18 #define __PSPPIRE_DIALOG_H__
19
20 #include <glib.h>
21 #include <glib-object.h>
22 #include <gtk/gtk.h>
23 #include "psppire-window-base.h"
24
25
26 #define PSPPIRE_RESPONSE_PASTE 1
27 #define PSPPIRE_RESPONSE_GOTO 2
28 #define PSPPIRE_RESPONSE_CONTINUE 3
29
30 G_BEGIN_DECLS
31
32 #define PSPPIRE_TYPE_DIALOG            (psppire_dialog_get_type ())
33 #define PSPPIRE_DIALOG(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), PSPPIRE_TYPE_DIALOG, PsppireDialog))
34 #define PSPPIRE_DIALOG_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), PSPPIRE_TYPE_DIALOG, PsppireDialogClass))
35 #define PSPPIRE_IS_DIALOG(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PSPPIRE_TYPE_DIALOG))
36 #define PSPPIRE_IS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PSPPIRE_TYPE_DIALOG))
37
38
39 typedef struct _PsppireDialog       PsppireDialog;
40 typedef struct _PsppireDialogClass  PsppireDialogClass;
41
42 typedef gboolean (*ContentsAreValid) (gpointer);
43
44 struct _PsppireDialog
45 {
46   PsppireWindowBase window;
47
48   /* Private */
49   GMainLoop *loop;
50   gint response;
51
52   ContentsAreValid contents_are_valid;
53   gpointer validity_data;
54   ContentsAreValid contents_are_acceptable;
55   gpointer acceptable_data;
56   gboolean slidable;
57   gchar *help_page;
58
59 };
60
61 struct _PsppireDialogClass
62 {
63   PsppireWindowBaseClass parent_class;
64 };
65
66
67 GType          psppire_dialog_get_type        (void);
68 GtkWidget*     psppire_dialog_new             (void);
69 void           psppire_dialog_reload          (PsppireDialog *);
70 void           psppire_dialog_help            (PsppireDialog *);
71 void           psppire_dialog_close           (PsppireDialog *);
72 gint           psppire_dialog_run             (PsppireDialog *);
73 void           psppire_dialog_set_valid_predicate (PsppireDialog *,
74                                                    ContentsAreValid,
75                                                    gpointer);
76 void           psppire_dialog_set_accept_predicate (PsppireDialog *,
77                                                     ContentsAreValid,
78                                                     gpointer);
79 gboolean       psppire_dialog_is_acceptable (const PsppireDialog *);
80 void           psppire_dialog_notify_change (PsppireDialog *);
81
82 G_END_DECLS
83
84 #endif /* __PSPPIRE_DIALOG_H__ */