// AGMGUIDX.H
//
// Copyright (c) 1997-1999 Symbian Ltd.  All rights reserved.
//


#if !defined(__AGMGUIDX_H__)
#define __AGMGUIDX_H__

#if !defined(__E32BASE_H__)
#include <e32base.h>
#endif

#if !defined(__AGMXENTR_H__)
#include "agmxentr.h"
#endif

#if !defined(__AGMIDS_H__)
#include "agmids.h"
#endif


////////////////
// TAgnExtended Flag

// Used to couple an entryId with a 'has extended' flag
// Used when building index

class TAgnExtendedFlag 
	{
public:
	TAgnExtendedFlag(TBool aHasExtended, TAgnEntryId aEntryId);
	TAgnExtendedFlag();
public:
	TBool		iHasExtended;
	TAgnEntryId iEntryId;
	};


class CAgnGlobalIdIndex : public CBase
	{
public:
	static CAgnGlobalIdIndex* NewL();
	CAgnGlobalIdIndex();
	~CAgnGlobalIdIndex();
	void ConstructL();

	void AddL(TAgnGlobalId aGlobalId, TAgnEntryId aEntryId);
	void Delete(TAgnGlobalId aGlobalId);
	void UpdateL(TAgnEntryId aOldEntryId, TAgnEntryId aNewEntryId);
	TAgnEntryId Lookup(TAgnGlobalId aGlobalId);
	void Reset();
private:
	TInt Index(TAgnGlobalId aGlobalId);
	TInt Index(TAgnEntryId aEntryId);
private:
	// Two arrays are used for speed purposes, rather than having
	// a single array of a combined GlobalId/EntryId pair
	CArrayFixFlat<TAgnGlobalId>*	iGlobalIdList;
	CArrayFixFlat<TAgnEntryId>*		iEntryIdList;
	};



#endif
