williamr@2: /* williamr@2: * Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@4: * under the terms of "Eclipse Public License v1.0" williamr@2: * which accompanies this distribution, and is available williamr@4: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: Class implements (web) service credential functionality williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: #ifndef SEN_CREDENTIAL2_H williamr@2: #define SEN_CREDENTIAL2_H williamr@2: williamr@2: // INCLUDES williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: williamr@2: // CONSTANTS williamr@2: _LIT8(KCredentialsName2, "Credentials"); williamr@2: _LIT8(KEndpointName2, "Endpoint"); williamr@2: _LIT8(KSecurityMechIdName2, "SecurityMechID"); williamr@2: _LIT8(KNotOnOrAfterName2, "NotOnOrAfter"); williamr@2: _LIT8(KConditionsName2, "Conditions"); williamr@2: williamr@2: _LIT8(KSenCredentialId, "CredentialId"); williamr@2: _LIT8(KSenCredentialValidUntil, "ValidUntil"); williamr@2: _LIT8(KSenCredentialIdentifierLocalname,"Identifier"); williamr@2: _LIT8(KSenCredentialProperteisLocalname,"Properties"); williamr@2: williamr@2: // FORWARD DECLARATIONS williamr@2: class SenDateUtils; williamr@2: class CSenCredentialIdentifier; williamr@2: class CSenXmlServiceDescription; williamr@2: class CSenIdentityProvider; williamr@2: class CSenServiceSession; williamr@2: class CSenFacet; williamr@2: williamr@2: // CLASS DECLARATION williamr@2: williamr@2: /** williamr@2: * Class implements (web) service credential functionality williamr@2: * @lib SenServDesc.lib williamr@2: * @since Series60 3.0 williamr@2: */ williamr@2: class CSenCredential2 : public CSenFragmentBase williamr@2: { williamr@2: public: // Constructors and destructor williamr@2: williamr@2: /** williamr@2: * Basic constructor. williamr@2: * williamr@2: * @since Series60 4.0 williamr@2: */ williamr@4: IMPORT_C static CSenCredential2* NewL(); williamr@2: williamr@2: /** williamr@2: * Basic constructor. williamr@2: * williamr@2: * @since Series60 4.0 williamr@2: */ williamr@4: IMPORT_C static CSenCredential2* NewLC(); williamr@2: williamr@2: /** williamr@2: * Basic constructor. williamr@2: * williamr@2: * @since Series60 4.0 williamr@2: * @param aNsUri is the XML namespace of this credential williamr@2: * @param aLocalName is the XML localname of this credential williamr@2: * @param aPrefix is the prefix of this credential williamr@2: * @param aAttrs are the XML attributes of this credential williamr@2: */ williamr@4: IMPORT_C static CSenCredential2* NewL(const TDesC8& aNsUri, williamr@2: const TDesC8& aLocalName, williamr@2: const TDesC8& aQName, williamr@2: const RAttributeArray& aAttributes); williamr@2: williamr@2: /** williamr@2: * Basic constructor. williamr@2: * williamr@2: * @since Series60 4.0 williamr@2: * @param aNsUri is the XML namespace of this credential williamr@2: * @param aLocalName is the XML localname of this credential williamr@2: * @param aPrefix is the prefix of this credential williamr@2: * @param aAttrs are the XML attributes of this credential williamr@2: */ williamr@4: IMPORT_C static CSenCredential2* NewLC(const TDesC8& aNsUri, williamr@2: const TDesC8& aLocalName, williamr@2: const TDesC8& aQName, williamr@2: const RAttributeArray& aAttributes); williamr@2: williamr@2: /** williamr@2: * Basic constructor. williamr@2: * williamr@2: * @since Series60 4.0 williamr@2: * @param aNsUri is the XML namespace of this credential williamr@2: * @param aLocalName is the XML localname of this credential williamr@2: * @param aPrefix is the prefix of this credential williamr@2: * @param aAttrs are the XML attributes of this credential williamr@2: * @param aParent is the parent XML element of this credential williamr@2: */ williamr@4: IMPORT_C static CSenCredential2* NewL(const TDesC8& aNsUri, williamr@2: const TDesC8& aLocalName, williamr@2: const TDesC8& aQName, williamr@2: const RAttributeArray& aAttributes, williamr@2: TXmlEngElement& aParent); williamr@2: williamr@2: /** williamr@2: * Basic constructor. williamr@2: * williamr@2: * @since Series60 4.0 williamr@2: * @param aNsUri is the XML namespace of this credential williamr@2: * @param aLocalName is the XML localname of this credential williamr@2: * @param aPrefix is the prefix of this credential williamr@2: * @param aAttrs are the XML attributes of this credential williamr@2: * @param aParent is the parent XML element of this credential williamr@2: */ williamr@4: IMPORT_C static CSenCredential2* NewLC(const TDesC8& aNsUri, williamr@2: const TDesC8& aLocalName, williamr@2: const TDesC8& aQName, williamr@2: const RAttributeArray& aAttributes, williamr@2: TXmlEngElement& aParent); williamr@2: williamr@2: /** williamr@2: * Basic constructor. williamr@2: * williamr@2: * @since Series60 4.0 williamr@2: * @param aNsUri is the XML namespace of this fragment williamr@2: * @param aLocalName is the XML localname of this fragment williamr@2: * @param aPrefix is the prefix of this fragment williamr@2: * @param aAttrs are the XML attributes of this fragment williamr@2: * @param aParent is the parent XML element of this fragment williamr@2: * @param aOwnerDocument is the document which will be the owner of williamr@2: * the elements of this fragment williamr@2: */ williamr@4: IMPORT_C static CSenCredential2* NewL(const TDesC8& aNsUri, williamr@2: const TDesC8& aLocalName, williamr@2: const TDesC8& aQName, williamr@2: const RAttributeArray& aAttrs, williamr@2: TXmlEngElement& aParent, williamr@2: RSenDocument& aOwnerDocument); williamr@2: williamr@2: /** williamr@2: * Basic constructor. williamr@2: * williamr@2: * @since Series60 4.0 williamr@2: * @param aNsUri is the XML namespace of this fragment williamr@2: * @param aLocalName is the XML localname of this fragment williamr@2: * @param aPrefix is the prefix of this fragment williamr@2: * @param aAttrs are the XML attributes of this fragment williamr@2: * @param aParent is the parent XML element of this fragment williamr@2: * @param aOwnerDocument is the document which will be the owner of williamr@2: * the elements of this fragment williamr@2: */ williamr@4: IMPORT_C static CSenCredential2* NewLC(const TDesC8& aNsUri, williamr@2: const TDesC8& aLocalName, williamr@2: const TDesC8& aQName, williamr@2: const RAttributeArray& aAttrs, williamr@2: TXmlEngElement& aParent, williamr@2: RSenDocument& aOwnerDocument); williamr@2: williamr@2: /** williamr@2: * Constructor which copies itself from another credential. williamr@2: * williamr@2: * @since Series60 4.0 williamr@2: * @param aCredential credential to copy from. williamr@2: * @return new CSenCredential instance pointer williamr@2: */ williamr@2: IMPORT_C static CSenCredential2* NewL(const CSenCredential2& aCredential); williamr@2: williamr@2: /** williamr@2: * Constructor which copies itself from another credential. williamr@2: * williamr@2: * @since Series60 4.0 williamr@2: * @param aCredential credential to copy from. williamr@2: * @return new CSenCredential instance pointer, which is left on williamr@2: * cleanup stack. williamr@2: */ williamr@2: IMPORT_C static CSenCredential2* NewLC(const CSenCredential2& aCredential); williamr@2: williamr@2: /** williamr@2: * Destructor. williamr@2: */ williamr@2: IMPORT_C virtual ~CSenCredential2(); williamr@2: williamr@2: // New functions williamr@2: williamr@2: /** williamr@2: * Getter for the credential ID. williamr@2: * williamr@2: * @since Series60 4.0 williamr@2: * @return the ID williamr@2: */ williamr@2: IMPORT_C virtual const TDesC8& Id(); williamr@2: williamr@2: /** williamr@2: * Getter for the credential expiration time. williamr@2: * @since Series60 3.0 williamr@2: * @return the the expiration time williamr@2: */ williamr@2: IMPORT_C virtual TTime& ValidUntil(); williamr@2: williamr@2: /** williamr@2: * Setter for the credential expiration time. williamr@2: * williamr@2: * @since Series60 4.0 williamr@2: * @param aTime The new expiration time williamr@2: */ williamr@2: IMPORT_C virtual void SetValidUntil(TTime& aTime); williamr@2: williamr@2: protected: // Functions from base classes williamr@2: williamr@2: /** williamr@2: * C++ default constructor. williamr@2: */ williamr@2: IMPORT_C CSenCredential2(); williamr@2: williamr@2: williamr@2: IMPORT_C virtual void OnStartElementL(const RTagInfo& aElement, williamr@2: const RAttributeArray& aAttributes, williamr@2: TInt aErrorCode); williamr@2: williamr@2: /** williamr@2: * @since Series60 4.0 williamr@2: * @param aNsUri is the XML namespace as UTF-8 descriptor williamr@2: * @param aLocalName is the XML localname as UTF-8 descriptor williamr@2: * @param aQName is the XML qualifiedname as UTF-8 descriptor williamr@2: * @param aAttributes is the list of XML attributes williamr@2: */ williamr@2: IMPORT_C void BaseConstructL(const TDesC8& aNsUri, williamr@2: const TDesC8& aLocalName, williamr@2: const TDesC8& aQName, williamr@2: const RAttributeArray& aAttributes); williamr@2: williamr@2: /** williamr@2: * @since Series60 4.0 williamr@2: * @param aNsUri is the XML namespace as UTF-8 descriptor williamr@2: * @param aLocalName is the XML localname as UTF-8 descriptor williamr@2: * @param aQName is the XML qualifiedname as UTF-8 descriptor williamr@2: * @param aAttributes is the list of XML attributes williamr@2: * @param aParent is the parent element, which may declare other williamr@2: * namespaces. williamr@2: */ williamr@2: IMPORT_C void BaseConstructL(const TDesC8& aNsUri, williamr@2: const TDesC8& aLocalName, williamr@2: const TDesC8& aQName, williamr@2: const RAttributeArray& aAttributes, williamr@2: TXmlEngElement& aParent); williamr@2: williamr@2: /** williamr@2: * By default Symbian 2nd phase constructor is private. williamr@2: * williamr@2: * @since Series60 4.0 williamr@2: * @param aNsUri is the XML namespace as UTF-8 descriptor williamr@2: * @param aLocalName is the XML localname as UTF-8 descriptor williamr@2: * @param aQName is the XML qualifiedname as UTF-8 descriptor williamr@2: * @param aAttributes is the list of XML attributes williamr@2: * @param aParent is the parent element, which may declare other williamr@2: * namespaces. williamr@2: * @param aOwnerDocument is the document which will be the owner of williamr@2: * the elements of this credential williamr@2: */ williamr@2: IMPORT_C void BaseConstructL(const TDesC8& aNsUri, williamr@2: const TDesC8& aLocalName, williamr@2: const TDesC8& aQName, williamr@2: const RAttributeArray& aAttributes, williamr@2: TXmlEngElement& aParent, williamr@2: RSenDocument& aOwnerDocument); williamr@2: /** williamr@2: * By default Symbian 2nd phase constructor is private. williamr@2: * williamr@2: * @since Series60 4.0 williamr@2: * @param aCredential is the source credential to be copied. williamr@2: */ williamr@2: IMPORT_C void BaseConstructL(CSenCredential2& aCredential); williamr@2: williamr@2: williamr@2: private: williamr@2: /** williamr@2: * By default Symbian 2nd phase constructor is private. williamr@2: * williamr@2: * BaseConstructL for setting XML localname for this Credential. williamr@2: * @since Series60 4.0 williamr@2: * @param aLocalName XML localname for this Credential williamr@2: */ williamr@2: IMPORT_C void ConstructL(const TDesC8& aLocalName); williamr@2: williamr@2: // New functions williamr@2: williamr@2: /** williamr@2: * Setter for Credential ID williamr@2: * williamr@2: * @since Series60 4.0 williamr@2: * @param aId is the unique ID for this Credential williamr@2: */ williamr@2: void SetIdL(const TDesC8& aId); williamr@2: williamr@2: private: // Data williamr@2: // Unique ID for this credential. Owned. williamr@2: HBufC8* iId; williamr@2: // One may use SenDateUtils to convert from XML date descrtor to TTime williamr@2: TTime iNotOnOrAfter; williamr@2: }; williamr@2: williamr@2: #endif // SEN_CREDENTIAL2_H williamr@2: williamr@2: // End of File williamr@2: williamr@2: