GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
dialog-transfer.h
1 /********************************************************************\
2  * dialog-transfer.h -- transfer dialog for GnuCash *
3  * Copyright (C) 1999 Linas Vepstas *
4  * Copyright (C) 2000 Dave Peticolas *
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, contact: *
18  * *
19  * Free Software Foundation Voice: +1-617-542-5942 *
20  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
21  * Boston, MA 02110-1301, USA [email protected] *
22 \********************************************************************/
23 
24 #ifndef DIALOG_TRANSFER_H
25 #define DIALOG_TRANSFER_H
26 
27 #include "Account.h"
28 
29 typedef struct _xferDialog XferDialog;
30 
37 XferDialog * gnc_xfer_dialog(GtkWidget * parent, Account *initial);
38 
43 gboolean gnc_xfer_dialog_run_until_done( XferDialog * );
44 
45 void gnc_xfer_dialog_close( XferDialog * );
46 
47 /*********** Access routines ***********/
48 void gnc_xfer_dialog_set_title( XferDialog *, const gchar * );
49 
51 void gnc_xfer_dialog_set_information_label( XferDialog *,
52  const gchar * );
53 
57 void gnc_xfer_dialog_add_user_specified_button( XferDialog *xferData,
58  const gchar *label,
59  GCallback callback,
60  gpointer user_data );
61 
62 void gnc_xfer_dialog_toggle_currency_table ( XferDialog *xferData,
63  gboolean show_table );
64 
65 void gnc_xfer_dialog_set_from_account_label( XferDialog *,
66  const gchar * );
67 void gnc_xfer_dialog_set_to_account_label( XferDialog *, const gchar * );
68 
70 void gnc_xfer_dialog_set_from_show_button_active( XferDialog *, gboolean );
71 void gnc_xfer_dialog_set_to_show_button_active( XferDialog *, gboolean );
72 
74 void gnc_xfer_dialog_select_from_account(XferDialog *xferData,
75  Account *account);
77 void gnc_xfer_dialog_select_to_account(XferDialog *xferData,
78  Account *account);
79 
80 void gnc_xfer_dialog_select_from_currency(XferDialog *xferData, gnc_commodity *cur);
81 void gnc_xfer_dialog_select_to_currency(XferDialog *xferData, gnc_commodity *cur);
82 
84 void gnc_xfer_dialog_lock_from_account_tree(XferDialog *xferData );
86 void gnc_xfer_dialog_lock_to_account_tree(XferDialog *xferData );
88 void gnc_xfer_dialog_hide_from_account_tree(XferDialog *xferData );
90 void gnc_xfer_dialog_hide_to_account_tree(XferDialog *xferData );
91 
92 
100 void gnc_xfer_dialog_set_amount(XferDialog *xferData, gnc_numeric amount);
101 
103 void gnc_xfer_dialog_set_amount_sensitive(XferDialog *xferData, gboolean is_sensitive);
104 
112 void gnc_xfer_dialog_set_description(XferDialog *xferData,
113  const char *description);
114 
121 void gnc_xfer_dialog_set_memo(XferDialog *xferData, const char *memo);
122 
130 void gnc_xfer_dialog_set_num(XferDialog *xferData, const char *num);
131 
139 void gnc_xfer_dialog_set_date(XferDialog *xferData, time64 set_time);
140 
142 void gnc_xfer_dialog_set_date_sensitive(XferDialog *xferData, gboolean is_sensitive);
143 
145 void gnc_xfer_dialog_set_exchange_rate(XferDialog *xferData,
146  gnc_numeric exchange_rate);
147 
151 void gnc_xfer_dialog_quickfill_to_account(XferDialog *xferData,
152  gboolean qf_to_account );
153 
170 void gnc_xfer_dialog_is_exchange_dialog(XferDialog *xferData,
171  gnc_numeric * exch_rate);
172 
173 
180 typedef void (*gnc_xfer_dialog_cb)(Transaction *new_trans,
181  gpointer user_data);
182 
202 void gnc_xfer_dialog_set_txn_cb(XferDialog *xferData,
203  gnc_xfer_dialog_cb handler,
204  gpointer user_data);
205 
206 /* Uses the XferDialog to obtain from the user an explicit exchange
207  rate. This exchange rate will then be uses to converting 'amount',
208  which is given in the commodity of the register Account, reg_acc,
209  into a split value for a split whose Account is the commodity
210  specified by xfer_com.
211 
212  The 'exch_rate' argument is used to set the initial value of the
213  rate. If the dialog completes sucessfully 'FALSE' is returned and
214  'exch_rate' is also used to store the converted value. Otherwise,
215  TRUE is returned and the 'exch_rate' argument is undefined.
216 */
217 gboolean gnc_xfer_dialog_run_exchange_dialog(
218  XferDialog *xfer, gnc_numeric *exch_rate, gnc_numeric amount,
219  Account *reg_acc, Transaction *txn, gnc_commodity *xfer_com,
220  gboolean expanded);
221 
222 #endif
Account handling public routines.
gint64 time64
Definition: gnc-date.h:83