00001 /* 00002 * ============================================================================= 00003 * Name : sipalloweventsheader.h 00004 * Part of : SIP Codec 00005 * Interface : SDK API, SIP Codec API 00006 * Description : 00007 * Version : SIP/4.0 00008 * 00009 * Copyright (c) 2004 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 00022 #ifndef CSIPALLOWEVENTSHEADER_H 00023 #define CSIPALLOWEVENTSHEADER_H 00024 00025 // INCLUDES 00026 #include <badesca.h> 00027 #include "sipheaderbase.h" 00028 #include "_sipcodecdefs.h" 00029 00030 // CLASS DECLARATION 00040 class CSIPAllowEventsHeader : public CSIPHeaderBase 00041 { 00042 public: // Constructors and destructor 00043 00051 IMPORT_C static RPointerArray<CSIPAllowEventsHeader> 00052 DecodeL(const TDesC8& aValue); 00053 00059 IMPORT_C static CSIPAllowEventsHeader* 00060 NewL(const TDesC8& aEventPackage); 00061 00068 IMPORT_C static CSIPAllowEventsHeader* NewLC(const TDesC8& aEventPackage); 00069 00073 IMPORT_C ~CSIPAllowEventsHeader(); 00074 00075 public: // New functions 00076 00081 IMPORT_C const TDesC8& EventPackage() const; 00082 00087 IMPORT_C void SetEventPackageL(const TDesC8& aEventPackage); 00088 00093 IMPORT_C void SetEventTemplatesL(const MDesC8Array& aEventTemplates); 00094 00100 IMPORT_C const MDesC8Array& EventTemplates() const; 00101 00108 IMPORT_C static CSIPHeaderBase* 00109 InternalizeValueL(RReadStream& aReadStream); 00110 00111 00112 public: // From CSIPHeaderBase 00113 00117 IMPORT_C CSIPHeaderBase* CloneL() const; 00118 00122 IMPORT_C RStringF Name() const; 00123 00127 IMPORT_C HBufC8* ToTextValueL() const; 00128 00129 00130 public: // New functions, for internal use 00131 00132 static RPointerArray<CSIPHeaderBase> BaseDecodeL(const TDesC8& aValue); 00133 00134 public: // From CSIPHeaderBase, for internal use 00135 00136 TBool MoreThanOneAllowed() const; 00137 TBool HasCompactName() const; 00138 RStringF CompactName() const; 00139 TPreferredPlace PreferredPlaceInMessage() const; 00140 00141 private: // From CSIPHeaderBase 00142 00143 void ExternalizeValueL(RWriteStream& aWriteStream) const; 00144 00145 private: // Contructors 00146 00147 CSIPAllowEventsHeader(); 00148 void ConstructL(); 00149 void ConstructL(const TDesC8& aEventPackage); 00150 void ConstructL (const CSIPAllowEventsHeader& aSIPAllowEventsHeader); 00151 00152 private: // New functions 00153 00154 void DoInternalizeValueL(RReadStream& aReadStream); 00155 void ParseL(const TDesC8& aValue); 00156 void CheckTemplateL(const TDesC8& aParam) const; 00157 // Needed for cleanup of a RPointerArray<HBufC8>: 00158 static void ResetAndDestroy(TAny* anArray); 00159 00160 private: // Data 00161 00162 HBufC8* iEventPackage; 00163 CDesC8ArraySeg* iEventTemplates; 00164 00165 private: // For testing purposes 00166 00167 UNIT_TEST(CSIPAllowEventsHeaderTest) 00168 }; 00169 00170 // CSIPALLOWEVENTSHEADER_H 00171 #endif 00172 00173 // End of File