Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

outboxaccjobs.h

Go to the documentation of this file.
00001 /* outboxaccjobs.h
00002 
00003  ***************************************************************************
00004  *                                                                         *
00005  *   This library is free software; you can redistribute it and/or         *
00006  *   modify it under the terms of the GNU Lesser General Public            *
00007  *   License as published by the Free Software Foundation; either          *
00008  *   version 2.1 of the License, or (at your option) any later version.    *
00009  *                                                                         *
00010  *   This library is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00013  *   Lesser General Public License for more details.                       *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU Lesser General Public      *
00016  *   License along with this library; if not, write to the Free Software   *
00017  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston,                 *
00018  *   MA  02111-1307  USA                                                   *
00019  *                                                                         *
00020  ***************************************************************************/
00021 
00022 #ifndef OUTBOXACCJOBS_H
00023 #define OUTBOXACCJOBS_H
00024 
00029 #ifdef __cplusplus
00030 #include <string>
00031 #include <list>
00032 #endif /* __cplusplus */
00033 
00034 #include <openhbci/dllimport.h>
00035 #include <openhbci/pointer.h>
00036 #include <openhbci/customer.h>
00037 #include <openhbci/user.h>
00038 #include <openhbci/bank.h>
00039 #include <openhbci/account.h>
00040 #include <openhbci/outboxjob.h>
00041 
00042 #ifdef __cplusplus
00043 
00044 namespace HBCI {
00045 
00054   class DLLIMPORT OutboxAccountJob: public OutboxJob {
00055   private:
00056   protected:
00057     Pointer<Account> _acc;
00058 
00059     string _makeDescription(const string &dscr) const;
00060   public:
00061     OutboxAccountJob(Pointer<Customer> c,
00062                      Pointer<Account> a);
00063     ~OutboxAccountJob();
00064 
00065     Pointer<Account> account() const { return _acc;};
00066     virtual list<int> resultCodes() const = 0;
00067   };
00068 
00069 } /* namespace HBCI */
00070 #endif /* __cplusplus */
00071 
00072 
00073 
00074 
00075 #ifdef __cplusplus
00076 
00077 namespace HBCI {
00078 
00084   class DLLIMPORT OutboxJobGetBalance: public OutboxAccountJob {
00085   private:
00086     Pointer<Job> _job;
00087 
00088   public:
00089     OutboxJobGetBalance(Pointer<Customer> c,
00090                         Pointer<Account> a);
00091     ~OutboxJobGetBalance();
00092 
00093     bool createHBCIJobs(Pointer<MessageQueue> mbox, int n=0);
00094     bool evaluate();
00095     bool commit(int msgNumber=HBCI_COMMIT_WHOLE_JOB);
00096     string description() const;
00097     JobProgressType type() const { return JOB_GET_BALANCE; };
00098     list<int> resultCodes() const;
00099 
00103     const AccountBalance &getBalance() const;
00104 
00114     static bool isSupported(Pointer<Account> forAccount);
00115 
00116   };
00117 
00118 } /* namespace HBCI */
00120 typedef struct HBCI::OutboxJobGetBalance HBCI_OutboxJobGetBalance;
00121 
00122 extern "C" {
00123 #else /* __cplusplus */
00124   typedef struct HBCI_OutboxJobGetBalance HBCI_OutboxJobGetBalance;
00125 #endif /* __cplusplus */
00126 
00130   extern HBCI_OutboxJobGetBalance *
00131     HBCI_OutboxJobGetBalance_new(const HBCI_Customer *c, HBCI_Account *a);
00133   extern HBCI_OutboxJob *
00134     HBCI_OutboxJobGetBalance_OutboxJob(HBCI_OutboxJobGetBalance *j);
00135   extern const HBCI_AccountBalance *
00136     HBCI_OutboxJobGetBalance_getBalance(const HBCI_OutboxJobGetBalance *j);
00138 #ifdef __cplusplus
00139 }
00140 
00141 namespace HBCI {
00142 
00148   class DLLIMPORT OutboxJobGetTransactions: public OutboxAccountJob {
00149   private:
00150     Pointer<Job> _job;
00151     Date _fromdate;
00152     Date _todate;
00153 
00154   public:
00166     OutboxJobGetTransactions(Pointer<Customer> c,
00167                              Pointer<Account> a,
00168                              Date fromDate,
00169                              Date todate);
00170     ~OutboxJobGetTransactions();
00171 
00172     bool createHBCIJobs(Pointer<MessageQueue> mbox, int n=0);
00173     bool evaluate();
00174     bool stillMessagesToSend(int nextMsg) const;
00175     bool commit(int msgNumber=HBCI_COMMIT_WHOLE_JOB);
00176     string description() const;
00177     JobProgressType type() const { return JOB_GET_TRANS; };
00178     list<int> resultCodes() const;
00179 
00185     const Balance& lastBalance() const;
00186     
00190     const list<Transaction> &transactions() const;
00191 
00201     static bool isSupported(Pointer<Account> forAccount);
00202 
00203   };
00204 
00205 } /* namespace HBCI */
00207 typedef struct HBCI::OutboxJobGetTransactions HBCI_OutboxJobGetTransactions;
00208 
00209 extern "C" {
00210 #else /* __cplusplus */
00211   typedef struct HBCI_OutboxJobGetTransactions HBCI_OutboxJobGetTransactions;
00212 #endif /* __cplusplus */
00213 
00217   extern HBCI_OutboxJobGetTransactions *
00218     HBCI_OutboxJobGetTransactions_new(const HBCI_Customer *c,
00219                                       HBCI_Account *a,
00220                                       const HBCI_Date *fromdate,
00221                                       const HBCI_Date *todate);
00223   extern HBCI_OutboxJob *
00224     HBCI_OutboxJobGetTransactions_OutboxJob(HBCI_OutboxJobGetTransactions *j);
00226   extern const list_HBCI_Transaction *
00227     HBCI_OutboxJobGetTransactions_transactions(const HBCI_OutboxJobGetTransactions *j);
00228   extern const HBCI_Balance *
00229     HBCI_OutboxJobGetTransactions_lastBalance(const HBCI_OutboxJobGetTransactions *j);
00231 #ifdef __cplusplus
00232 }
00233 
00234 namespace HBCI {
00235 
00241   class DLLIMPORT OutboxJobTransfer: public OutboxAccountJob {
00242   private:
00243     Pointer<Job> _job;
00244     Transaction _xaction;
00245 
00246   public:
00247     OutboxJobTransfer(Pointer<Customer> c,
00248                       Pointer<Account> a,
00249                       Transaction xa);
00250     ~OutboxJobTransfer();
00251 
00252     /* retrieve data that is needed to create a transaction for this account */
00253 
00258     static int maxDescriptionLines(const Bank &forBank);
00259 
00265     static list<int> transactionCodes(const Bank &forBank);
00266 
00271     const Transaction &transaction() const { return _xaction;};
00272 
00282     static bool isSupported(Pointer<Account> forAccount);
00283 
00290     static const Limit limit(Pointer<Account> forAccount);
00291 
00292     bool createHBCIJobs(Pointer<MessageQueue> mbox, int n=0);
00293     bool evaluate();
00294     bool commit(int msgNumber=HBCI_COMMIT_WHOLE_JOB);
00295     string description() const;
00296     JobProgressType type() const { return JOB_NEW_TRANSFER; };
00297     list<int> resultCodes() const;
00298 
00304     virtual int segmentForStatusReport() const;
00305   };
00306 
00307 } /* namespace HBCI */
00309 typedef struct HBCI::OutboxJobTransfer HBCI_OutboxJobTransfer;
00310 
00311 extern "C" {
00312 #else /* __cplusplus */
00313   typedef struct HBCI_OutboxJobTransfer HBCI_OutboxJobTransfer;
00314 #endif /* __cplusplus */
00315 
00319   extern HBCI_OutboxJobTransfer *
00320     HBCI_OutboxJobTransfer_new(const HBCI_Customer *c,
00321                                HBCI_Account *a,
00322                                const HBCI_Transaction *trans);
00324   extern HBCI_OutboxJob *
00325     HBCI_OutboxJobTransfer_OutboxJob(HBCI_OutboxJobTransfer *j);
00327 #ifdef __cplusplus
00328 }
00329 
00330 
00331 namespace HBCI {
00332 
00341   class DLLIMPORT OutboxJobDebitNote: public OutboxAccountJob {
00342   private:
00343     Pointer<Job> _job;
00344     Transaction _xaction;
00345 
00346   public:
00347     OutboxJobDebitNote(Pointer<Customer> c,
00348                        Pointer<Account> a,
00349                        Transaction xa);
00350     ~OutboxJobDebitNote();
00351 
00352     bool createHBCIJobs(Pointer<MessageQueue> mbox, int n=0);
00353     bool evaluate();
00354     bool commit(int msgNumber=HBCI_COMMIT_WHOLE_JOB);
00355     string description() const;
00356     JobProgressType type() const { return JOB_DEBIT_NOTE; };
00357     list<int> resultCodes() const;
00358 
00363     const Transaction &transaction() const { return _xaction;};
00364 
00374     static bool isSupported(Pointer<Account> forAccount);
00375 
00382     static const Limit limit(Pointer<Account> forAccount);
00383 
00389     virtual int segmentForStatusReport() const;
00390   };
00391 
00392 } /* namespace HBCI */
00394 typedef struct HBCI::OutboxJobDebitNote HBCI_OutboxJobDebitNote;
00395 
00396 extern "C" {
00397 #else /* __cplusplus */
00398   typedef struct HBCI_OutboxJobDebitNote HBCI_OutboxJobDebitNote;
00399 #endif /* __cplusplus */
00400 
00404   extern HBCI_OutboxJobDebitNote *
00405     HBCI_OutboxJobDebitNote_new(const HBCI_Customer *c,
00406                                 HBCI_Account *a,
00407                                 const HBCI_Transaction *trans);
00409   extern HBCI_OutboxJob *
00410     HBCI_OutboxJobDebitNote_OutboxJob(HBCI_OutboxJobDebitNote *j);
00412 #ifdef __cplusplus
00413 }
00414 #endif /* __cplusplus */
00415 
00416 
00417 
00418 #endif

Generated on Mon Jun 23 13:41:07 2003 for openhbci by doxygen1.2.17