1 #ifndef _GNM_APPLICATION_H_
2 # define _GNM_APPLICATION_H_
5 #include <glib-object.h>
9 #define GNM_APP_TYPE (gnm_app_get_type ())
11 GType
gnm_app_get_type (void);
12 GObject
*gnm_app_get_app (void);
14 gboolean
gnm_app_shutting_down (void);
15 gboolean
gnm_app_initial_open_complete (void);
17 /* List of active workbooks */
18 void gnm_app_workbook_list_add (Workbook
*wb
);
19 void gnm_app_workbook_list_remove (Workbook
*wb
);
20 GList
* gnm_app_workbook_list (void);
21 Workbook
*gnm_app_workbook_get_by_name (char const *name
,
23 Workbook
*gnm_app_workbook_get_by_index (int i
);
25 GSList
*gnm_app_history_get_list (int max_elements
);
26 void gnm_app_history_add (char const *filename
, const char *mimetype
);
28 void gnm_app_sanity_check (void);
30 void gnm_app_recalc (void);
31 void gnm_app_recalc_start (void);
32 void gnm_app_recalc_finish (void);
33 void gnm_app_recalc_clear_caches (void);
36 void *gnm_app_create_opener_filter (GList
*openers
);
38 double gnm_app_display_dpi_get (gboolean horizontal
);
39 double gnm_app_dpi_to_pixels (void);
42 void gnm_app_clipboard_clear (gboolean drop_selection
);
43 void gnm_app_clipboard_invalidate_sheet (Sheet
*sheet
);
44 void gnm_app_clipboard_cut_copy (WorkbookControl
*wbc
, gboolean is_cut
,
45 SheetView
*sv
, GnmRange
const *area
,
46 gboolean animate_range
);
47 void gnm_app_clipboard_cut_copy_obj (WorkbookControl
*wbc
, gboolean is_cut
,
48 SheetView
*sv
, GSList
*objects
);
49 void gnm_app_clipboard_unant (void);
50 gboolean
gnm_app_clipboard_is_empty (void);
51 gboolean
gnm_app_clipboard_is_cut (void);
52 Sheet
*gnm_app_clipboard_sheet_get (void);
53 SheetView
*gnm_app_clipboard_sheet_view_get (void);
54 GnmCellRegion
*gnm_app_clipboard_contents_get (void);
55 GnmRange
const *gnm_app_clipboard_area_get (void);
57 /**********************************************************************
58 * Temporary home for extra actions until we rework this in 1.5
62 typedef void (*GnmActionHandler
) (GnmAction
const *action
, WorkbookControl
*wbc
,
66 char *id
; /* id of the function that will handle this */
67 char *label
; /* untranslated, gettext domain will be passed later */
68 char *icon_name
; /* optionally NULL */
69 /* simplistic for now :
70 * is the action always available (File -> New) or only available
71 * when we are not editing (Cell -> Format)
72 * Later on this needs to be more comprehensive with things like
73 * per-sheetobject flags
75 gboolean always_available
;
77 GnmActionHandler handler
;
79 GDestroyNotify notify
;
89 GType
gnm_action_get_type (void);
90 GnmAction
*gnm_action_new (char const *name
, char const *label
,
91 char const *icon
, gboolean always_available
,
92 GnmActionHandler handler
,
93 gpointer data
, GDestroyNotify notify
);
94 GnmAction
*gnm_action_ref (GnmAction
*action
);
95 void gnm_action_unref (GnmAction
*action
);
97 GType
gnm_app_extra_ui_get_type (void);
98 GnmAppExtraUI
*gnm_app_add_extra_ui (char const *group_name
,
99 GSList
*actions
, const char *layout
,
101 void gnm_app_remove_extra_ui (GnmAppExtraUI
*extra_ui
);
102 void gnm_app_foreach_extra_ui (GFunc func
, gpointer data
);
104 /**********************************************************************/
106 /* internal implementation util */
107 void gnm_app_flag_windows_changed_ (void);
111 #endif /* _GNM_APPLICATION_H_ */