business-gnome-utils.h

00001 /*
00002  * business-gnome-utils.h -- General GUI Utilities for GNC Business Objects
00003  *
00004  * Written By: Derek Atkins <warlord@MIT.EDU>
00005  * Copyright (C) 2001,2006 Derek Atkins
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License as
00009  * published by the Free Software Foundation; either version 2 of
00010  * the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, contact:
00019  *
00020  * Free Software Foundation           Voice:  +1-617-542-5942
00021  * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652
00022  * Boston, MA  02110-1301,  USA       gnu@gnu.org
00023  */
00024 
00025 #ifndef GNC_BUSINESS_GNOME_UTILS_H_
00026 #define GNC_BUSINESS_GNOME_UTILS_H_
00027 
00028 #include "gnc-book.h"
00029 #include "gncOwner.h"
00030 #include "gncBillTerm.h"
00031 #include "gncTaxTable.h"
00032 #include "gncInvoice.h"
00033 
00034 #define GCONF_SECTION_ORDER    "dialogs/business/order"
00035 #define GCONF_SECTION_JOB      "dialogs/business/job"
00036 #define GCONF_SECTION_CUSTOMER "dialogs/business/customer"
00037 #define GCONF_SECTION_VENDOR   "dialogs/business/vendor"
00038 #define GCONF_SECTION_EMPLOYEE "dialogs/business/employee"
00039 
00040 GtkWidget * gnc_owner_select_create (GtkWidget *label, GtkWidget *hbox,
00041                                      GNCBook *book, GncOwner *owner);
00042 
00043 GtkWidget * gnc_owner_edit_create (GtkWidget *label, GtkWidget *hbox,
00044                                    GNCBook *book, GncOwner *owner);
00045 
00046 void gnc_owner_get_owner (GtkWidget *widget, GncOwner *owner);
00047 void gnc_owner_set_owner (GtkWidget *widget, GncOwner *owner);
00048 
00049 
00050 /* An invoice select widget.. 
00051  * the owner, invoice, and label parameters are optional
00052  */
00053 GtkWidget * gnc_invoice_select_create (GtkWidget *hbox, GNCBook *book,
00054                                        const GncOwner *owner,
00055                                        GncInvoice *invoice,
00056                                        GtkWidget *label);
00057 
00058 GncInvoice * gnc_invoice_get_invoice (GtkWidget *widget);
00059 void gnc_invoice_set_invoice (GtkWidget *widget, GncInvoice *invoice);
00060 void gnc_invoice_set_owner (GtkWidget *widget, GncOwner *owner);
00061 
00062 /* Return a list of account-types based on the owner type */
00063 GList * gnc_business_account_types (GncOwner *owner);
00064 
00065 /* Fill in a combo box with the appropriate list of accounts */
00066 void gnc_fill_account_select_combo (GtkWidget *combo, GNCBook *book,
00067                                     GList *acct_types);
00068 
00069 
00070 /* Create an optionmenu of available billing terms and attach it to
00071  * the menu passed in.  If none_ok is true, then add "none" as a
00072  * choice (with data set to NULL).  Any time the menu changes,
00073  * 'choice' will be set to the chosen option.  If *choice is non-NULL,
00074  * then that will be the default option setting when the menu is
00075  * created.
00076  */
00077 void gnc_ui_billterms_optionmenu (GtkWidget *omenu, GNCBook *book,
00078                                   gboolean none_ok, GncBillTerm **choice);
00079 
00080 /* Same thing except for the tax tables */
00081 void
00082 gnc_ui_taxtables_optionmenu (GtkWidget *omenu, GNCBook *book,
00083                              gboolean none_ok, GncTaxTable **choice);
00084 
00085 /* Build an option menu for choosing a GncTaxIncluded */
00086 void gnc_ui_taxincluded_optionmenu (GtkWidget *omenu, GncTaxIncluded *choice);
00087 
00088 
00089 /* Here are some "generic option menu" utilities that can be used with
00090  * ANY of the above option-menu types.  In particular the following
00091  * functions are useful for hooking the above option menus into the
00092  * GNC Option infrastructure.
00093  */
00094 
00095 void gnc_ui_optionmenu_set_changed_callback (GtkWidget *omenu,
00096                                              void (*changed_cb)(GtkWidget*,gpointer),
00097                                              gpointer cb_arg);
00098 gpointer gnc_ui_optionmenu_get_value (GtkWidget *omenu);
00099 void gnc_ui_optionmenu_set_value (GtkWidget *omenu, gpointer data);
00100 
00101 
00102 #endif /* GNC_BUSINESS_GNOME_UTILS_H_ */

Generated on Thu Aug 28 05:05:22 2008 for GnuCash by  doxygen 1.5.2