00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00033 #ifndef HBCIUSER_H
00034 #define HBCIUSER_H
00035
00036 #ifdef __cplusplus
00037 namespace HBCI {
00038 class User;
00039 };
00040 #include <string>
00041 #include <list>
00042 using namespace std;
00043 #include <openhbci/pointer.h>
00044
00047 typedef struct HBCI::User HBCI_User;
00049 typedef list<HBCI::Pointer<HBCI::User> > list_HBCI_User;
00051 typedef list<HBCI::Pointer<HBCI::User> >::const_iterator list_HBCI_User_iter;
00052 #else
00053 typedef struct HBCI_User HBCI_User;
00054 typedef struct list_HBCI_User list_HBCI_User;
00055 typedef struct list_HBCI_User_iter list_HBCI_User_iter;
00056 #endif
00057
00058 #include <openhbci/medium.h>
00059 #include <openhbci/customer.h>
00060 #include <openhbci/bank.h>
00061
00062
00063 #ifdef __cplusplus
00064
00065 namespace HBCI {
00066
00080 class DLLIMPORT User {
00081 private:
00082 Pointer<Bank> _bank;
00083 Pointer<Medium> _medium;
00084 string _userId;
00085 int _version;
00086 list<Pointer<Customer> > _customers;
00087 string _userName;
00088 bool _knowsSupportedUPDJobs;
00089
00090 public:
00105 User(Pointer<Bank> b,
00106 Pointer<Medium> m,
00107 const string &uid,
00108 int version,
00109 const string &userName,
00110 bool knowsSupportedUPDJobs);
00111
00115 User(const User &cu);
00116
00118 ~User();
00119
00127 Pointer<Bank> bank() const { return _bank;};
00128
00135 Pointer<Medium> medium() const { return _medium;};
00136
00142 const list<Pointer<Customer> > &customers() const;
00143
00151 Pointer<Customer> findCustomer(const string &i) const;
00152
00159 void addCustomer(Pointer<Customer> cust);
00171 const string& userId() const { return _userId;};
00185 int version() const { return _version;};
00192 void setVersion(int v) { _version=v;};
00193
00200 const string &userName() const { return _userName; };
00209 void setUserName(const string &n) { _userName = n; };
00210
00221 bool knowsSupportedJobs() { return _knowsSupportedUPDJobs; };
00225 void setKnowsSupportedJobs(bool knowsIt)
00226 { _knowsSupportedUPDJobs = knowsIt; };
00228 };
00229
00230 }
00231
00232 #endif
00233
00234 #ifdef __cplusplus
00235 extern "C" {
00236 #endif
00237
00240
00252 extern const char* HBCI_User_userId(const HBCI_User *h);
00261 extern const char* HBCI_User_userName(const HBCI_User *h);
00271 extern void HBCI_User_setUserName(HBCI_User *h, const char *n);
00285 extern const HBCI_Medium* HBCI_User_medium(const HBCI_User *h);
00290 extern const HBCI_Bank* HBCI_User_bank(const HBCI_User *h);
00298 extern const list_HBCI_Customer *HBCI_User_customers(const HBCI_User *h);
00307 extern const HBCI_Customer *HBCI_User_findCustomer(const HBCI_User *h,
00308 const char *custId);
00320 extern HBCI_Error *HBCI_User_addCustomer(HBCI_User *h,
00321 HBCI_Customer *cust,
00322 int autoDelete);
00334 extern void list_HBCI_User_delete(list_HBCI_User *l);
00335 extern void list_HBCI_User_iter_delete(list_HBCI_User_iter *l);
00336 extern int list_HBCI_User_size(const list_HBCI_User *l);
00337 extern list_HBCI_User_iter* list_HBCI_User_begin(const list_HBCI_User *l);
00338 extern list_HBCI_User_iter* list_HBCI_User_end(const list_HBCI_User *l);
00339 extern const HBCI_User*
00340 list_HBCI_User_iter_get(const list_HBCI_User_iter *l);
00341 extern void list_HBCI_User_iter_next(list_HBCI_User_iter *l);
00342 extern int list_HBCI_User_iter_equal(const list_HBCI_User_iter *l1,
00343 const list_HBCI_User_iter *l2);
00345 typedef void *(*list_HBCI_User_cb) (const HBCI_User *user,
00346 void *user_data);
00358 extern void *list_HBCI_User_foreach (const list_HBCI_User *list,
00359 list_HBCI_User_cb func,
00360 void *user_data);
00363
00364 #ifdef __cplusplus
00365 }
00366
00367 #endif
00368
00369
00370
00371 #endif
00372
00373
00374
00375