Update Spanish translation
[gnumeric.git] / src / workbook-priv.h
blobba278f354f34fe4b2013a3214cd645c683e1a0a2
1 #ifndef _GNM_WORKBOOK_PRIV_H_
2 # define _GNM_WORKBOOK_PRIV_H_
4 #include <workbook.h>
5 #include <goffice/goffice.h>
7 G_BEGIN_DECLS
9 struct _Workbook {
10 GODoc doc;
12 GPtrArray *wb_views;
14 GPtrArray *sheets;
15 GHashTable *sheet_hash_private;
16 GHashTable *sheet_order_dependents;
17 GHashTable *sheet_local_functions;
19 gboolean is_placeholder;
21 GOFileFormatLevel file_format_level;
22 GOFileFormatLevel file_export_format_level;
23 GOFileSaver *file_saver;
24 GOFileSaver *file_exporter;
25 char *last_export_uri;
27 /* Undo support */
28 GSList *undo_commands;
29 GSList *redo_commands;
31 GnmNamedExprCollection *names;
33 /* Calculation options */
34 struct {
35 gboolean enabled;
36 int max_number;
37 double tolerance;
38 } iteration;
39 gboolean recalc_auto;
40 GODateConventions const *date_conv;
42 gboolean during_destruction;
43 gboolean being_reordered;
44 gboolean recursive_dirty_enabled;
47 typedef struct {
48 GODocClass base;
50 void (*sheet_order_changed) (Workbook *wb);
51 void (*sheet_added) (Workbook *wb);
52 void (*sheet_deleted) (Workbook *wb);
53 } WorkbookClass;
55 #define WORKBOOK_FOREACH_VIEW(wb, view, code) \
56 do { \
57 int InD; \
58 GPtrArray *wb_views = (wb)->wb_views; \
59 if (wb_views != NULL) /* Reverse is important during destruction */ \
60 for (InD = wb_views->len; InD-- > 0; ) { \
61 WorkbookView *view = g_ptr_array_index (wb_views, InD); \
62 code \
63 } \
64 } while (0)
66 #define WORKBOOK_FOREACH_CONTROL(wb, view, control, code) \
67 WORKBOOK_FOREACH_VIEW((wb), view, \
68 WORKBOOK_VIEW_FOREACH_CONTROL(view, control, code);)
71 * Walk the dependents. WARNING: Note, that it is only valid to muck with
72 * the current dependency in the code.
74 #define WORKBOOK_FOREACH_DEPENDENT(wb, dep, code) \
75 do { \
76 /* Maybe external deps here. */ \
78 WORKBOOK_FOREACH_SHEET(wb, _wfd_sheet, { \
79 SHEET_FOREACH_DEPENDENT (_wfd_sheet, dep, code); \
80 }); \
81 } while (0)
83 G_END_DECLS
85 #endif /* _GNM_WORKBOOK_PRIV_H_ */