Converted Factor Dialog to PsppireDialogAction class
[pspp] / src / ui / gui / psppire-dialog-action-factor.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 #ifndef __PSPPIRE_DIALOG_ACTION_FACTOR_H__
19 #define __PSPPIRE_DIALOG_ACTION_FACTOR_H__
20
21 #include <glib-object.h>
22 #include <glib.h>
23
24 #include "psppire-dialog-action.h"
25
26 G_BEGIN_DECLS
27
28
29 #define PSPPIRE_TYPE_DIALOG_ACTION_FACTOR (psppire_dialog_action_factor_get_type ())
30
31 #define PSPPIRE_DIALOG_ACTION_FACTOR(obj)       \
32                      (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
33                                                   PSPPIRE_TYPE_DIALOG_ACTION_FACTOR, PsppireDialogActionFactor))
34
35 #define PSPPIRE_DIALOG_ACTION_FACTOR_CLASS(klass) \
36                      (G_TYPE_CHECK_CLASS_CAST ((klass), \
37                                  PSPPIRE_TYPE_DIALOG_ACTION_FACTOR, \
38                                  PsppireDialogActionFactorClass))
39
40
41 #define PSPPIRE_IS_DIALOG_ACTION_FACTOR(obj) \
42                      (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PSPPIRE_TYPE_DIALOG_ACTION_FACTOR))
43
44 #define PSPPIRE_IS_DIALOG_ACTION_FACTOR_CLASS(klass) \
45                      (G_TYPE_CHECK_CLASS_TYPE ((klass), PSPPIRE_TYPE_DIALOG_ACTION_FACTOR))
46
47
48 #define PSPPIRE_DIALOG_ACTION_FACTOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
49                                    PSPPIRE_TYPE_DIALOG_ACTION_FACTOR, \
50                                    PsppireDialogActionFactorClass))
51
52 typedef struct _PsppireDialogActionFactor       PsppireDialogActionFactor;
53 typedef struct _PsppireDialogActionFactorClass  PsppireDialogActionFactorClass;
54
55
56 enum rotation_type {
57   ROT_NONE,
58   ROT_VARIMAX,
59   ROT_QUARTIMAX,
60   ROT_EQUIMAX
61 };
62
63 struct rotation_parameters
64 {
65   gboolean rotated_solution;
66   gint iterations;
67
68   enum rotation_type method;
69 };
70
71 struct extraction_parameters
72 {
73   gdouble mineigen;
74   gint n_factors;
75   gint n_iterations;
76
77   gboolean explicit_nfactors;  
78   gboolean covariance;
79
80   gboolean scree;
81   gboolean unrotated;
82
83   gboolean paf;
84 };
85
86
87 struct _PsppireDialogActionFactor
88 {
89   PsppireDialogAction parent;
90
91   /*< private >*/
92   GtkWidget *variables ;
93
94   /* The Extraction subdialog */
95   GtkWidget *extraction_dialog;
96   GtkWidget *rotation_dialog;
97
98   GtkWidget *n_factors;
99   GtkWidget *mineigen;
100   GtkWidget *extract_iterations;
101
102   GtkWidget *nfactors_toggle;
103   GtkWidget *mineigen_toggle;
104
105   GtkWidget *covariance_toggle;
106   GtkWidget *correlation_toggle;
107
108   GtkWidget *scree_button;
109   GtkWidget *unrotated_button;
110
111   GtkWidget *extraction_combo;
112
113
114   /* Rotation Widgets */
115   GtkWidget *rotate_iterations;
116   GtkWidget *display_rotated_solution;
117   GtkWidget *rotation_none;
118   GtkWidget *rotation_varimax;
119   GtkWidget *rotation_quartimax;
120   GtkWidget *rotation_equimax;
121
122
123   struct extraction_parameters extraction;
124   struct rotation_parameters rotation;
125 };
126
127
128 struct _PsppireDialogActionFactorClass
129 {
130   PsppireDialogActionClass parent_class;
131 };
132
133
134 GType psppire_dialog_action_factor_get_type (void) ;
135
136 G_END_DECLS
137
138 #endif /* __PSPPIRE_DIALOG_ACTION_FACTOR_H__ */