LibOFX
context.hh
00001 
00005 /***************************************************************************
00006  *                                                                         *
00007  *   This program is free software; you can redistribute it and/or modify  *
00008  *   it under the terms of the GNU General Public License as published by  *
00009  *   the Free Software Foundation; either version 2 of the License, or     *
00010  *   (at your option) any later version.                                   *
00011  *                                                                         *
00012  ***************************************************************************/
00013 
00014 #ifndef CONTEXT_H
00015 #define CONTEXT_H
00016 #include <string.h>
00017 #include <time.h>               // for time_t
00018 #include "libofx.h"
00019 #include "ParserEventGeneratorKit.h"
00020 
00021 #include <string>
00022 
00023 
00024 using namespace std;
00025 class LibofxContext
00026 {
00027 private:
00028   LibofxFileFormat _current_file_type;
00029 
00030   LibofxProcStatusCallback _statusCallback;
00031   LibofxProcAccountCallback _accountCallback;
00032   LibofxProcSecurityCallback _securityCallback;
00033   LibofxProcTransactionCallback _transactionCallback;
00034   LibofxProcStatementCallback _statementCallback;
00035 
00036   void * _statementData;
00037   void * _accountData;
00038   void * _transactionData;
00039   void * _securityData;
00040   void * _statusData;
00041 
00042   std::string _dtdDir;
00043 
00044 public:
00045   LibofxContext();
00046   ~LibofxContext();
00047 
00048   LibofxFileFormat currentFileType() const;
00049   void setCurrentFileType(LibofxFileFormat t);
00050 
00051   const std::string &dtdDir() const
00052   {
00053     return _dtdDir;
00054   };
00055   void setDtdDir(const std::string &s)
00056   {
00057     _dtdDir = s;
00058   };
00059 
00060   int statementCallback(const struct OfxStatementData data);
00061   int accountCallback(const struct OfxAccountData data);
00062   int transactionCallback(const struct OfxTransactionData data);
00063   int securityCallback(const struct OfxSecurityData data);
00064   int statusCallback(const struct OfxStatusData data);
00065 
00066   void setStatusCallback(LibofxProcStatusCallback cb, void *user_data);
00067   void setAccountCallback(LibofxProcAccountCallback cb, void *user_data);
00068   void setSecurityCallback(LibofxProcSecurityCallback cb, void *user_data);
00069   void setTransactionCallback(LibofxProcTransactionCallback cb, void *user_data);
00070   void setStatementCallback(LibofxProcStatementCallback cb, void *user_data);
00071 
00072 
00073 };//End class LibofxContext
00074 
00075 
00076 
00077 
00078 #endif