// WEBURLPA.H
//
// Copyright (c) 1997-1999 Symbian Ltd.  All rights reserved.
//

#if !defined(__WEBURLPA_H__)
#define __WEBURLPA__H__

#if !defined(__E32BASE_H__)
#include <e32base.h>
#endif
#if !defined(__BADESCA_H__)
#include <badesca.h>
#endif

class CWtlSession;
class CWebServicesModel;
class TInternalUrlCell;

const TInt KWebMaxSchemeLength = 64;

class CWebUrl : public CBase
	{
public:

	enum TWebUrlParseType 
		{
		EWebUrlScheme, 
		EWebUrlHost,
		EWebUrlPath,
		EWebUrlDocument,
		EWebUrlUserName,
		EWebUrlPassword,
		EWebUrlParameters,
		EWebUrlQuery,
		EWebUrlFragment
		};

	IMPORT_C static CWebUrl* NewL(const TDesC& aUrl,CWtlSession* aSession);
	IMPORT_C static CWebUrl* NewL(const TDesC& aRelativeUrl, const TDesC& aBaseUrl, CWtlSession* aSession);
	IMPORT_C static CWebUrl* NewL(const TDesC& aUrl,CWebServicesModel* aServices);
	IMPORT_C static CWebUrl* NewL(const TDesC& aRelativeUrl, const TDesC& aBaseUrl, CWebServicesModel* aServices);
	IMPORT_C ~CWebUrl();
	IMPORT_C TPtrC Parse(TWebUrlParseType aParseType) const;
	IMPORT_C HBufC* FullUrlL();
private:
	CWebUrl();
	void ConstructL(const TDesC& aRelativeUrl, const TDesC& aBaseUrl, CWtlSession* aSession);
private:
	TInternalUrlCell* iUrlCell;
	CWtlSession* iSession;
	};


#endif

