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

user.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  $RCSfile: user.h,v $
00003                              -------------------
00004     cvs         : $Id: user.h,v 1.14 2003/04/15 22:10:23 cstim Exp $
00005     begin       : Sun Nov 18 2001
00006     copyright   : (C) 2001 by Martin Preuss
00007     email       : openhbci@aquamaniac.de
00008 
00009  ***************************************************************************
00010  *                                                                         *
00011  *   This library is free software; you can redistribute it and/or         *
00012  *   modify it under the terms of the GNU Lesser General Public            *
00013  *   License as published by the Free Software Foundation; either          *
00014  *   version 2.1 of the License, or (at your option) any later version.    *
00015  *                                                                         *
00016  *   This library is distributed in the hope that it will be useful,       *
00017  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00018  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00019  *   Lesser General Public License for more details.                       *
00020  *                                                                         *
00021  *   You should have received a copy of the GNU Lesser General Public      *
00022  *   License along with this library; if not, write to the Free Software   *
00023  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston,                 *
00024  *   MA  02111-1307  USA                                                   *
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 /* for C wrapper functions */
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 /* __cplusplus */
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 /* __cplusplus */
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 } /* namespace HBCI */
00231 
00232 #endif /* __cplusplus */
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 } /* __cplusplus */
00366 
00367 #endif
00368 
00369 
00370 
00371 #endif
00372 
00373 
00374 
00375 

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