00001
00002
00003
00004
00005
00006
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef OFX_PROC_H
00022 #define OFX_PROC_H
00023 #include "libofx.h"
00024 #include "tree.hh"
00025 using namespace std;
00026
00031 class OfxGenericContainer {
00032 public:
00033 string type;
00034 string tag_identifier;
00035 OfxGenericContainer *parentcontainer;
00036
00037 OfxGenericContainer();
00038 OfxGenericContainer(OfxGenericContainer *para_parentcontainer);
00039 OfxGenericContainer(OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
00040
00041 virtual ~OfxGenericContainer(){};
00042
00049 virtual void add_attribute(const string identifier, const string value);
00055 virtual int gen_event();
00056
00062 virtual int add_to_main_tree();
00063
00065 OfxGenericContainer* getparent();
00066 };
00067
00072 class OfxDummyContainer:public OfxGenericContainer {
00073 public:
00074 OfxDummyContainer(OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
00075 void add_attribute(const string identifier, const string value);
00076 };
00077
00082 class OfxPushUpContainer:public OfxGenericContainer {
00083 public:
00084
00085 OfxPushUpContainer(OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
00086 void add_attribute(const string identifier, const string value);
00087 };
00088
00090 class OfxStatusContainer:public OfxGenericContainer {
00091 public:
00092 OfxStatusData data;
00093
00094 OfxStatusContainer(OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
00095 ~OfxStatusContainer();
00096 void add_attribute(const string identifier, const string value);
00097 };
00098
00103 class OfxBalanceContainer:public OfxGenericContainer {
00104 public:
00105
00106
00107
00108
00109 double amount;
00110 int amount_valid;
00111 time_t date;
00112 int date_valid;
00113
00114 OfxBalanceContainer(OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
00115 ~OfxBalanceContainer();
00116 void add_attribute(const string identifier, const string value);
00117 };
00118
00119
00120
00121
00126 class OfxStatementContainer:public OfxGenericContainer {
00127 public:
00128 OfxStatementData data;
00129
00130 OfxStatementContainer(OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
00131 ~OfxStatementContainer();
00132 void add_attribute(const string identifier, const string value);
00133 virtual int add_to_main_tree();
00134 virtual int gen_event();
00135 void add_account(OfxAccountData * account_data);
00136 void add_balance(OfxBalanceContainer* ptr_balance_container);
00137
00138
00139 };
00140
00141
00142
00143
00148 class OfxAccountContainer:public OfxGenericContainer {
00149 public:
00150 OfxAccountData data;
00151
00152 OfxAccountContainer(OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
00153 ~OfxAccountContainer();
00154 void add_attribute(const string identifier, const string value);
00155 int add_to_main_tree();
00156 virtual int gen_event();
00157 private:
00158 void gen_account_id(void);
00159 char bankid[OFX_BANKID_LENGTH];
00160 char branchid[OFX_BRANCHID_LENGTH];
00161 char acctid[OFX_ACCTID_LENGTH];
00162 char acctkey[OFX_ACCTKEY_LENGTH];
00163 char brokerid[OFX_BROKERID_LENGTH];
00164 };
00165
00166
00167
00168
00171 class OfxSecurityContainer:public OfxGenericContainer {
00172 public:
00173 OfxSecurityData data;
00174
00175 OfxSecurityContainer(OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
00176 ~OfxSecurityContainer();
00177 void add_attribute(const string identifier, const string value);
00178 virtual int gen_event();
00179 virtual int add_to_main_tree();
00180 private:
00181 OfxStatementContainer * parent_statement;
00182 };
00183
00184
00185
00186
00187
00190 class OfxTransactionContainer:public OfxGenericContainer {
00191 public:
00192 OfxTransactionData data;
00193
00194 OfxTransactionContainer(OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
00195 ~OfxTransactionContainer();
00196 virtual void add_attribute(const string identifier, const string value);
00197 void add_account(OfxAccountData * account_data);
00198
00199 virtual int gen_event();
00200 virtual int add_to_main_tree();
00201 private:
00202 OfxStatementContainer * parent_statement;
00203 };
00204
00209 class OfxBankTransactionContainer:public OfxTransactionContainer {
00210 public:
00211 OfxBankTransactionContainer(OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
00212 void add_attribute(const string identifier, const string value);
00213 };
00214
00219 class OfxInvestmentTransactionContainer:public OfxTransactionContainer {
00220 public:
00221 OfxInvestmentTransactionContainer(OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
00222
00223 void add_attribute(const string identifier, const string value);
00224 };
00225
00226
00227
00228
00233 class OfxMainContainer:public OfxGenericContainer {
00234 public:
00235 OfxMainContainer(OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
00236 ~OfxMainContainer();
00237 int add_container(OfxGenericContainer * container);
00238 int add_container(OfxStatementContainer * container);
00239 int add_container(OfxAccountContainer * container);
00240 int add_container(OfxTransactionContainer * container);
00241 int add_container(OfxSecurityContainer * container);
00242 int gen_event();
00243 OfxSecurityData * find_security(string unique_id);
00244 private:
00245 tree<OfxGenericContainer *> security_tree;
00246 tree<OfxGenericContainer *> account_tree;
00247 };
00248
00249
00250 #endif