00001 /* 00002 * ============================================================================== 00003 * Name : SenServicePattern.h 00004 * Part of : Web Services Description 00005 * Interface : 00006 * Description : Class derives the XML service description and further extends 00007 * it by adding consumer policy interface implementation. 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_SERVICE_PATTERN_H 00023 #define SEN_SERVICE_PATTERN_H 00024 00025 // INCLUDES 00026 #include <e32base.h> 00027 #include <s32strm.h> 00028 #include <SenXmlServiceDescription.h> 00029 #include <MSenConsumerPolicy.h> 00030 00031 // FORWARD DECLARATIONS 00032 class CSenConsumerPolicy; 00033 00034 // CLASS DECLARATION 00035 00068 class CSenServicePattern : public CSenXmlServiceDescription, public MSenConsumerPolicy 00069 00070 { 00071 public: // Constructors and destructor 00072 00076 IMPORT_C static CSenServicePattern* NewL(); 00077 00081 IMPORT_C static CSenServicePattern* NewLC(); 00082 00087 IMPORT_C static CSenServicePattern* NewL(const TDesC8& aNamespaceURI); 00088 00093 IMPORT_C static CSenServicePattern* NewLC(const TDesC8& aNamespaceURI); 00094 00100 IMPORT_C static CSenServicePattern* NewL( const TDesC8& aEndPoint, 00101 const TDesC8& aContract ); 00102 00108 IMPORT_C static CSenServicePattern* NewLC( const TDesC8& aEndPoint, 00109 const TDesC8& aContract ); 00110 00114 IMPORT_C virtual ~CSenServicePattern(); 00115 00116 // New functions 00117 00124 IMPORT_C HBufC8* ConsumerPolicyAsXmlL(); 00125 00126 // Functions from base classes 00127 00128 // From CSenXmlServiceDescription 00129 00139 IMPORT_C TBool Matches(MSenServiceDescription& aServicePattern); 00140 00150 IMPORT_C void StartElementL(const TDesC8& aNsUri, 00151 const TDesC8& aLocalName, 00152 const TDesC8& aQName, 00153 const RAttributeArray& aAttributes); 00154 00155 // From MSenConsumerPolicy 00156 IMPORT_C virtual void SetConsumerIapIdL(TUint32 aIapId); 00157 IMPORT_C virtual TInt ConsumerIapId(TUint32& aCurrentIapId); 00158 IMPORT_C virtual void SetConsumerIdentityProviderIdsL( 00159 CSenIdentityProviderIdArray8& aList); 00160 00161 IMPORT_C virtual TInt AddConsumerIdentityProviderIdL( 00162 const TDesC8& aProviderId); 00163 00164 IMPORT_C virtual const CSenIdentityProviderIdArray8& 00165 ConsumerIdentityProviderIds8L(); 00166 00167 IMPORT_C virtual TBool AcceptsConsumerPolicy( 00168 MSenConsumerPolicy& aPolicyPattern); 00169 00170 IMPORT_C virtual TInt RebuildFromConsumerPolicy( 00171 MSenConsumerPolicy& aTemplate); 00172 00173 protected: // New functions 00174 00180 IMPORT_C CSenServicePattern( 00181 MSenServiceDescription::TDescriptionClassType aType); 00182 00187 IMPORT_C void BaseConstructL(); 00188 00195 IMPORT_C void BaseConstructL(const TDesC8& aNamespaceURI); 00196 00203 IMPORT_C void BaseConstructL(const TDesC8& aEndPoint, const TDesC8& aContract); 00204 00205 public: 00210 IMPORT_C void SetConsumerSnapIdL(TUint32 aSnapId); 00218 IMPORT_C TInt ConsumerSnapId(TUint32& aCurrentSnapId); 00219 00220 protected: // Data 00221 00222 // Consumer policy class instance, used as a delegate in parsing 00223 CSenConsumerPolicy* iConsumerPolicy; 00224 }; 00225 00226 #endif SEN_SERVICE_PATTERN_H 00227 00228 // End of File