33 #ifndef __KLEO_CRYPTOBACKENDFACTORY_H__
34 #define __KLEO_CRYPTOBACKENDFACTORY_H__
38 #include "cryptobackend.h"
39 #include <tdemacros.h>
45 class BackendConfigWidget;
54 bool operator()(
const char * one,
const char * two )
const {
55 return tqstricmp( one, two ) < 0;
59 class TDE_EXPORT CryptoBackendFactory :
public TQObject {
63 CryptoBackendFactory();
64 ~CryptoBackendFactory();
66 static CryptoBackendFactory * instance();
68 const CryptoBackend::Protocol * smime()
const;
69 const CryptoBackend::Protocol * openpgp()
const;
70 const CryptoBackend::Protocol * protocol(
const char * name )
const;
71 CryptoConfig * config()
const;
73 const CryptoBackend * backend(
unsigned int idx )
const;
75 bool hasBackends()
const;
77 Kleo::BackendConfigWidget * configWidget( TQWidget * parent=0,
const char * name=0 )
const;
79 TDEConfig* configObject()
const;
88 void setSMIMEBackend(
const CryptoBackend* backend );
89 void setOpenPGPBackend(
const CryptoBackend* backend );
90 void setProtocolBackend(
const char * name,
const CryptoBackend * backend );
92 void scanForBackends( TQStringList * reasons=0 );
94 const char * enumerateProtocols(
int i )
const;
96 bool knowsAboutProtocol(
const char * name )
const;
99 std::vector<CryptoBackend*> mBackendList;
100 mutable TDEConfig* mConfigObject;
101 typedef std::map<const char *, const CryptoBackend*, lt_i_str> BackendMap;
102 BackendMap mBackends;
103 typedef std::vector<const char *> ProtocolSet;
104 ProtocolSet mAvailableProtocols;
107 const CryptoBackend * backendByName(
const TQString& name )
const;
109 CryptoBackendFactory(
const CryptoBackendFactory & );
110 void operator=(
const CryptoBackendFactory & );
112 static CryptoBackendFactory * mSelf;