1.12.42
[gnumeric.git] / src / dialogs / tool-dialogs.h
blob2b2782b2e3bc5aea2bc988b15c009ba8e49d40db
1 /*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, see <https://www.gnu.org/licenses/>.
15 #ifndef GNUMERIC_TOOL_DIALOGS_H
16 #define GNUMERIC_TOOL_DIALOGS_H
18 #include <gnumeric.h>
19 #include <numbers.h>
20 #include <widgets/gnm-expr-entry.h>
22 typedef struct _scenario_state scenario_state_t;
24 typedef void (*state_destroy_t) (GnmGenericToolState *state);
26 struct _GenericToolState {
27 GtkBuilder *gui;
28 GtkWidget *dialog;
29 GnmExprEntry *input_entry;
30 GnmExprEntry *input_entry_2;
31 GtkWidget *gdao;
32 GtkWidget *ok_button;
33 GtkWidget *cancel_button;
34 GtkWidget *apply_button;
35 GtkWidget *help_button;
36 char const *help_link;
37 Sheet *sheet;
38 SheetView *sv;
39 Workbook *wb;
40 WBCGtk *wbcg;
41 GtkWidget *warning_dialog;
42 GtkWidget *warning;
43 state_destroy_t state_destroy;
44 } ;
46 void tool_load_selection (GnmGenericToolState *state, gboolean allow_multiple);
47 void error_in_entry (GnmGenericToolState *state, GtkWidget *entry, char const *err_str);
48 gboolean dialog_tool_init (GnmGenericToolState *state,
49 WBCGtk *wbcg,
50 Sheet *sheet,
51 char const *help_file,
52 char const *gui_name,
53 char const *dialog_name,
54 char const *error_str,
55 char const *key,
56 GCallback ok_function,
57 GCallback close_function,
58 GCallback sensitivity_cb,
59 GnmExprEntryFlags flags);
61 GtkWidget *tool_setup_update (GnmGenericToolState* state,
62 char const *name,
63 GCallback cb,
64 gpointer closure);
66 #endif