1 #ifndef _GNM_SELECTION_H_
2 # define _GNM_SELECTION_H_
5 #include <goffice/goffice.h>
11 COL_ROW_PARTIAL_SELECTION
,
12 COL_ROW_FULL_SELECTION
13 } ColRowSelectionType
;
16 GNM_SELECTION_MODE_ADD
= 0,
17 GNM_SELECTION_MODE_REMOVE
,
18 GNM_SELECTION_MODE_TOGGLE
21 /* Selection information */
22 GnmCellPos
const *sv_is_singleton_selected (SheetView
const *sv
);
23 gboolean
sv_is_pos_selected (SheetView
const *sv
, int col
, int row
);
24 gboolean
sv_is_range_selected (SheetView
const *sv
, GnmRange
const *r
);
25 gboolean
sv_is_full_range_selected (SheetView
const *sv
, GnmRange
const *r
);
26 gboolean
sv_is_colrow_selected (SheetView
const *sv
,
27 int colrow
, gboolean is_col
);
28 gboolean
sv_is_full_colrow_selected (SheetView
const *sv
,
29 gboolean is_cols
, int index
);
30 ColRowSelectionType
sv_selection_col_type (SheetView
const *sv
, int col
);
31 ColRowSelectionType
sv_selection_row_type (SheetView
const *sv
, int row
);
33 char *selection_to_string (SheetView
*sv
,
34 gboolean include_sheet_name_prefix
);
35 GnmRange
const *selection_first_range (SheetView
const *sv
,
36 GOCmdContext
*cc
, char const *cmd_name
);
37 GSList
*selection_get_ranges (SheetView
const *sv
,
38 gboolean allow_intersection
);
40 void sv_selection_to_plot (SheetView
*sv
, GogPlot
*plot
);
42 /* Selection management */
43 void sv_selection_reset (SheetView
*sv
);
44 void sv_selection_add_pos (SheetView
*sv
, int col
, int row
, GnmSelectionMode mode
);
45 void sv_selection_add_range (SheetView
*sv
, GnmRange
const *range
);
46 void sv_selection_add_full (SheetView
*sv
,
47 int edit_col
, int edit_row
,
48 int base_col
, int base_row
,
49 int move_col
, int move_row
,
50 GnmSelectionMode mode
);
51 void sv_selection_set (SheetView
*sv
, GnmCellPos
const *edit
,
52 int base_col
, int base_row
,
53 int move_col
, int move_row
);
54 void sv_selection_extend_to (SheetView
*sv
, int col
, int row
);
55 void sv_selection_free (SheetView
*sv
);
56 void sv_selection_simplified_free (SheetView
*sv
);
57 void sv_selection_simplify (SheetView
*sv
);
59 void sv_selection_walk_step (SheetView
*sv
,
63 /* Utilities for operating on a selection */
64 typedef void (*SelectionApplyFunc
) (SheetView
*sv
, GnmRange
const *r
,
66 typedef gboolean (*GnmSelectionFunc
) (SheetView
*sv
, GnmRange
const *r
,
69 void sv_selection_apply (SheetView
*sv
, SelectionApplyFunc
const func
,
70 gboolean allow_intersection
,
72 gboolean
sv_selection_foreach (SheetView
*sv
,
73 GnmSelectionFunc handler
,
78 #endif /* _GNM_SELECTION_H_ */