GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
qif-objects-p.h
1 /*
2  * qif-objects-p.h -- Private header: QIF objects for the QIF importer
3  *
4  * Written By: Derek Atkins <[email protected]>
5  * Copyright (c) 2003 Derek Atkins <[email protected]>
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 [email protected]
23  */
24 
25 #ifndef QIF_OBJECTS_P_H
26 #define QIF_OBJECTS_P_H
27 
28 #include "qof.h"
29 
30 #include "qif-import.h"
31 #include "qif-objects.h"
32 
34 {
35  struct _QifObject obj;
36 
37  char * name;
38  char * desc;
39 
40  char * limitstr;
41  gnc_numeric limit;
42 
43  char * budgetstr;
44  gnc_numeric budget;
45 
46  GList * type_list;
47 
48 };
49 
51 {
52  struct _QifObject obj;
53 
54  char * name;
55  char * desc;
56  char * taxclass;
57 
58  gboolean taxable;
59  gboolean expense;
60  gboolean income;
61 
62  char * budgetstr;
63  gnc_numeric budget;
64 
65 };
66 
67 struct _QifClass
68 {
69  struct _QifObject obj;
70 
71  char * name;
72  char * desc;
73  char * taxdesig;
74 
75 };
76 
78 {
79  struct _QifObject obj;
80 
81  char * name;
82  char * symbol;
83  char * type;
84 
85 };
86 
87 struct _QifTxn
88 {
89  struct _QifObject obj;
90 
91  QifType txn_type;
92 
93  char * datestr;
94  Timespec date;
95 
96  char * payee;
97  char * address;
98  char * num;
99 
100  QifRecnFlag cleared;
101 
102  /* Investment info */
103  QifInvstTxn invst_info;
104 
105  /* The default_split is the default (forward) part of the QIF transaction */
106  QifSplit default_split;
107 
108  /* The current_split (if any) defines the current "qif split" we are handling */
109  QifSplit current_split;
110 
111  /* The "from" account */
112  QifAccount from_acct;
113 
114  /* The list of splits for this txn */
115  GList * splits;
116 
117 };
118 
119 struct _QifSplit
120 {
121  char * memo;
122 
123  char * amountstr;
124  gnc_numeric amount;
125  gnc_numeric value;
126 
127  char * catstr;
128 
129  /* parsed category/account info */
130 
131  union
132  {
133  QifObject obj;
134  QifCategory cat;
135  QifAccount acct;
136  } cat;
137  gboolean cat_is_acct;
138  QifClass cat_class;
139 
140 };
141 
143 {
144  QifAction action;
145 
146  gnc_numeric amount;
147  gnc_numeric d_amount;
148  gnc_numeric price;
149  gnc_numeric shares;
150  gnc_numeric commission;
151 
152  char * amountstr;
153  char * d_amountstr;
154  char * pricestr;
155  char * sharesstr;
156  char * commissionstr;
157 
158  char * security;
159  char * catstr;
160 
161  union
162  {
163  QifObject obj;
164  QifCategory cat;
165  QifAccount acct;
166  } far_cat;
167  gboolean far_cat_is_acct;
168 };
169 
170 /* to be run after parsing all the dates and amounts */
171 void qif_txn_setup_splits(QifTxn txn);
172 void qif_invst_txn_setup_splits(QifContext ctx, QifTxn txn);
173 
174 #endif /* QIF_OBJECTS_P_H */
Use a 64-bit unsigned int timespec.
Definition: gnc-date.h:299