GnuCash 2.4.99
gnc-ui.h
00001 /********************************************************************\
00002  * gnc-ui.h - High level UI functions for GnuCash                   *
00003  * Copyright (C) 1997 Robin D. Clark                                *
00004  * Copyright (C) 1999, 2000 Rob Browning <rlb@cs.utexas.edu>        *
00005  *                                                                  *
00006  * This program is free software; you can redistribute it and/or    *
00007  * modify it under the terms of the GNU General Public License as   *
00008  * published by the Free Software Foundation; either version 2 of   *
00009  * the License, or (at your option) any later version.              *
00010  *                                                                  *
00011  * This program is distributed in the hope that it will be useful,  *
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
00014  * GNU General Public License for more details.                     *
00015  *                                                                  *
00016  * You should have received a copy of the GNU General Public License*
00017  * along with this program; if not, write to the Free Software      *
00018  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.        *
00019 \********************************************************************/
00020 
00021 
00031 #ifndef GNC_UI_H
00032 #define GNC_UI_H
00033 
00034 #include <glib.h>
00035 
00036 #include "Account.h"
00037 #include "gnc-pricedb.h"
00038 #include <gtk/gtk.h>
00039 
00040 
00042 #ifdef G_OS_WIN32
00043 #    define HF_GUIDE         "gnucash-guide.chm"
00044 #    define HF_HELP          "gnucash-help.chm"
00045 #elif defined MAC_INTEGRATION
00046 #    define HF_GUIDE         "Gnucash Guide"
00047 #    define HF_HELP          "Gnucash Help"
00048 #else
00049 #    define HF_GUIDE         "gnucash-guide.xml"
00050 #    define HF_HELP          "gnucash-help.xml"
00051 #endif
00052 
00054 #define HL_USAGE             "usage"
00055 #define HL_ACC               "acct-create"
00056 #define HL_ACCEDIT           "acct-edit"
00057 #define HL_COMMODITY         "tool-commodity"
00058 #define HL_FIND_TRANSACTIONS "tool-find"
00059 #define HL_GLOBPREFS         "set-prefs"
00060 #define HL_PRINTCHECK        "print-check"
00061 #define HL_RECNWIN           "acct-reconcile"
00062 #define HL_SXEDITOR          "tool-sched"
00063 #define HL_GCONF             "gconf"
00064 
00065 /* GTK Windows - Common Response Codes */
00066 
00067 #define GNC_RESPONSE_NEW    1
00068 #define GNC_RESPONSE_DELETE 2
00069 #define GNC_RESPONSE_EDIT   3
00070 
00071 /* Dialog windows ***************************************************/
00072 
00073 extern gboolean
00074 gnc_verify_dialog(GtkWidget *parent,
00075                   gboolean yes_is_default,
00076                   const char *format, ...) G_GNUC_PRINTF (3, 4);
00077 
00078 extern gint
00079 gnc_ok_cancel_dialog(GtkWidget *parent,
00080                      gint default_result,
00081                      const char *format, ...) G_GNUC_PRINTF (3, 4);
00082 
00083 extern void
00084 gnc_warning_dialog(GtkWidget *parent,
00085                    const char *format, ...) G_GNUC_PRINTF (2, 3);
00086 
00087 extern void
00088 gnc_info_dialog(GtkWidget *parent,
00089                 const char *format, ...) G_GNUC_PRINTF (2, 3);
00090 
00091 extern void
00092 gnc_error_dialog(GtkWidget *parent,
00093                  const char *format, ...) G_GNUC_PRINTF (2, 3);
00094 
00095 
00096 extern void
00097 gnc_gnome_help (const char *file_name, const char *target_link);
00098 
00099 int      gnc_choose_radio_option_dialog (GtkWidget *parent,
00100         const char *title,
00101         const char *msg,
00102         const char *button_name,
00103         int default_value,
00104         GList *radio_list);
00105 
00106 void     gnc_tax_info_dialog (GtkWidget *parent);
00107 void     gnc_stock_split_dialog (GtkWidget *parent, Account * initial);
00108 
00109 typedef enum
00110 {
00111     GNC_PRICE_EDIT,
00112     GNC_PRICE_NEW,
00113 } GNCPriceEditType;
00114 
00115 void gnc_price_edit_dialog (GtkWidget *parent, QofSession *session,
00116                             GNCPrice *price, GNCPriceEditType type);
00117 GNCPrice* gnc_price_edit_by_guid (GtkWidget * parent, const GncGUID * guid);
00118 void     gnc_prices_dialog (GtkWidget *parent);
00119 void     gnc_commodities_dialog (GtkWidget *parent);
00120 
00121 /* Open a dialog asking for username and password. The heading and
00122  * either 'initial_*' arguments may be NULL. If the dialog returns
00123  * TRUE, the user pressed OK and the entered strings are stored in the
00124  * output variables. They should be g_freed when no longer needed. If
00125  * the dialog returns FALSE, the user pressed CANCEL and NULL was
00126  * stored in username and password. */
00127 gboolean gnc_get_username_password (GtkWidget *parent,
00128                                     const char *heading,
00129                                     const char *initial_username,
00130                                     const char *initial_password,
00131                                     char **username,
00132                                     char **password);
00133 
00134 /* Managing the GUI Windows *****************************************/
00135 
00136 GtkWidget *gnc_ui_get_toplevel (void);
00137 
00138 /* Changing the GUI Cursor ******************************************/
00139 
00140 void gnc_set_busy_cursor(GtkWidget *w, gboolean update_now);
00141 void gnc_unset_busy_cursor(GtkWidget *w);
00142 
00143 
00144 #endif
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines