00001 /*************************************************************************** 00002 $RCSfile: mediumplugin.h,v $ 00003 ------------------- 00004 cvs : $Id: mediumplugin.h,v 1.11 2003/05/19 16:09:06 cstim Exp $ 00005 begin : Mon Apr 14 2003 00006 copyright : (C) 2003 by Martin Preuss 00007 email : martin@libchipcard.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 ***************************************************************************/ 00032 #ifndef MEDIUMPLUGIN_H 00033 #define MEDIUMPLUGIN_H 00034 00035 #include <openhbci/plugin.h> 00036 #include <openhbci/medium.h> 00037 00038 #ifdef __cplusplus 00039 #include <openhbci/simpleconfig.h> 00040 #include <string> 00041 using namespace std; 00042 00043 namespace HBCI { 00044 00056 class MediumPlugin: public Plugin { 00057 public: 00059 MediumPlugin(); 00061 virtual ~MediumPlugin(); 00062 00066 virtual PluginType pluginType() const { return PluginTypeMedium;}; 00067 00071 virtual string mediumTypeName() const=0; 00072 00076 virtual MediumType mediumType() const=0; 00077 00084 virtual Pointer<Medium> mediumFactory(const string &name)=0; 00085 00127 virtual Error mediumCheck(string &name) const; 00128 00134 virtual Pointer<Medium> createNewMedium(bool readonly, 00135 int country, 00136 const string &bankId, 00137 const string &userid, 00138 const string &name)=0; 00139 00157 virtual Pointer<Medium> mediumFromConfig(SimpleConfig &cfg, 00158 cfgPtr group)=0; 00159 00165 virtual Error mediumToConfig(Pointer<Medium> m, 00166 SimpleConfig &cfg, 00167 cfgPtr group)=0; 00168 00169 }; 00170 00171 00172 }; 00173 typedef HBCI::MediumPlugin HBCI_MediumPlugin; 00174 extern "C" { 00175 #else /* __cplusplus */ 00176 typedef struct HBCI_MediumPlugin HBCI_MediumPlugin; 00177 #endif /* __cplusplus */ 00178 00183 extern const HBCI_Plugin * 00184 HBCI_MediumPlugin_Plugin(const HBCI_MediumPlugin *m); 00185 00191 extern char * 00192 HBCI_MediumPlugin_mediumTypeName(const HBCI_MediumPlugin *m); 00193 00197 extern MediumType HBCI_MediumPlugin_mediumType(const HBCI_MediumPlugin *m); 00198 00245 extern HBCI_Error *HBCI_MediumPlugin_mediumCheck(const HBCI_MediumPlugin *m, 00246 const char *check_name); 00269 extern HBCI_Error * 00270 HBCI_MediumPlugin_mediumCheck_findname(const HBCI_MediumPlugin *m, 00271 char **find_name); 00273 #ifdef __cplusplus 00274 } 00275 #endif /* __cplusplus */ 00276 00277 #endif 00278