1 /* PSPPIRE - a graphical user interface for PSPP.
2 Copyright (C) 2011 Free Software Foundation, Inc.
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.
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.
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/>. */
18 * Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford <jrb@redhat.com>
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Library General Public
22 * License as published by the Free Software Foundation; either
23 * version 2 of the License, or (at your option) any later version.
25 * This library is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 * Library General Public License for more details.
30 * You should have received a copy of the GNU Library General Public
31 * License along with this library; if not, write to the
32 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
33 * Boston, MA 02111-1307, USA.
36 #ifndef __PSPP_SHEET_SELECTION_H__
37 #define __PSPP_SHEET_SELECTION_H__
44 #define PSPP_TYPE_SHEET_SELECTION (pspp_sheet_selection_get_type ())
45 #define PSPP_SHEET_SELECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PSPP_TYPE_SHEET_SELECTION, PsppSheetSelection))
46 #define PSPP_SHEET_SELECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PSPP_TYPE_SHEET_SELECTION, PsppSheetSelectionClass))
47 #define PSPP_IS_SHEET_SELECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PSPP_TYPE_SHEET_SELECTION))
48 #define PSPP_IS_SHEET_SELECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PSPP_TYPE_SHEET_SELECTION))
49 #define PSPP_SHEET_SELECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PSPP_TYPE_SHEET_SELECTION, PsppSheetSelectionClass))
51 typedef gboolean (* PsppSheetSelectionFunc) (PsppSheetSelection *selection,
54 gboolean path_currently_selected,
56 typedef void (* PsppSheetSelectionForeachFunc) (GtkTreeModel *model,
61 struct _PsppSheetSelection
67 PsppSheetView *GSEAL (tree_view);
68 GtkSelectionMode GSEAL (type);
69 PsppSheetSelectionFunc GSEAL (user_func);
70 gpointer GSEAL (user_data);
71 GDestroyNotify GSEAL (destroy);
74 struct _PsppSheetSelectionClass
76 GObjectClass parent_class;
78 void (* changed) (PsppSheetSelection *selection);
80 /* Padding for future expansion */
81 void (*_gtk_reserved1) (void);
82 void (*_gtk_reserved2) (void);
83 void (*_gtk_reserved3) (void);
84 void (*_gtk_reserved4) (void);
88 GType pspp_sheet_selection_get_type (void) G_GNUC_CONST;
90 void pspp_sheet_selection_set_mode (PsppSheetSelection *selection,
91 GtkSelectionMode type);
92 GtkSelectionMode pspp_sheet_selection_get_mode (PsppSheetSelection *selection);
93 void pspp_sheet_selection_set_select_function (PsppSheetSelection *selection,
94 PsppSheetSelectionFunc func,
96 GDestroyNotify destroy);
97 gpointer pspp_sheet_selection_get_user_data (PsppSheetSelection *selection);
98 PsppSheetView* pspp_sheet_selection_get_tree_view (PsppSheetSelection *selection);
100 PsppSheetSelectionFunc pspp_sheet_selection_get_select_function (PsppSheetSelection *selection);
102 /* Only meaningful if GTK_SELECTION_SINGLE or GTK_SELECTION_BROWSE is set */
103 /* Use selected_foreach or get_selected_rows for GTK_SELECTION_MULTIPLE */
104 gboolean pspp_sheet_selection_get_selected (PsppSheetSelection *selection,
105 GtkTreeModel **model,
107 GList * pspp_sheet_selection_get_selected_rows (PsppSheetSelection *selection,
108 GtkTreeModel **model);
109 gint pspp_sheet_selection_count_selected_rows (PsppSheetSelection *selection);
110 void pspp_sheet_selection_selected_foreach (PsppSheetSelection *selection,
111 PsppSheetSelectionForeachFunc func,
113 void pspp_sheet_selection_select_path (PsppSheetSelection *selection,
115 void pspp_sheet_selection_unselect_path (PsppSheetSelection *selection,
117 void pspp_sheet_selection_select_iter (PsppSheetSelection *selection,
119 void pspp_sheet_selection_unselect_iter (PsppSheetSelection *selection,
121 gboolean pspp_sheet_selection_path_is_selected (PsppSheetSelection *selection,
123 gboolean pspp_sheet_selection_iter_is_selected (PsppSheetSelection *selection,
125 void pspp_sheet_selection_select_all (PsppSheetSelection *selection);
126 void pspp_sheet_selection_unselect_all (PsppSheetSelection *selection);
127 void pspp_sheet_selection_select_range (PsppSheetSelection *selection,
128 GtkTreePath *start_path,
129 GtkTreePath *end_path);
130 void pspp_sheet_selection_unselect_range (PsppSheetSelection *selection,
131 GtkTreePath *start_path,
132 GtkTreePath *end_path);
137 #endif /* __PSPP_SHEET_SELECTION_H__ */