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