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