|
GnuCash 2.4.99
|
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 "gncOwner.h" 00029 #include "gncBillTerm.h" 00030 #include "gncTaxTable.h" 00031 #include "gncInvoice.h" 00032 00033 #define GCONF_SECTION_ORDER "dialogs/business/order" 00034 #define GCONF_SECTION_JOB "dialogs/business/job" 00035 #define GCONF_SECTION_CUSTOMER "dialogs/business/customer" 00036 #define GCONF_SECTION_VENDOR "dialogs/business/vendor" 00037 #define GCONF_SECTION_EMPLOYEE "dialogs/business/employee" 00038 00039 GtkWidget * gnc_owner_select_create (GtkWidget *label, GtkWidget *hbox, 00040 QofBook *book, GncOwner *owner); 00041 00042 GtkWidget * gnc_owner_edit_create (GtkWidget *label, GtkWidget *hbox, 00043 QofBook *book, GncOwner *owner); 00044 00045 void gnc_owner_get_owner (GtkWidget *widget, GncOwner *owner); 00046 void gnc_owner_set_owner (GtkWidget *widget, GncOwner *owner); 00047 00048 00049 /* An invoice select widget.. 00050 * the owner, invoice, and label parameters are optional 00051 */ 00052 GtkWidget * gnc_invoice_select_create (GtkWidget *hbox, QofBook *book, 00053 const GncOwner *owner, 00054 GncInvoice *invoice, 00055 GtkWidget *label); 00056 00057 GncInvoice * gnc_invoice_get_invoice (GtkWidget *widget); 00058 void gnc_invoice_set_invoice (GtkWidget *widget, GncInvoice *invoice); 00059 void gnc_invoice_set_owner (GtkWidget *widget, GncOwner *owner); 00060 00061 /* Fill in a combo box with the appropriate list of accounts 00062 * Returns the default selected account */ 00063 Account * gnc_account_select_combo_fill (GtkWidget *combo, QofBook *book, 00064 GList *acct_types, 00065 GList *acct_commodities); 00066 00067 /* Returns the currently selected account in the combo box*/ 00068 Account * gnc_account_select_combo_get_active (GtkWidget *combo); 00069 00070 /* Create a combo box of available billing terms based on 00071 * the combo box If none_ok is true, then add "none" as a 00072 * choice (with data set to NULL). If inital_choice is non-NULL, 00073 * then that will be the default option setting when the menu is 00074 * created. 00075 * 00076 * Note: if you are interested in the currently active combo box 00077 * item, you can use the function gnc_simple_combo_get_value below. 00078 * This can be used for example in a callback function that triggers 00079 * on the combo box' "changed" signal" 00080 */ 00081 void gnc_billterms_combo (GtkComboBox *cbox, QofBook *book, 00082 gboolean none_ok, GncBillTerm *initial_choice); 00083 00084 /* Same thing except for the tax tables */ 00085 void 00086 gnc_taxtables_combo (GtkComboBox *cbox, QofBook *book, 00087 gboolean none_ok, GncTaxTable *initial_choice); 00088 00089 /* Build an option menu for choosing a GncTaxIncluded */ 00090 void gnc_taxincluded_combo (GtkComboBox *cbox, GncTaxIncluded initial_choice); 00091 00092 00093 /* Here are some "simple combo box" utilities that can be used with 00094 * ANY of the above combo box types. In particular the following 00095 * functions are useful for hooking the above combo boxes into the 00096 * GNC Option infrastructure. 00097 */ 00098 00100 gpointer gnc_simple_combo_get_value (GtkComboBox *cbox); 00101 00104 void gnc_simple_combo_set_value (GtkComboBox *cbox, gpointer data); 00105 00106 00107 #endif /* GNC_BUSINESS_GNOME_UTILS_H_ */
1.7.4