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
00028
00029
00030
00031
00032 #ifndef __KIOSMTP_CAPABILITIES_H__
00033 #define __KIOSMTP_CAPABILITIES_H__
00034
00035 #include <tqmap.h>
00036 #include <tqcstring.h>
00037 #include <tqstring.h>
00038 #include <tqstringlist.h>
00039
00040 class TQStrIList;
00041
00042 namespace KioSMTP {
00043
00044 class Response;
00045
00046 class Capabilities {
00047 public:
00048 Capabilities() {}
00049
00050 static Capabilities fromResponse( const Response & response );
00051
00052 void add( const TQString & cap, bool replace=false );
00053 void add( const TQString & name, const TQStringList & args, bool replace=false );
00054 void clear() { mCapabilities.clear(); }
00055
00056 bool have( const TQString & cap ) const {
00057 return mCapabilities.find( cap.upper() ) != mCapabilities.end();
00058 }
00059 bool have( const TQCString & cap ) const { return have( TQString( cap.data() ) ); }
00060 bool have( const char * cap ) const { return have( TQString::fromLatin1( cap ) ); }
00061
00062 TQString asMetaDataString() const;
00063
00064 TQString authMethodMetaData() const;
00065 TQStrIList saslMethods() const;
00066
00067 TQString createSpecialResponse( bool tls ) const;
00068
00069 TQStringList saslMethodsQSL() const;
00070 private:
00071
00072 TQMap<TQString,TQStringList> mCapabilities;
00073 };
00074
00075 }
00076
00077 #endif // __KIOSMTP_CAPABILITIES_H__