GnuCash  5.6-150-g038405b370+
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
41 extern "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 
93 extern gboolean
94 gnc_verify_dialog (GtkWindow *parent,
95  gboolean yes_is_default,
96  const char *format, ...) G_GNUC_PRINTF (3, 4);
97 
98 extern gint
99 gnc_ok_cancel_dialog (GtkWindow *parent,
100  gint default_result,
101  const char *format, ...) G_GNUC_PRINTF (3, 4);
102 
103 extern void
104 gnc_warning_dialog (GtkWindow *parent,
105  const char *format, ...) G_GNUC_PRINTF (2, 3);
106 
107 extern void
108 gnc_info_dialog (GtkWindow *parent,
109  const char *format, ...) G_GNUC_PRINTF (2, 3);
110 
111 extern void
112 gnc_error_dialog (GtkWindow *parent,
113  const char *format, ...) G_GNUC_PRINTF (2, 3);
114 
115 extern gchar *
116 gnc_input_dialog (GtkWidget *parent, const gchar *title, const gchar *msg, const gchar *default_input);
117 
118 extern gchar *
119 gnc_input_dialog_with_entry (GtkWidget *parent, const gchar *title, const gchar *msg, const gchar *default_input);
120 
121 extern void
122 gnc_info2_dialog (GtkWidget *parent, const gchar *title, const gchar *msg);
123 
124 extern void
125 gnc_gnome_help (GtkWindow *parent, const char *file_name, const char *target_link);
126 
127 int gnc_choose_radio_option_dialog (GtkWidget *parent,
128  const char *title,
129  const char *msg,
130  const char *button_name,
131  int default_value,
132  GList *radio_list);
133 
134 void gnc_tax_info_dialog (GtkWidget *parent, Account *account);
135 void gnc_stock_split_dialog (GtkWidget *parent, Account * initial);
136 
137 typedef enum
138 {
139  GNC_PRICE_EDIT,
140  GNC_PRICE_NEW,
141 } GNCPriceEditType;
142 
143 void gnc_price_edit_dialog (GtkWidget *parent, QofSession *session,
144  GNCPrice *price, GNCPriceEditType type);
145 GNCPrice* gnc_price_edit_by_guid (GtkWidget * parent, const GncGUID * guid);
146 void gnc_prices_dialog (GtkWidget *parent);
147 void gnc_commodities_dialog (GtkWidget *parent);
148 
149 /* Open a dialog asking for username and password. The heading and
150  * either 'initial_*' arguments may be NULL. If the dialog returns
151  * TRUE, the user pressed OK and the entered strings are stored in the
152  * output variables. They should be g_freed when no longer needed. If
153  * the dialog returns FALSE, the user pressed CANCEL and NULL was
154  * stored in username and password. */
155 gboolean gnc_get_username_password (GtkWidget *parent,
156  const char *heading,
157  const char *initial_username,
158  const char *initial_password,
159  char **username,
160  char **password);
161 
162 /* Managing the GUI Windows *****************************************/
163 
170 GtkWindow *gnc_ui_get_gtk_window (GtkWidget *widget);
171 
191 GtkWindow *gnc_ui_get_main_window (GtkWidget *widget);
192 
193 /* Changing the GUI Cursor ******************************************/
194 
195 void gnc_set_busy_cursor(GtkWidget *w, gboolean update_now);
196 void gnc_unset_busy_cursor(GtkWidget *w);
197 
198 #ifdef __cplusplus
199 }
200 #endif
201 
202 
203 #endif
GtkWindow * gnc_ui_get_main_window(GtkWidget *widget)
Get a pointer to the final GncMainWindow widget is rooted in.
a simple price database for gnucash
STRUCTS.
GtkWindow * gnc_ui_get_gtk_window(GtkWidget *widget)
Get a pointer to the widget&#39;s immediate top level GtkWindow.
Account handling public routines.
void gnc_gnome_help(GtkWindow *parent, const char *file_name, const char *target_link)
Launch the systems default help browser, gnome&#39;s yelp for linux, and open to a given link within a gi...
The type used to store guids in C.
Definition: guid.h:75