1 /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 #ifndef _GNM_APPLICATION_H_
3 # define _GNM_APPLICATION_H_
6 #include <glib-object.h>
10 #define GNM_APP_TYPE (gnm_app_get_type ())
11 typedef gboolean (*GnmWbIterFunc
) (Workbook
*wb
, gpointer data
);
13 GType
gnm_app_get_type (void);
14 GObject
*gnm_app_get_app (void);
16 gboolean
gnm_app_shutting_down (void);
17 gboolean
gnm_app_initial_open_complete (void);
19 /* List of active workbooks */
20 void gnm_app_workbook_list_add (Workbook
*wb
);
21 void gnm_app_workbook_list_remove (Workbook
*wb
);
22 GList
* gnm_app_workbook_list (void);
23 Workbook
*gnm_app_workbook_get_by_name (char const *name
,
25 Workbook
*gnm_app_workbook_get_by_index (int i
);
27 GSList
*gnm_app_history_get_list (int max_elements
);
28 void gnm_app_history_add (char const *filename
, const char *mimetype
);
30 void gnm_app_sanity_check (void);
32 void gnm_app_recalc (void);
33 void gnm_app_recalc_start (void);
34 void gnm_app_recalc_finish (void);
35 void gnm_app_recalc_clear_caches (void);
38 void *gnm_app_create_opener_filter (GList
*openers
);
40 double gnm_app_display_dpi_get (gboolean horizontal
);
41 double gnm_app_dpi_to_pixels (void);
44 void gnm_app_clipboard_clear (gboolean drop_selection
);
45 void gnm_app_clipboard_invalidate_sheet (Sheet
*sheet
);
46 void gnm_app_clipboard_cut_copy (WorkbookControl
*wbc
, gboolean is_cut
,
47 SheetView
*sv
, GnmRange
const *area
,
48 gboolean animate_range
);
49 void gnm_app_clipboard_cut_copy_obj (WorkbookControl
*wbc
, gboolean is_cut
,
50 SheetView
*sv
, GSList
*objects
);
51 void gnm_app_clipboard_unant (void);
52 gboolean
gnm_app_clipboard_is_empty (void);
53 gboolean
gnm_app_clipboard_is_cut (void);
54 Sheet
*gnm_app_clipboard_sheet_get (void);
55 SheetView
*gnm_app_clipboard_sheet_view_get (void);
56 GnmCellRegion
*gnm_app_clipboard_contents_get (void);
57 GnmRange
const *gnm_app_clipboard_area_get (void);
59 /**********************************************************************
60 * Temporary home for extra actions until we rework this in 1.5
64 typedef void (*GnmActionHandler
) (GnmAction
const *action
, WorkbookControl
*wbc
,
67 char *id
; /* id of the function that will handle this */
68 char *label
; /* untranslated, gettext domain will be passed later */
69 char *icon_name
; /* optionally NULL */
70 /* simplistic for now :
71 * is the action always available (File -> New) or only available
72 * when we are not editing (Cell -> Format)
73 * Later on this needs to be more comprehensive with things like
74 * per-sheetobject flags
76 gboolean always_available
;
78 GnmActionHandler handler
;
88 GType
gnm_action_get_type (void);
89 GnmAction
*gnm_action_new (char const *name
, char const *label
,
90 char const *icon
, gboolean always_available
,
91 GnmActionHandler handler
);
92 void gnm_action_free (GnmAction
*action
);
94 GType
gnm_app_extra_ui_get_type (void);
95 GnmAppExtraUI
*gnm_app_add_extra_ui (char const *group_name
,
96 GSList
*actions
, const char *layout
,
99 void gnm_app_remove_extra_ui (GnmAppExtraUI
*extra_ui
);
100 void gnm_app_foreach_extra_ui (GFunc func
, gpointer data
);
102 /**********************************************************************/
104 /* internal implementation util */
105 void _gnm_app_flag_windows_changed (void);
109 #endif /* _GNM_APPLICATION_H_ */