// WEBDEF.H
//
// Copyright (c) 1997-1999 Symbian Ltd.  All rights reserved.
//

#if defined(__VC32__) && _MSC_VER==1100
// Disable MSVC++ 5.0 aggressive warnings about non-expansion of inline functions. 
#pragma warning(disable : 4710)	// function '...' not expanded
#endif

#if !defined(__WEBDEF_H__)
#define __WEBDEF_H__

#if !defined(__E32BASE_H__)
#include <e32base.h>
#endif

#define __LOGGING

#define  KWebFileProtocol (_L("file:///"))
#define  KWebNoDocMimeName (_S8("x-epoc/x-web-no-doc"))
const TInt KMaxWebAuthenticationNameLength = 32;
const TInt KMaxWebAuthenticationPasswordLength = 32;
const TInt KMaxWebSchemeLength = 32;
const TInt KMaxWebHostLength = 255;
const TInt KMaxWebRealmLength = 255;
const TInt KMaxConfigurationTextItemLength = 256;
const TInt KMaxLogEntrySize = 255;
const TInt KRelativeFontSize = 2 ; 

const TInt KWebNoPageFrameId = -1;
const TInt KWebHistoryListReloading = -1; // an invalid requested position as a flag, this must match what the engine sets 

//iLogPtr->WriteLogEntry(aLevel,aText);
// Logging definitions
class CWebLogger;

#if defined(__LOGGING)
	#define __SET_LOG(aLogPtr)					iLogPtr = aLogPtr									
	#define __DECLARE_LOG						CWebLogger* iLogPtr 	

	#define __LOGPROFILE(aText)					iLogPtr->WriteLogEntry(CWebLogger::ELogProfile,aText);
	#define __LOGPROFILE1(aText,aV1)			iLogPtr->WriteLogEntry(CWebLogger::ELogProfile,aText,aV1);
	#define __LOGPROFILE2(aText,aV1,aV2)		iLogPtr->WriteLogEntry(CWebLogger::ELogProfile,aText,aV1,aV2);

	#define	__LOG_ENTER(aText);
	#define __LOG_RETURN
	#define __LOG(aLevel,aText);
	#define __LOG1(aLevel,aText,aV1);
	#define __LOG2(aLevel,aText,aV1,aV2);
	#define __LOG3(aLevel,aText,aV1,aV2,aV3);	
#endif



// Leave Testing tool
#if defined(_DEBUG)
	#define __DEBUG_TEST_LEAVE {TAny* any=User::AllocL(100); delete any;}
#else
	#define __DEBUG_TEST_LEAVE
# endif

// Define macros for ordinary assertion and for functions suspected of leaving.
#if defined(_DEBUG)
	#if !defined(WEBASSERT)
	// Right-truncate <string> at compile time to <size> chars.
		#define _L_RIGHT_TRUNCATED(string,size) \
		  TPtrC(size > (sizeof(string) - 1) ? _S(string) : (_S(string) + sizeof(string) - size - 1))
		#define WEBASSERT(x) ((x) || (User::Panic(_L_RIGHT_TRUNCATED(__FILE__,KMaxExitCategoryName),__LINE__),0))
	#endif 

	#define ASSERT_NO_LEAVE(aStatement) { TRAPD(i,{ aStatement; }); ASSERT(i == 0); }

#else
	#define ASSERT_NO_LEAVE(aStatement) aStatement;
	#if !defined(WEBASSERT)
		#define WEBASSERT(x)
	#endif
#endif //_DEBUG


#endif
