// WEBHLIST.H
//
// Copyright (c) 1997-1999 Symbian Ltd.  All rights reserved.
//

#if !defined(__WEBHLIST_H__)
#define __WEBHLIST_H__

#if !defined (__WEBDEF_H__)
#include "webdef.h"
#endif

const TInt KWebHistoryListNoParentFramesetId = -1;
const TInt KWebHistoryListTopFramesetId = 0;

enum TWebPageType
	{
	EWebFrameObject =10,
	EWebTopPageObject =20,
	EWebPageObject =30,
	EWebFramesetObject =40
	};

class THistoryListFrameId
	// Stores a 2 part identifier for a frame
	{
public:
	inline THistoryListFrameId();
	inline THistoryListFrameId(const THistoryListFrameId& aHistoryListFrameId);
	inline THistoryListFrameId(TInt aOrderPosition,TInt aParentIndex);
	inline TBool operator==(const THistoryListFrameId& aOther);
	inline THistoryListFrameId& operator=(const THistoryListFrameId& aHistoryListFrameId);
public:
	TInt iOrderPosition;
	TInt iParentIndex;
	};

class THistoryListDetails
	// Information about a new web page to be added to the list
	{
public:
	inline THistoryListDetails();
	inline THistoryListDetails(const TDesC& aUrl, const TDesC& aTitle, const THistoryListFrameId& aFrameId, TWebPageType aWebPageType);
	inline TBool operator==(const THistoryListDetails& aOther);
public:
	TPtrC iUrl;
	TPtrC iTitle;
	THistoryListFrameId iFrameId;
	TWebPageType iPageType;
	};


inline THistoryListFrameId::THistoryListFrameId(TInt aOrderPosition,TInt aParentIndex) :
	iOrderPosition(aOrderPosition),
	iParentIndex(aParentIndex)
	{}

inline THistoryListFrameId::THistoryListFrameId(const THistoryListFrameId& aHistoryListFrameId) : 
	iOrderPosition(aHistoryListFrameId.iOrderPosition), iParentIndex(aHistoryListFrameId.iParentIndex)
	{}


inline THistoryListFrameId::THistoryListFrameId() :
	iOrderPosition(KWebHistoryListTopFramesetId),
	iParentIndex(KWebHistoryListNoParentFramesetId)
// constructs the Id for the top most frameset as a default
	{}

inline THistoryListFrameId& THistoryListFrameId::operator=(const THistoryListFrameId& aHistoryListFrameId) 
	{
	iOrderPosition = aHistoryListFrameId.iOrderPosition;
	iParentIndex = aHistoryListFrameId.iParentIndex;
	return *this;
	}

inline TBool THistoryListFrameId::operator==(const THistoryListFrameId& aOther)
	{
	return (iOrderPosition == aOther.iOrderPosition && iParentIndex == aOther.iParentIndex);
	}

inline THistoryListDetails::THistoryListDetails() :
	iFrameId(),
	iPageType(EWebTopPageObject)
	{}

inline THistoryListDetails::THistoryListDetails(const TDesC& aUrl, const TDesC& aTitle, 
												const THistoryListFrameId& aFrameId,
												TWebPageType aPageType) :
	iUrl(aUrl),
	iTitle(aTitle),
	iFrameId(aFrameId),
	iPageType(aPageType)
	{}

inline TBool THistoryListDetails::operator==(const THistoryListDetails& aOther)
	{
	return ((iUrl == aOther.iUrl) && (iTitle == aOther.iTitle) &&
			(iFrameId == aOther.iFrameId) && (iPageType == aOther.iPageType));
	}

#endif
