Update Spanish translation
[gnumeric.git] / src / workbook.h
blobd2672d52d883c43d51bd69619953c148a2c76418
1 #ifndef _GNM_WORKBOOK_H_
2 # define _GNM_WORKBOOK_H_
4 #include <gnumeric.h>
5 #include <goffice/goffice.h>
6 #include <glib-object.h>
7 #include <gui-file.h>
9 G_BEGIN_DECLS
11 #define GNM_WORKBOOK_TYPE (workbook_get_type ())
12 #define WORKBOOK(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNM_WORKBOOK_TYPE, Workbook))
13 #define GNM_IS_WORKBOOK(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_WORKBOOK_TYPE))
15 GType workbook_get_type (void);
16 Workbook *workbook_new (void);
17 Workbook *workbook_new_with_sheets (int sheet_count);
19 /* Sheet support routines */
20 GSList *workbook_sheets (Workbook const *wb);
21 int workbook_sheet_count (Workbook const *wb);
22 Sheet *workbook_sheet_by_index (Workbook const *wb, int i);
23 Sheet *workbook_sheet_by_name (Workbook const *wb, char const *sheet_name);
24 void workbook_sheet_attach (Workbook *wb, Sheet *new_sheet);
25 void workbook_sheet_attach_at_pos (Workbook *wb, Sheet *new_sheet, int pos);
26 Sheet *workbook_sheet_add (Workbook *wb, int pos, int columns, int rows);
27 Sheet *workbook_sheet_add_with_type (Workbook *wb, GnmSheetType sheet_type, int pos, int columns, int rows);
28 void workbook_sheet_delete (Sheet *sheet);
29 void workbook_sheet_move (Sheet *sheet, int direction);
30 char *workbook_sheet_get_free_name (Workbook *wb,
31 char const *base,
32 gboolean always_suffix,
33 gboolean handle_counter);
34 gboolean workbook_sheet_reorder (Workbook *wb,
35 GSList *new_order);
36 gboolean workbook_sheet_rename (Workbook *wb,
37 GSList *sheet_indices,
38 GSList *new_names,
39 GOCmdContext *cc);
41 unsigned workbook_find_command (Workbook *wb,
42 gboolean is_undo, gpointer cmd);
44 GnmExprSharer *workbook_share_expressions (Workbook *wb, gboolean freeit);
45 void workbook_optimize_style (Workbook *wb);
47 void workbook_update_graphs (Workbook *wb);
49 /* IO Routines */
50 gboolean workbook_set_saveinfo (Workbook *wb, GOFileFormatLevel lev,
51 GOFileSaver *saver);
52 void workbook_update_history (Workbook *wb, GnmFileSaveAsStyle type);
53 GOFileSaver *workbook_get_file_saver (Workbook *wb);
54 GOFileSaver *workbook_get_file_exporter (Workbook *wb);
55 gchar const *workbook_get_last_export_uri (Workbook *wb);
56 void workbook_set_file_exporter (Workbook *wb, GOFileSaver *fs);
57 void workbook_set_last_export_uri (Workbook *wb, const gchar *uri);
59 /* See also sheet_foreach_cell_in_region */
60 GnmValue *workbook_foreach_cell_in_range (GnmEvalPos const *pos,
61 GnmValue const *cell_range,
62 CellIterFlags flags,
63 CellIterFunc handler,
64 gpointer closure);
65 GPtrArray *workbook_cells (Workbook *wb, gboolean comments,
66 GnmSheetVisibility vis);
68 void workbook_foreach_name (Workbook const *wb, gboolean globals_only,
69 GHFunc func, gpointer data);
72 /* Calculation */
73 void workbook_recalc (Workbook *wb); /* in dependent.c */
74 void workbook_recalc_all (Workbook *wb); /* in dependent.c */
75 gboolean workbook_enable_recursive_dirty (Workbook *wb, gboolean enable);
76 void workbook_set_recalcmode (Workbook *wb, gboolean enable);
77 gboolean workbook_get_recalcmode (Workbook const *wb);
78 void workbook_iteration_enabled (Workbook *wb, gboolean enable);
79 void workbook_iteration_max_number (Workbook *wb, int max_number);
80 void workbook_iteration_tolerance (Workbook *wb, double tolerance);
82 GODateConventions const *workbook_date_conv (Workbook const *wb);
83 void workbook_set_date_conv (Workbook *wb, GODateConventions const *date_conv);
84 void workbook_set_1904 (Workbook *wb, gboolean base1904);
86 GnmSheetSize const *workbook_get_sheet_size (Workbook const *wb);
88 void workbook_attach_view (WorkbookView *wbv);
89 void workbook_detach_view (WorkbookView *wbv);
91 GType workbook_sheet_state_get_type (void);
92 WorkbookSheetState *workbook_sheet_state_new (Workbook const *wb);
93 void workbook_sheet_state_free (WorkbookSheetState *wss);
94 void workbook_sheet_state_restore (Workbook *wb, WorkbookSheetState const *wss);
95 int workbook_sheet_state_size (WorkbookSheetState const *wss);
96 char *workbook_sheet_state_diff (WorkbookSheetState const *wss_a,
97 WorkbookSheetState const *wss_b);
99 #define WORKBOOK_FOREACH_SHEET(wb, sheet, code) \
100 do { \
101 const Workbook *wb_ = (wb); \
102 unsigned sheetno_; \
103 unsigned sheetcount_ = workbook_sheet_count (wb_); \
104 for (sheetno_ = 0; sheetno_ < sheetcount_; sheetno_++) { \
105 Sheet *sheet = workbook_sheet_by_index (wb_, sheetno_); \
106 code; \
108 } while (0)
111 G_END_DECLS
113 #endif /* _GNM_WORKBOOK_H_ */