88d1a21fcc4a3b1cd0fba190022362d4dcc6d91e
[pspp-builds.git] / src / ui / gui / sort-cases-dialog.h
1 /*
2     PSPPIRE --- A Graphical User Interface for PSPP
3     Copyright (C) 2006  Free Software Foundation
4
5     This program is free software; you can redistribute it and/or modify
6     it under the terms of the GNU General Public License as published by
7     the Free Software Foundation; either version 2 of the License, or
8     (at your option) any later version.
9
10     This program is distributed in the hope that it will be useful,
11     but WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13     GNU General Public License for more details.
14
15     You should have received a copy of the GNU General Public License
16     along with this program; if not, write to the Free Software
17     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18     02110-1301, USA. */
19
20 #ifndef __SORT_CASES_DIALOG_H
21 #define __SORT_CASES_DIALOG_H
22
23
24 #include <gtk/gtk.h>
25 #include <glade/glade.h>
26 #include "psppire-dict.h"
27
28 struct sort_criteria;
29
30 struct sort_cases_dialog
31 {
32   GtkWidget *window;
33   GMainLoop *loop;
34
35   GtkTreeView *dict_view;
36
37
38   GtkTreeView *criteria_view;
39   GtkTreeViewColumn *crit_col;
40   GtkCellRenderer *crit_renderer;
41
42   GtkListStore *criteria_list;
43
44   struct sort_criteria *sc;
45
46   GtkArrow *arrow;
47   GtkButton *button;
48
49   GtkToggleButton *ascending_button;
50
51   /* FIXME: Could this be done better with a GtkToggleAction ?? */
52   enum {VAR_SELECT, VAR_DESELECT} button_state;
53
54   gint response;
55 };
56
57 struct sort_cases_dialog * sort_cases_dialog_create (GladeXML *xml);
58
59
60 gint sort_cases_dialog_run (struct sort_cases_dialog *dialog,
61                            PsppireDict *dict,
62                            struct sort_criteria *criteria
63                            );
64
65 #endif