1 /*
2   A widget to display and manipulate tabular data
3   Copyright (C) 2016, 2020  John Darrington
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 3 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, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #ifndef _SSW_SHEET_BODY_H
20 #define _SSW_SHEET_BODY_H
21 
22 #include <gtk/gtk.h>
23 
24 #include "ssw-sheet-axis.h"
25 #include "ssw-sheet.h"
26 
27 
28 struct _SswSheetBodyClass
29 {
30   GtkLayoutClass parent_class;
31 };
32 
33 #define SSW_TYPE_SHEET_BODY ssw_sheet_body_get_type ()
34 
35 G_DECLARE_DERIVABLE_TYPE (SswSheetBody, ssw_sheet_body, SSW, SHEET_BODY, GtkLayout)
36 
37 GtkWidget * ssw_sheet_body_new (SswSheet *sheet);
38 
39 void ssw_sheet_body_set_clip (SswSheetBody *body, GtkClipboard *clip);
40 
41 void ssw_sheet_body_unset_selection (SswSheetBody *body);
42 
43 void ssw_sheet_body_value_to_string (SswSheetBody *body, gint col, gint row,
44                                      GString *output);
45 
46 void ssw_sheet_body_set_active_cell (SswSheetBody *body,
47                                      gint col, gint row, GdkEvent *e);
48 
49 gboolean ssw_sheet_body_get_active_cell (SswSheetBody *body,
50                                          gint *col, gint *row);
51 
52 /* Check if the editable is focused. If yes paste into the
53    editable. Return False if the editable is not focused */
54 gboolean ssw_sheet_body_paste_editable (SswSheetBody *body);
55 
56 /* Check if editable is focused. If yes do the clipboard cut and return TRUE */
57 gboolean ssw_sheet_body_cut_editable (SswSheetBody *body);
58 
59 #endif
60