1 #ifndef _GNM_WORKBOOK_VIEW_H_
2 # define _GNM_WORKBOOK_VIEW_H_
6 #include <goffice/goffice.h>
10 struct _WorkbookView
{
14 GPtrArray
*wb_controls
;
16 Sheet
*current_sheet
; /* convenience */
17 SheetView
*current_sheet_view
;
20 gboolean show_horizontal_scrollbar
;
21 gboolean show_vertical_scrollbar
;
22 gboolean show_notebook_tabs
;
23 gboolean show_function_cell_markers
;
24 gboolean show_extension_markers
;
25 gboolean do_auto_completion
;
26 gboolean is_protected
;
28 /* Non-normative size information */
29 int preferred_width
, preferred_height
;
31 /* The auto-expression */
36 gboolean use_max_precision
;
38 gulong sheet_detached_sig
;
42 char *selection_description
;
44 /* Style for feedback */
45 GnmStyle
const *current_style
;
46 SheetObject
*in_cell_combo
; /* validation or data slicer */
50 GObjectClass base_class
;
51 void (*sheet_entered
) (Sheet
*sheet
);
54 #define GNM_WORKBOOK_VIEW_TYPE (workbook_view_get_type ())
55 #define GNM_WORKBOOK_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNM_WORKBOOK_VIEW_TYPE, WorkbookView))
56 #define GNM_IS_WORKBOOK_VIEW(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_WORKBOOK_VIEW_TYPE))
59 GType
workbook_view_get_type (void);
60 WorkbookView
*workbook_view_new (Workbook
*wb
);
61 void wb_view_attach_control (WorkbookView
*wbv
, WorkbookControl
*wbc
);
62 void wb_view_detach_control (WorkbookControl
*wbc
);
63 void wb_view_detach_from_workbook (WorkbookView
*wbv
);
66 GODoc
*wb_view_get_doc (WorkbookView
const *wbv
);
67 Workbook
*wb_view_get_workbook (WorkbookView
const *wbv
);
68 int wb_view_get_index_in_wb (WorkbookView
const *wbv
);
69 Sheet
*wb_view_cur_sheet (WorkbookView
const *wbv
);
70 SheetView
*wb_view_cur_sheet_view (WorkbookView
const *wbv
);
71 void wb_view_sheet_focus (WorkbookView
*wbv
, Sheet
*sheet
);
72 void wb_view_sheet_add (WorkbookView
*wbv
, Sheet
*new_sheet
);
73 gboolean
wb_view_is_protected (WorkbookView
*wbv
, gboolean check_sheet
);
76 void wb_view_set_attribute (WorkbookView
*wbv
, char const *name
,
78 void wb_view_preferred_size (WorkbookView
*wbv
,
79 int w_pixels
, int h_pixels
);
80 void wb_view_style_feedback (WorkbookView
*wbv
);
81 void wb_view_menus_update (WorkbookView
*wbv
);
82 void wb_view_selection_desc (WorkbookView
*wbv
, gboolean use_pos
,
83 WorkbookControl
*wbc
);
84 void wb_view_edit_line_set (WorkbookView
*wbv
,
85 WorkbookControl
*wbc
);
86 void wb_view_auto_expr_recalc (WorkbookView
*wbv
);
89 gboolean
workbook_view_save_as (WorkbookView
*wbv
, GOFileSaver
*fs
,
90 char const *uri
, GOCmdContext
*cc
);
91 gboolean
workbook_view_save (WorkbookView
*wbv
, GOCmdContext
*cc
);
92 void workbook_view_save_to_output (WorkbookView
*wbv
,
93 GOFileSaver
const *fs
,
95 GOIOContext
*io_context
);
96 void workbook_view_save_to_uri (WorkbookView
*wbv
, GOFileSaver
const *fs
,
97 char const *uri
, GOIOContext
*io_context
);
99 WorkbookView
*workbook_view_new_from_input (GsfInput
*input
,
101 GOFileOpener
const *file_opener
,
102 GOIOContext
*io_context
,
103 gchar
const *encoding
);
104 WorkbookView
*workbook_view_new_from_uri (char const *uri
,
105 GOFileOpener
const *file_opener
,
106 GOIOContext
*io_context
,
107 gchar
const *encoding
);
109 #define WORKBOOK_VIEW_FOREACH_CONTROL(wbv, control, code) \
112 GPtrArray *wb_controls = (wbv)->wb_controls; \
113 if (wb_controls != NULL) /* Reverse is important during destruction */ \
114 for (jNd = wb_controls->len; jNd-- > 0 ;) { \
115 WorkbookControl *control = \
116 g_ptr_array_index (wb_controls, jNd); \
124 #endif /* _GNM_WORKBOOK_VIEW_H_ */