GnuCash  5.6-150-g038405b370+
SX-ttinfo.h
1 /********************************************************************\
2  * SX-ttinfo.h -- Template Transaction manipulation functions *
3  * for scheduled transactions *
4  * Copyright (C) 2001 Robert Merkel <rgmerk@mira.net> *
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 gnu@gnu.org *
22  * *
23 \********************************************************************/
24 
25 #ifndef GNC_SX_TTINFO_H
26 #define GNC_SX_TTINFO_H
27 
28 #include <glib.h>
29 #include "qof.h"
30 #include "SchedXaction.h"
31 #include "Account.h"
32 #include "gnc-commodity.h"
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 typedef struct TTInfo_s TTInfo;
39 typedef struct TTSplitInfo_s TTSplitInfo;
40 
41 TTInfo *gnc_ttinfo_malloc(void);
42 
43 void gnc_ttinfo_free(TTInfo *info);
44 
45 /* these two deep-copy their arguments */
46 void gnc_ttinfo_set_description(TTInfo *tti, const char *description);
47 void gnc_ttinfo_set_num(TTInfo *tti, const char *num);
48 void gnc_ttinfo_set_notes (TTInfo *tti, const char *notes);
49 
50 /* this one points to a persistent pointer so ownership isn't relevant */
51 void gnc_ttinfo_set_currency(TTInfo *tti, gnc_commodity *common_currency);
52 
53 
54 /* no deep copy occurs - if you want a deep copy make one yourself ! */
55 void gnc_ttinfo_set_template_splits(TTInfo *tti, GList *splits);
56 
57 const char * gnc_ttinfo_get_description(TTInfo *tti);
58 const char * gnc_ttinfo_get_num(TTInfo *tti);
59 const char *gnc_ttinfo_get_notes (TTInfo *tti);
60 gnc_commodity * gnc_ttinfo_get_currency(TTInfo *tti);
61 GList * gnc_ttinfo_get_template_splits(TTInfo *tti);
62 
63 /* split_i IS NOT deep copied and becomes owned by TTI */
64 void gnc_ttinfo_append_template_split(TTInfo *tti, TTSplitInfo *split_i);
65 
66 TTSplitInfo * gnc_ttsplitinfo_malloc(void);
67 void gnc_ttsplitinfo_free(TTSplitInfo *split_i);
68 
69 void gnc_ttsplitinfo_set_action(TTSplitInfo *split_i, const char *action);
70 const char * gnc_ttsplitinfo_get_action(TTSplitInfo *split_i);
71 
72 void gnc_ttsplitinfo_set_memo(TTSplitInfo *split_i, const char *memo);
73 const char *gnc_ttsplitinfo_get_memo(TTSplitInfo *split_i);
74 
75 void gnc_ttsplitinfo_set_credit_formula(TTSplitInfo *split_i,
76  const char *credit_formula);
77 
78 void gnc_ttsplitinfo_set_credit_formula_numeric(TTSplitInfo *split_i,
79  gnc_numeric credit_formula);
80 
81 const char *gnc_ttsplitinfo_get_credit_formula(TTSplitInfo *split_i);
82 
83 void gnc_ttsplitinfo_set_debit_formula(TTSplitInfo *split_i,
84  const char *debit_formula);
85 
86 void gnc_ttsplitinfo_set_debit_formula_numeric(TTSplitInfo *split_i,
87  gnc_numeric debit_formula);
88 
89 const char *gnc_ttsplitinfo_get_debit_formula(TTSplitInfo *split_i);
90 
91 void gnc_ttsplitinfo_set_account(TTSplitInfo *split_i, Account *acc);
92 Account *gnc_ttsplitinfo_get_account(TTSplitInfo *split_i);
93 
94 #ifdef __cplusplus
95 }
96 #endif
97 
98 #endif
STRUCTS.
Account handling public routines.
Scheduled Transactions public handling routines.
Commodity handling public routines.