GnuCash  5.6-150-g038405b370+
business-gnome-utils.h
1 /*
2  * business-gnome-utils.h -- General GUI Utilities for GNC Business Objects
3  *
4  * Written By: Derek Atkins <warlord@MIT.EDU>
5  * Copyright (C) 2001,2006 Derek Atkins
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 2 of
10  * the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, contact:
19  *
20  * Free Software Foundation Voice: +1-617-542-5942
21  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
22  * Boston, MA 02110-1301, USA gnu@gnu.org
23  */
24 
25 #ifndef GNC_BUSINESS_GNOME_UTILS_H_
26 #define GNC_BUSINESS_GNOME_UTILS_H_
27 
28 #include "gncOwner.h"
29 #include "gncBillTerm.h"
30 #include "gncTaxTable.h"
31 #include "gncInvoice.h"
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 
38 #define GNC_PREFS_GROUP_INVOICE "dialogs.business.invoice"
39 #define GNC_PREFS_GROUP_BILL "dialogs.business.bill"
40 #define GNC_PREFS_GROUP_VOUCHER "dialogs.business.voucher"
41 
42 #define GNC_PREF_AUTO_PAY "auto-pay"
43 
49 const char *gnc_get_builtin_default_invoice_print_report (void);
50 
56 const char * gnc_migrate_default_invoice_print_report (void);
57 
63 char *gnc_get_default_invoice_print_report (void);
64 
72 GtkWidget * gnc_default_invoice_report_combo (const char* guid_scm_function);
73 
74 GtkWidget * gnc_owner_select_create (GtkWidget *label, GtkWidget *hbox,
75  QofBook *book, GncOwner *owner);
76 
77 GtkWidget * gnc_owner_edit_create (GtkWidget *label, GtkWidget *hbox,
78  QofBook *book, GncOwner *owner);
79 
80 void gnc_owner_get_owner (GtkWidget *widget, GncOwner *owner);
81 void gnc_owner_set_owner (GtkWidget *widget, const GncOwner *owner);
82 
83 
84 /* An invoice select widget..
85  * the owner, invoice, and label parameters are optional
86  */
87 GtkWidget * gnc_invoice_select_create (GtkWidget *hbox, QofBook *book,
88  const GncOwner *owner,
89  GncInvoice *invoice,
90  GtkWidget *label);
91 
92 GncInvoice * gnc_invoice_get_invoice (GtkWidget *widget);
93 void gnc_invoice_set_invoice (GtkWidget *widget, GncInvoice *invoice);
94 void gnc_invoice_set_owner (GtkWidget *widget, GncOwner *owner);
95 
96 /* Fill in a combo box with the appropriate list of accounts
97  * Returns the default selected account */
98 Account * gnc_account_select_combo_fill (GtkWidget *combo, QofBook *book,
99  GList *acct_types,
100  GList *acct_commodities);
101 
102 /* Returns the currently selected account in the combo box*/
103 Account * gnc_account_select_combo_get_active (GtkWidget *combo);
104 
105 /* Create a combo box of available billing terms based on
106  * the combo box If none_ok is true, then add "none" as a
107  * choice (with data set to NULL). If initial_choice is non-NULL,
108  * then that will be the default option setting when the menu is
109  * created.
110  *
111  * Note: if you are interested in the currently active combo box
112  * item, you can use the function gnc_simple_combo_get_value below.
113  * This can be used for example in a callback function that triggers
114  * on the combo box' "changed" signal"
115  */
116 void gnc_billterms_combo (GtkComboBox *cbox, QofBook *book,
117  gboolean none_ok, GncBillTerm *initial_choice);
118 
119 /* Same thing except for the tax tables */
120 void
121 gnc_taxtables_combo (GtkComboBox *cbox, QofBook *book,
122  gboolean none_ok, GncTaxTable *initial_choice);
123 
124 /* Build an option menu for choosing a GncTaxIncluded */
125 void gnc_taxincluded_combo (GtkComboBox *cbox, GncTaxIncluded initial_choice);
126 
127 
128 /* Here are some "simple combo box" utilities that can be used with
129  * ANY of the above combo box types. In particular the following
130  * functions are useful for hooking the above combo boxes into the
131  * GNC Option infrastructure.
132  */
133 
135 gpointer gnc_simple_combo_get_value (GtkComboBox *cbox);
136 
139 void gnc_simple_combo_set_value (GtkComboBox *cbox, gpointer data);
140 
141 
142 #ifdef __cplusplus
143 }
144 #endif
145 
146 #endif /* GNC_BUSINESS_GNOME_UTILS_H_ */
Business Interface: Object OWNERs.
GncTaxIncluded
How to interpret the TaxIncluded.
Definition: gncTaxTable.h:85
STRUCTS.
Tax Table programming interface.
Business Invoice Interface.
Billing Term interface.
modtime is the internal date of the last modtime See libgnucash/engine/TaxTableBillTermImmutability.txt for an explanation of the following Code that handles refcount, parent, child, invisible and children is identical to that in ::GncBillTerm