00001 /* 00002 * ============================================================================= 00003 * Name : SdpKeyField.h 00004 * Part of : SDP Codec 00005 * Interface : SDK API, SDP Codec API 00006 * Description : 00007 * Version : 1.0 00008 * 00009 * Copyright (c) 2003 Nokia Corporation. 00010 * This material, including documentation and any related 00011 * computer programs, is protected by copyright controlled by 00012 * Nokia Corporation. All rights are reserved. Copying, 00013 * including reproducing, storing, adapting or translating, any 00014 * or all of this material requires the prior written consent of 00015 * Nokia Corporation. This material also contains confidential 00016 * information which may not be disclosed to others without the 00017 * prior written consent of Nokia Corporation. 00018 * ============================================================================= 00019 */ 00020 00021 #ifndef CSDPKEYFIELD_H 00022 #define CSDPKEYFIELD_H 00023 00024 // INCLUDES 00025 #include <e32base.h> 00026 #include <StringPool.h> 00027 #include "_sdpdefs.h" 00028 00029 // FORWARD DECLARATIONS 00030 class RReadStream; 00031 class RWriteStream; 00032 00033 // CLASS DECLARATION 00048 class CSdpKeyField : public CBase 00049 { 00050 public: // Constructors and destructor 00058 IMPORT_C static CSdpKeyField* DecodeL(const TDesC8& aFieldValue); 00059 00069 IMPORT_C static CSdpKeyField* DecodeLC(const TDesC8& aFieldValue); 00070 00080 IMPORT_C static CSdpKeyField* NewL(RStringF aMethod, 00081 const TDesC8& aEncryptionKey); 00082 00093 IMPORT_C static CSdpKeyField* NewLC(RStringF aMethod, 00094 const TDesC8& aEncryptionKey); 00095 00099 IMPORT_C ~CSdpKeyField(); 00100 00101 public: // New functions 00109 IMPORT_C void EncodeL(RWriteStream& aStream) const; 00110 00116 IMPORT_C CSdpKeyField * CloneL() const; 00117 00124 IMPORT_C TBool operator == (const CSdpKeyField& aObj) const; 00125 00131 IMPORT_C RStringF Method() const; 00132 00138 IMPORT_C const TDesC8& EncryptionKey() const; 00139 00148 IMPORT_C void SetL(RStringF aMethod, 00149 const TDesC8& aEncryptionKey); 00150 00151 public: 00157 void ExternalizeL(RWriteStream& aStream) const; 00158 00165 static CSdpKeyField* InternalizeL(RReadStream& aStream); 00166 00167 private: 00168 CSdpKeyField(); 00169 void ConstructL(const TDesC8& aText); 00170 void ConstructL(RStringF aMethod, const TDesC8& aEncryptionKey); 00171 void DoInternalizeL(RReadStream& aStream); 00172 void SetMethodAndKeyL(RStringF aMethod, const TDesC8& aEncryptionKey); 00173 00174 void SetMethodClearAndKeyL(RStringF aMethod, const TDesC8& aEncryptionKey); 00175 void SetMethodBase64AndKeyL(RStringF aMethod, const TDesC8& aText); 00176 void SetMethodUriAndKeyL(RStringF aMethod, const TDesC8& aText); 00177 void SetMethodPromptL(RStringF aMethod, const TDesC8& aText); 00178 RArray<TPtrC8> GetElementsFromLineL( TLex8& aLexer); 00179 00180 private: // Data 00181 RStringF iMethod; 00182 TBool iMethodOpen; 00183 HBufC8* iEncryptionKey; 00184 RStringPool iStringPool; 00185 00186 __DECLARE_TEST; 00187 }; 00188 00189 // CSDPKEYFIELD_H 00190 #endif