Merge commit 'origin/stable'
[pspp-builds.git] / src / ui / gui / psppire-dialog.h
1 /* PSPPIRE - a graphical user interface for PSPP.
2    Copyright (C) 2007  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 #ifndef __PSPPIRE_DIALOG_H__
19 #define __PSPPIRE_DIALOG_H__
20
21
22 #include <glib.h>
23 #include <glib-object.h>
24 #include <gtk/gtkwindow.h>
25
26
27 #define PSPPIRE_RESPONSE_PASTE 1
28 #define PSPPIRE_RESPONSE_GOTO 2
29 #define PSPPIRE_RESPONSE_CONTINUE 3
30
31 G_BEGIN_DECLS
32
33 #define PSPPIRE_DIALOG_TYPE            (psppire_dialog_get_type ())
34 #define PSPPIRE_DIALOG(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), PSPPIRE_DIALOG_TYPE, PsppireDialog))
35 #define PSPPIRE_DIALOG_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), PSPPIRE_DIALOG_TYPE, PsppireDialogClass))
36 #define PSPPIRE_IS_DIALOG(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PSPPIRE_DIALOG_TYPE))
37 #define PSPPIRE_IS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PSPPIRE_DIALOG_TYPE))
38
39
40 typedef struct _PsppireDialog       PsppireDialog;
41 typedef struct _PsppireDialogClass  PsppireDialogClass;
42
43 typedef gboolean (*ContentsAreValid) (gpointer);
44
45 typedef enum
46   {
47     PSPPIRE_HORIZONTAL,
48     PSPPIRE_VERTICAL,
49     PSPPIRE_TABULAR
50   } PsppireOrientation;
51
52
53
54 struct _PsppireDialog
55 {
56   GtkWindow window;
57   GtkWidget *box;
58
59   /* Private */
60   GMainLoop *loop;
61   gint response;
62
63   ContentsAreValid contents_are_valid;
64   gpointer validity_data;
65   gboolean slidable;
66   PsppireOrientation orientation;
67 };
68
69 struct _PsppireDialogClass
70 {
71   GtkWindowClass parent_class;
72 };
73
74
75 GType          psppire_dialog_get_type        (void);
76 GtkWidget*     psppire_dialog_new             (void);
77 void           psppire_dialog_reload          (PsppireDialog *);
78 void           psppire_dialog_close           (PsppireDialog *);
79 gint           psppire_dialog_run             (PsppireDialog *);
80 void           psppire_dialog_set_valid_predicate (PsppireDialog *,
81                                                    ContentsAreValid,
82                                                    gpointer );
83 void           psppire_dialog_notify_change (PsppireDialog *);
84
85
86
87 GType psppire_orientation_get_type (void);
88
89
90 #define PSPPIRE_TYPE_ORIENTATION (psppire_orientation_get_type ())
91
92
93 G_END_DECLS
94
95 #endif /* __PSPPIRE_DIALOG_H__ */
96