williamr@2: // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@2: // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members williamr@2: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // Authentication class for storing login information williamr@2: // williamr@2: // williamr@2: williamr@2: williamr@2: williamr@2: /** williamr@2: @file cauthentication.h williamr@2: @publishedPartner williamr@2: @released williamr@2: */ williamr@2: williamr@2: #ifndef __CAUTHENTICATION_H__ williamr@2: #define __CAUTHENTICATION_H__ williamr@2: williamr@2: #include <uri8.h> williamr@2: williamr@2: /** williamr@2: CAuthentication encapsulates username and login information. williamr@2: Uses 8-bit descriptors. Unicode text must be tranformed into UTF8 for storage. williamr@2: @publishedPartner williamr@2: @released williamr@2: */ williamr@2: class CAuthentication: public CBase williamr@2: { williamr@2: public: williamr@2: /** williamr@2: enum for TMethod williamr@2: */ williamr@2: enum TMethod williamr@2: { williamr@2: /** Basic */ williamr@2: EBasic, williamr@2: /** Digest */ williamr@2: EDigest williamr@2: }; williamr@2: public: williamr@2: IMPORT_C static CAuthentication* NewL(const TDesC8& aName, const TDesC8& aPassword, TMethod aMethod = EDigest); williamr@2: IMPORT_C static CAuthentication* NewL(const TUriC8& aUri, TMethod aMethod = EDigest); williamr@2: IMPORT_C ~CAuthentication(); williamr@2: IMPORT_C const TDesC8& Name() const; williamr@2: IMPORT_C const TDesC8& Password() const; williamr@2: IMPORT_C TMethod Method() const; williamr@2: IMPORT_C void SetNameL(const TDesC8& aName); williamr@2: IMPORT_C void SetPasswordL(const TDesC8& aPassword); williamr@2: IMPORT_C void SetMethod(TMethod aMethod); williamr@2: private: williamr@2: CAuthentication(TMethod aMethod); williamr@2: void ConstructL(const TDesC8& aName, const TDesC8& aPassword); williamr@2: void ConstructL(const TUriC8& aUri); williamr@2: private: williamr@2: /** williamr@2: The descriptor buffer that contains the Name. williamr@2: */ williamr@2: HBufC8* iName; williamr@2: /** williamr@2: The descriptor buffer that contains the Password. williamr@2: */ williamr@2: HBufC8* iPassword; williamr@2: /** williamr@2: The enum of type TMethod. williamr@2: */ williamr@2: TMethod iMethodType; williamr@2: }; williamr@2: williamr@2: #endif //__CAUTHENTICATION_H__