GnuCash c935c2f+
Loading...
Searching...
No Matches
gnc-ui.h
1/********************************************************************\
2 * gnc-ui.h - High level UI functions for GnuCash *
3 * Copyright (C) 1997 Robin D. Clark *
4 * Copyright (C) 1999, 2000 Rob Browning <rlb@cs.utexas.edu> *
5 * *
6 * This program is free software; you can redistribute it and/or *
7 * modify it under the terms of the GNU General Public License as *
8 * published by the Free Software Foundation; either version 2 of *
9 * the License, or (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License*
17 * along with this program; if not, write to the Free Software *
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
19\********************************************************************/
20
21
31#ifndef GNC_UI_H
32#define GNC_UI_H
33
34#include <glib.h>
35
36#include "Account.h"
37#include "gnc-pricedb.h"
38#include <gtk/gtk.h>
39
40#ifdef __cplusplus
41extern "C" {
42#endif
43
44
46#ifdef G_OS_WIN32
47# define DF_GUIDE "gnucash-guide.chm"
48# define DF_MANUAL "gnucash-manual.chm"
49#elif defined MAC_INTEGRATION
50# define DF_GUIDE "GnuCash Guide"
51# define DF_MANUAL "GnuCash Manual"
52#else
53# define DF_GUIDE "gnucash-guide"
54# define DF_MANUAL "gnucash-manual"
55#endif
56
58#define DL_USAGE_BSNSS "busnss-ar-setup1"
59#define DL_USAGE_INVOICE "busnss-ar-invoices1"
60#define DL_USAGE_VOUCHER "busnss-emply-newvchr"
61#define DL_USAGE_BILL "busnss-ap-bills1"
62#define DL_USAGE_CUSTOMER "busnss-ar-customers1"
63#define DL_USAGE_VENDOR "busnss-ap-vendors1"
64#define DL_USAGE_EMPLOYEE "busnss-emply"
65#define DL_USAGE_JOB "busnss-ar-jobs1"
66#define DL_ACC "acct-create"
67#define DL_ACCEDIT "acct-edit"
68#define DL_COMMODITY "tool-commodity"
69#define DL_FIND_TRANSACTIONS "tool-find"
70#define DL_FIN_CALC "tool-calc"
71#define DL_PRICE_DB "tool-price"
72#define DL_PRICE_EDIT "tool-price-manual"
73#define DL_GLOBPREFS "set-prefs"
74#define DL_PRINTCHECK "print-check"
75#define DL_RECNWIN "acct-reconcile"
76#define DL_SXEDITOR "trans-sched"
77#define DL_SX_SLR "trans-sched-slr"
78#define DL_BOOK_OPTIONS "book-options"
79#define DL_STYLE_SHEET "change-style"
80#define DL_CLOSE_BOOK "tool-close-book"
81#define DL_USAGE_CUSTOMREP "report-saving"
82#define DL_IMPORT_BC "busnss-imp-bills-invoices"
83#define DL_IMPORT_CUST "busnss-imp-customer-vendor"
84
85/* GTK Windows - Common Response Codes */
86
87#define GNC_RESPONSE_NEW 1
88#define GNC_RESPONSE_DELETE 2
89#define GNC_RESPONSE_EDIT 3
90
91/* Dialog windows ***************************************************/
92
93extern gboolean
94gnc_verify_dialog (GtkWindow *parent,
95 gboolean yes_is_default,
96 const char *format, ...) G_GNUC_PRINTF (3, 4);
97
98extern gint
99gnc_ok_cancel_dialog (GtkWindow *parent,
100 gint default_result,
101 const char *format, ...) G_GNUC_PRINTF (3, 4);
102
103extern gboolean
104gnc_action_dialog (GtkWindow *parent,
105 const gchar *action,
106 gboolean action_default,
107 const gchar *format, ...) G_GNUC_PRINTF (4, 5);
108
109extern void
110gnc_warning_dialog (GtkWindow *parent,
111 const char *format, ...) G_GNUC_PRINTF (2, 3);
112
113extern void
114gnc_info_dialog (GtkWindow *parent,
115 const char *format, ...) G_GNUC_PRINTF (2, 3);
116
117extern void
118gnc_error_dialog (GtkWindow *parent,
119 const char *format, ...) G_GNUC_PRINTF (2, 3);
120
121extern gchar *
122gnc_input_dialog (GtkWidget *parent, const gchar *title, const gchar *msg, const gchar *default_input);
123
124extern gchar *
125gnc_input_dialog_with_entry (GtkWidget *parent, const gchar *title, const gchar *msg, const gchar *default_input);
126
127extern void
128gnc_info2_dialog (GtkWidget *parent, const gchar *title, const gchar *msg);
129
130extern void
131gnc_gnome_help (GtkWindow *parent, const char *file_name, const char *target_link);
132
133int gnc_choose_radio_option_dialog (GtkWidget *parent,
134 const char *title,
135 const char *msg,
136 const char *button_name,
137 int default_value,
138 GList *radio_list);
139
140void gnc_tax_info_dialog (GtkWidget *parent, Account *account);
141void gnc_stock_split_dialog (GtkWidget *parent, Account * initial);
142
143typedef enum
144{
145 GNC_PRICE_EDIT,
146 GNC_PRICE_NEW,
147} GNCPriceEditType;
148
149void gnc_price_edit_dialog (GtkWidget *parent, QofSession *session,
150 GNCPrice *price, GNCPriceEditType type);
151GNCPrice* gnc_price_edit_by_guid (GtkWidget * parent, const GncGUID * guid);
152void gnc_prices_dialog (GtkWidget *parent);
153void gnc_commodities_dialog (GtkWidget *parent);
154
155/* Open a dialog asking for username and password. The heading and
156 * either 'initial_*' arguments may be NULL. If the dialog returns
157 * TRUE, the user pressed OK and the entered strings are stored in the
158 * output variables. They should be g_freed when no longer needed. If
159 * the dialog returns FALSE, the user pressed CANCEL and NULL was
160 * stored in username and password. */
161gboolean gnc_get_username_password (GtkWidget *parent,
162 const char *heading,
163 const char *initial_username,
164 const char *initial_password,
165 char **username,
166 char **password);
167
168/* Managing the GUI Windows *****************************************/
169
176GtkWindow *gnc_ui_get_gtk_window (GtkWidget *widget);
177
197GtkWindow *gnc_ui_get_main_window (GtkWidget *widget);
198
199/* Changing the GUI Cursor ******************************************/
200
201void gnc_set_busy_cursor(GtkWidget *w, gboolean update_now);
202void gnc_unset_busy_cursor(GtkWidget *w);
203
204#ifdef __cplusplus
205}
206#endif
207
208
209#endif
Account handling public routines.
a simple price database for gnucash
GtkWindow * gnc_ui_get_gtk_window(GtkWidget *widget)
Get a pointer to the widget's immediate top level GtkWindow.
GtkWindow * gnc_ui_get_main_window(GtkWidget *widget)
Get a pointer to the final GncMainWindow widget is rooted in.
void gnc_gnome_help(GtkWindow *parent, const char *file_name, const char *target_link)
Launch the systems default help browser, gnome's yelp for linux, and open to a given link within a gi...
STRUCTS.
The type used to store guids in C.
Definition guid.h:75