00001 /*************************************************************************** 00002 $RCSfile: statusreport.h,v $ 00003 ------------------- 00004 cvs : $Id: statusreport.h,v 1.4 2003/05/21 12:01:42 cstim Exp $ 00005 begin : Sun May 17 2003 00006 copyright : (C) 2003 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 00031 #ifndef STATUSREPORT_H 00032 #define STATUSREPORT_H 00033 00034 #include <openhbci/dllimport.h> 00035 00036 #ifdef __cplusplus 00037 #include <string> 00038 #include <list> 00039 using namespace std; 00040 #include <openhbci/date.h> 00041 00042 00043 namespace HBCI { 00044 00052 class DLLIMPORT MessageReference { 00053 private: 00054 string _dialogId; 00055 int _msgNumber; 00056 public: 00057 MessageReference(); 00059 MessageReference(const string &did, int msgnum); 00063 MessageReference(const string °); 00065 ~MessageReference(); 00067 const string &dialogId() const { return _dialogId;}; 00069 int messageNumber() const { return _msgNumber;}; 00072 string toString() const; 00074 bool operator==(const MessageReference &ref) const; 00079 int cmp(const MessageReference &other) const; 00080 }; 00081 } /* namespace */ 00082 typedef HBCI::MessageReference HBCI_MessageReference; 00083 extern "C" { 00084 #else /* __cplusplus */ 00085 typedef struct HBCI_MessageReference HBCI_MessageReference; 00086 #endif /* __cplusplus */ 00087 00091 extern HBCI_MessageReference * 00092 HBCI_MessageReference_new(const char *did, int msgnum); 00096 extern HBCI_MessageReference * 00097 HBCI_MessageReference_new_deg(const char *deg); 00099 extern void HBCI_MessageReference_delete(HBCI_MessageReference *h); 00101 extern const char * 00102 HBCI_MessageReference_dialogId(const HBCI_MessageReference *h); 00104 extern int 00105 HBCI_MessageReference_messageNumber(const HBCI_MessageReference *h); 00111 extern char * 00112 HBCI_MessageReference_toString(const HBCI_MessageReference *h); 00114 extern int HBCI_MessageReference_equal(const HBCI_MessageReference *h1, 00115 const HBCI_MessageReference *h2); 00120 extern int HBCI_MessageReference_cmp(const HBCI_MessageReference *h1, 00121 const HBCI_MessageReference *h2); 00124 #ifdef __cplusplus 00125 } /* extern C */ 00126 00127 namespace HBCI { 00128 00134 class DLLIMPORT StatusReport { 00135 private: 00136 Date _date; 00137 Time _time; 00138 MessageReference _msgref; 00139 int _segref; 00140 int _code; 00141 string _ged; 00142 string _text; 00143 00144 public: 00145 StatusReport(); 00146 ~StatusReport(); 00147 00151 const Date &date() const { return _date;}; 00152 void setDate(const Date &d) { _date=d;}; 00153 00155 const Time &time() const { return _time;}; 00156 void setTime(const Time &t) { _time=t;}; 00162 int result() const { return _code;}; 00163 void setResult(int r) { _code=r;}; 00164 00166 const string& resultText() const { return _text;}; 00167 void setResultText(const string &s) { _text=s;}; 00168 00171 string dump() const; 00179 const MessageReference &messageReference() const { return _msgref;}; 00180 void setMessageReference(const MessageReference &r) { _msgref=r;}; 00181 00187 int segment() const { return _segref;}; 00188 void setSegment(int s) { _segref=s;}; 00189 00192 const string& groupReference() const { return _ged;}; 00193 void setGroupReference(const string &s) { _ged=s;}; 00195 }; 00196 00197 } /* namespace */ 00198 typedef HBCI::StatusReport HBCI_StatusReport; 00199 typedef std::list<HBCI::StatusReport> list_HBCI_StatusReport; 00200 extern "C" { 00201 #else /* __cplusplus */ 00202 typedef struct HBCI_StatusReport HBCI_StatusReport; 00203 typedef struct list_HBCI_StatusReport list_HBCI_StatusReport; 00204 #endif /* __cplusplus */ 00205 00209 extern const HBCI_Date *HBCI_StatusReport_date(const HBCI_StatusReport *h); 00210 00212 extern const HBCI_Time *HBCI_StatusReport_time(const HBCI_StatusReport *h); 00213 00215 extern int HBCI_StatusReport_result(const HBCI_StatusReport *h); 00216 00219 extern const char * 00220 HBCI_StatusReport_groupReference(const HBCI_StatusReport *h); 00221 00223 extern const char *HBCI_StatusReport_resultText(const HBCI_StatusReport *h); 00224 00227 extern const HBCI_MessageReference * 00228 HBCI_StatusReport_messageReference(const HBCI_StatusReport *h); 00229 00232 extern int HBCI_StatusReport_segment(const HBCI_StatusReport *h); 00238 extern char *HBCI_StatusReport_dump(const HBCI_StatusReport *h); 00244 extern unsigned int 00245 list_HBCI_StatusReport_size(const list_HBCI_StatusReport *l); 00247 typedef void *(*list_HBCI_StatusReport_cb) (const HBCI_StatusReport* value, 00248 void *user_data); 00260 extern void *list_HBCI_StatusReport_foreach(const list_HBCI_StatusReport *l, 00261 list_HBCI_StatusReport_cb func, 00262 void *user_data); 00265 #ifdef __cplusplus 00266 } /* extern C */ 00267 #endif /* __cplusplus */ 00268 00269 #endif 00270 00271