1 #ifndef _GNM_WORKBOOK_CONTROL_PRIV_H_
2 # define _GNM_WORKBOOK_CONTROL_PRIV_H_
3 
4 #include <workbook-control.h>
5 #include <goffice/goffice.h>
6 
7 G_BEGIN_DECLS
8 
9 struct _WorkbookControl {
10 	GODocControl base;
11 
12 	WorkbookView *wb_view;
13 
14 	gulong clipboard_changed_signal;
15 };
16 typedef struct {
17 	GODocControlClass base;
18 
19 	/* Create a new control of the same form */
20 	WorkbookControl *(*control_new) (WorkbookControl *wbc, WorkbookView *wbv, Workbook *wb,
21 					 void *extra);
22 	void (*init_state) (WorkbookControl *wbc);
23 
24 	/* Actions on the workbook UI */
25 	void (*style_feedback)	    (WorkbookControl *wbc, GnmStyle const *changes);
26 	void (*edit_line_set)	    (WorkbookControl *wbc, char const *text);
27 	void (*edit_finish)	    (WorkbookControl *wbc, gboolean accept);
28 	void (*selection_descr_set) (WorkbookControl *wbc, char const *text);
29 	void (*update_action_sensitivity)  (WorkbookControl *wbc);
30 	struct _WbcSheetManager {
31 		void (*add)	(WorkbookControl *wbc, SheetView *sv);
32 		void (*remove)	(WorkbookControl *wbc, Sheet *sheet);
33 		void (*focus)   (WorkbookControl *wbc, Sheet *sheet);
34 		void (*remove_all) (WorkbookControl *wbc);
35 	} sheet;
36 	struct _WbcUndoRedo {
37 		void (*truncate)(WorkbookControl *wbc, int n, gboolean is_undo);
38 		void (*pop)	(WorkbookControl *wbc, gboolean is_undo);
39 		void (*push)	(WorkbookControl *wbc, gboolean is_undo,
40 				 char const *text, gpointer key);
41 		void (*labels)	(WorkbookControl *wbc,
42 				 char const *undo, char const *redo);
43 	} undo_redo;
44 	struct _WbcMenuState {
45 		void (*update)      (WorkbookControl *wbc, int flags);
46 	} menu_state;
47 
48 	gboolean (*claim_selection)      (WorkbookControl *wbc);
49 	void	 (*paste_from_selection) (WorkbookControl *wbc,
50 					  GnmPasteTarget const *pt);
51 	int	  (*validation_msg)	 (WorkbookControl *wbc, ValidationStyle v,
52 					  char const *title, char const *msg);
53 } WorkbookControlClass;
54 
55 #define GNM_WBC_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GNM_WBC_TYPE, WorkbookControlClass))
56 
57 G_END_DECLS
58 
59 #endif /* _GNM_WORKBOOK_CONTROL_PRIV_H_ */
60