Update Spanish translation
[gnumeric.git] / src / wbc-gtk-impl.h
blobec9678a5b4d4f9f3a0fd47db1a989c922e678395
1 #ifndef _GNM_WBC_GTK_IMPL_H_
2 # define _GNM_WBC_GTK_IMPL_H_
4 #include <gnumeric.h>
5 #include <wbc-gtk.h>
6 #include <workbook-control-priv.h>
7 #include <style.h>
8 #include <widgets/gnm-expr-entry.h>
9 #include <widgets/gnm-notebook.h>
11 #include <goffice/goffice.h>
13 G_BEGIN_DECLS
15 struct _WBCGtk {
16 WorkbookControl base;
18 GtkWidget *toplevel;
20 GtkBuilder *gui;
22 /* The area that contains the sheet and the sheet tabs. */
23 GtkWidget *notebook_area;
25 /* The notebook that contains the sheets. */
26 GtkNotebook *snotebook;
28 /* The notebook that contains the sheet tabs. */
29 GnmNotebook *bnotebook;
31 /* The GtkPaned that contains the sheet tabs and the status area. */
32 GtkPaned *tabs_paned;
34 GtkWidget *progress_bar;
36 struct {
37 GnmExprEntry *entry; /* The real edit line */
38 GnmExprEntry *temp_entry; /* A tmp overlay eg from a guru */
39 GtkWidget *guru;
40 gulong signal_changed, signal_insert, signal_delete;
41 gulong signal_cursor_pos, signal_selection_bound;
42 PangoAttrList *cell_attrs; /* Attrs from cell format. */
43 PangoAttrList *markup; /* just the markup */
44 PangoAttrList *full_content; /* cell_attrs+markup */
45 PangoAttrList *cur_fmt; /* attrs for new text (depends on position) */
46 } edit_line;
48 /* While editing these should be visible */
49 GtkWidget *ok_button, *cancel_button;
51 /* While not editing these should be visible */
52 GtkWidget *func_button;
54 gboolean updating_ui;
55 gboolean inside_editing;
57 /* Auto completion */
58 GnmComplete *auto_complete;
59 gboolean auto_completing;
60 char *auto_complete_text;
62 /* Used to detect if the user has backspaced, so we turn off auto-complete */
63 int auto_max_size;
65 /* Keep track of whether the last key pressed was END, so end-mode works */
66 gboolean last_key_was_end;
68 SheetControlGUI *rangesel;
70 GtkWidget *table;
71 GtkWidget *auto_expr_label;
72 GtkWidget *status_text;
74 /* Widgets whose visibility should be copied. */
75 GHashTable *visibility_widgets;
77 gboolean is_fullscreen;
78 GOUndo *undo_for_fullscreen;
79 GSList *hide_for_fullscreen;
81 /* Edit area */
82 GtkWidget *selection_descriptor; /* A GtkEntry */
84 /* Autosave */
85 gboolean autosave_prompt;
86 gint autosave_time;
87 guint autosave_timer;
89 PangoFontDescription *font_desc;
91 SheetControlGUI *active_scg;
92 gulong sig_view_changed;
93 gulong sig_auto_expr_text, sig_auto_expr_attrs;
94 gulong sig_show_horizontal_scrollbar, sig_show_vertical_scrollbar;
95 gulong sig_show_notebook_tabs;
96 gulong sig_sheet_order, sig_notify_uri, sig_notify_dirty;
97 gpointer sig_wbv;
99 /**********************************************/
100 GtkWidget *status_area;
101 GtkUIManager *ui;
102 GtkActionGroup *permanent_actions, *actions, *font_actions,
103 *data_only_actions, *semi_permanent_actions;
104 struct {
105 GtkActionGroup *actions;
106 guint merge_id;
107 } file_history, toolbar, windows, templates;
109 guint template_loader_handler;
111 GOActionComboStack *undo_haction, *redo_haction;
112 GtkAction *undo_vaction, *redo_vaction;
113 GOActionComboColor *fore_color, *back_color;
114 GtkAction *font_name_haction, *font_name_vaction;
115 GOActionComboText *zoom_haction;
116 GtkAction *zoom_vaction;
117 GOActionComboPixmaps *borders, *halignment, *valignment;
118 struct {
119 GtkToggleAction *bold, *italic, *underline, *d_underline,
120 *sl_underline, *dl_underline;
121 GtkToggleAction *superscript, *subscript, *strikethrough;
122 } font;
123 struct {
124 GtkToggleAction *left, *center, *right, *center_across_selection;
125 } h_align;
126 struct {
127 GtkToggleAction *top, *center, *bottom;
128 } v_align;
130 GtkWidget *menu_zone, *toolbar_zones[4];
131 GHashTable *custom_uis;
133 guint idle_update_style_feedback;
135 /* When editing a cell: the cell (may be NULL) */
136 GnmCell *editing_cell;
137 Sheet *editing_sheet;
138 gboolean editing;
140 SheetObject *new_object; /* A newly created object that has yet to be realized */
142 char *preferred_geometry;
145 typedef struct {
146 WorkbookControlClass base;
148 /* signals */
149 void (*markup_changed) (WBCGtk const *wbcg);
150 } WBCGtkClass;
152 #define GNM_RESPONSE_SAVE_ALL -1000
153 #define GNM_RESPONSE_DISCARD_ALL -1001
155 /* Protected functions */
156 gboolean wbc_gtk_close (WBCGtk *wbcg);
157 void wbcg_insert_sheet (GtkWidget *ignored, WBCGtk *wbcg);
158 void wbcg_append_sheet (GtkWidget *ignored, WBCGtk *wbcg);
159 void wbcg_clone_sheet (GtkWidget *ignored, WBCGtk *wbcg);
161 void wbc_gtk_init_editline (WBCGtk *wbcg);
162 void wbc_gtk_init_actions (WBCGtk *wbcg);
163 void wbc_gtk_markup_changer (WBCGtk *wbcg);
165 void wbcg_font_action_set_font_desc (GtkAction *act, PangoFontDescription *desc);
167 gboolean wbc_gtk_load_templates (WBCGtk *gtk);
169 GtkAction *wbcg_find_action (WBCGtk *wbcg, const char *name);
171 G_MODULE_EXPORT void set_uifilename (char const *name, GtkActionEntry const *actions, int nb);
173 G_END_DECLS
175 #endif /* _GNM_WBC_GTK_IMPL_H_ */