00001 /* 00002 * ============================================================================== 00003 * Name : SenXmlServiceDescription.h 00004 * Part of : Web Services Description 00005 * Interface : 00006 * Description : Class implements the most common value object used in WSF, 00007 * which is used to describe some invocable service. 00008 * Version : 00009 * 00010 * Copyright © 2002-2005 Nokia. All rights reserved. 00011 * This material, including documentation and any related 00012 * computer programs, is protected by copyright controlled by 00013 * Nokia. All rights are reserved. Copying, including 00014 * reproducing, storing, adapting or translating, any 00015 * or all of this material requires the prior written consent of 00016 * Nokia. This material also contains confidential 00017 * information which may not be disclosed to others without the 00018 * prior written consent of Nokia. 00019 * ============================================================================== 00020 */ 00021 00022 #ifndef SEN_XML_SERVICE_DESCRIPTION_H 00023 #define SEN_XML_SERVICE_DESCRIPTION_H 00024 00025 // INCLUDES 00026 #include <e32base.h> 00027 #include <e32des8.h> 00028 #include <e32std.h> 00029 #include <MSenServiceDescription.h> 00030 #include <MSenProviderPolicy.h> 00031 #include <SenDomFragment.h> 00032 00033 // CONSTANTS 00034 const TInt KStateParsingCredentials = 12; 00035 const TInt KStateParsingSingleCredential = 122; 00036 const TInt KStateParsingProviderPolicy = 1222; 00037 00038 // FORWARD DECLARATIONS 00039 class CSenCredential; 00040 class CSenProviderPolicy; 00041 00042 // DATA TYPES 00043 typedef RPointerArray<CSenCredential> RCredentialList; 00044 00045 // CLASS DECLARATION 00046 00065 class CSenXmlServiceDescription : public CSenDomFragment, 00066 public MSenServiceDescription, 00067 public MSenProviderPolicy 00068 { 00069 public: // Constructors and destructor 00070 00075 IMPORT_C static CSenXmlServiceDescription* NewL(); 00076 00082 IMPORT_C static CSenXmlServiceDescription* NewLC(); 00083 00089 IMPORT_C static CSenXmlServiceDescription* NewL(const TDesC8& aNamespaceURI); 00090 00097 IMPORT_C static CSenXmlServiceDescription* NewLC(const TDesC8& aNamespaceURI); 00098 00110 IMPORT_C static CSenXmlServiceDescription* NewL(const TDesC8& aEndPoint, 00111 const TDesC8& aContract); 00112 00125 IMPORT_C static CSenXmlServiceDescription* NewLC(const TDesC8& aEndPoint, 00126 const TDesC8& aContract); 00127 00131 IMPORT_C virtual ~CSenXmlServiceDescription(); 00132 00133 // New functions 00134 00147 IMPORT_C void SetFrameworkIdL(const TDesC8& aFrameworkID); 00148 00156 IMPORT_C virtual const TDesC8& NewElementName(); 00157 00164 IMPORT_C RCredentialList& Credentials(); 00165 00166 // Functions from base classes 00167 00168 // From MSenProviderPolicy 00169 IMPORT_C virtual void SetIapIdL(TUint32 aIapId); 00170 IMPORT_C virtual TInt IapId(TUint32& aCurrentIapId); 00171 IMPORT_C virtual void SetIdentityProviderIdsL( 00172 CSenIdentityProviderIdArray8& aList); 00173 00174 IMPORT_C virtual TInt AddIdentityProviderIdL(TDesC8& aProviderId); 00175 IMPORT_C virtual TInt RebuildFrom(MSenProviderPolicy& aTemplate); 00176 IMPORT_C virtual const CSenIdentityProviderIdArray8& 00177 IdentityProviderIds8L(); 00178 00179 IMPORT_C virtual TBool Accepts(MSenProviderPolicy& aPolicyPattern); 00180 00181 // From MSenServiceDescription 00182 IMPORT_C TDescriptionClassType DescriptionClassType(); 00183 IMPORT_C TBool Matches(MSenServiceDescription& aPattern); 00184 IMPORT_C TPtrC8 Contract(); 00185 IMPORT_C virtual TInt HasFacetL(const TDesC8& aURI, TBool& aHasFacet); 00186 IMPORT_C virtual TInt FacetValue(TDesC8& aURI, HBufC8*& aValueTo); 00187 IMPORT_C virtual TInt AddFacetL(const CSenFacet& aFacet); 00188 IMPORT_C virtual TInt SetFacetL(const CSenFacet& aFacet); 00189 IMPORT_C virtual TInt RemoveFacet(const TDesC8& aURI); 00190 IMPORT_C virtual TInt FacetsL(RFacetArray& aFacetArray); 00191 IMPORT_C virtual TInt ScoreMatchL(MSenServiceDescription& aPattern); 00192 IMPORT_C TPtrC8 Endpoint(); 00193 IMPORT_C TPtrC8 FrameworkId(); 00194 IMPORT_C TPtrC8 FrameworkVersion(); 00195 IMPORT_C void SetContractL(const TDesC8& aContract); 00196 IMPORT_C void SetEndPointL(const TDesC8& aEndPoint); 00197 00198 // From CSenBaseFragment 00199 00206 IMPORT_C virtual HBufC8* AsXmlL(); 00207 00214 IMPORT_C virtual HBufC* AsXmlUnicodeL(); 00215 00221 IMPORT_C virtual void WriteAsXMLToL(RWriteStream& aWriteStream); 00222 00223 00224 // From CSenDomFragment 00225 00234 IMPORT_C void SetAttributesL(const RAttributeArray& aAttributes); 00235 00248 IMPORT_C void ResumeParsingFromL(const TDesC8& aNsUri, 00249 const TDesC8& aLocalName, 00250 const TDesC8& aQName); 00251 00252 protected: // New functions 00253 00258 IMPORT_C CSenXmlServiceDescription(TDescriptionClassType aType); 00259 00263 IMPORT_C void ConstructL(); 00264 00271 IMPORT_C void ConstructL(const TDesC8& aNamespaceURI); 00272 00284 IMPORT_C void ConstructL(const TDesC8& aEndPoint, const TDesC8& aContract); 00285 00286 // Functions from base classes 00287 00288 // From CSenDomFragment 00289 00298 IMPORT_C virtual void StartElementL(const TDesC8& aNsUri, 00299 const TDesC8& aLocalName, 00300 const TDesC8& aQName, 00301 const RAttributeArray& aAttributes); 00302 00303 // From CSenBaseFragment 00311 IMPORT_C virtual void EndElementL(const TDesC8& aNsUri, 00312 const TDesC8& aLocalName, 00313 const TDesC8& aQName); 00314 00315 private: 00316 TInt FacetValueL(TDesC8& aURI, HBufC8*& aValueTo); 00317 TInt RemoveFacetL(const TDesC8& aURI); 00318 00319 protected: // Data 00320 // the type of this class instance 00321 const TDescriptionClassType iType; 00322 00323 private: // Data 00324 HBufC8* iFrameworkId; 00325 CSenCredential* iCredential; 00326 RCredentialList iCredentialList; 00327 00328 // Timestamp indicating validity of credentials. Using SenDateUtils 00329 // FromXmlDateTimeL and ToXmlDateTimeUtf8L is recommended for conversions. 00330 TTime iNotOnOrAfter; 00331 CSenProviderPolicy* iProviderPolicy; 00332 }; 00333 00334 // SEN_XML_SERVICE_DESCRIPTION_H 00335 #endif 00336 00337 // End of File 00338 00339