sl@0: // Copyright (c) 1997-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: // Started by DWW, May 1997
sl@0: // Error handler
sl@0: // 
sl@0: //
sl@0: 
sl@0: #if !defined(__BAERRHAN_H__)
sl@0: #define __BAERRHAN_H__
sl@0: 
sl@0: #if !defined(__E32BASE_H__)
sl@0: #include <e32base.h>
sl@0: #endif
sl@0: /**
sl@0: @internalComponent
sl@0: */
sl@0: #ifdef _UNICODE
sl@0: #define KUidBaflErrorHandlerValue KUidBaflErrorHandlerValue16
sl@0: #define KUidBaflErrorHandler KUidBaflErrorHandler16
sl@0: #else
sl@0: #define KUidBaflErrorHandlerValue KUidBaflErrorHandlerValue8
sl@0: #define KUidBaflErrorHandler KUidBaflErrorHandler8
sl@0: #endif
sl@0: 
sl@0: 
sl@0: /**
sl@0: @internalComponent
sl@0: */
sl@0: const TInt KUidBaflErrorHandlerValue8=0x10000257;
sl@0: const TUid KUidBaflErrorHandler8={KUidBaflErrorHandlerValue8};
sl@0: const TInt KUidBaflErrorHandlerValue16=0x10003A13;
sl@0: const TUid KUidBaflErrorHandler16={KUidBaflErrorHandlerValue16};
sl@0: 
sl@0: /**
sl@0: @internalComponent
sl@0: */
sl@0: enum TErrorHandlerResponse
sl@0: 	{
sl@0: 	EErrorNotHandled,
sl@0: 	ENoDisplay,
sl@0: 	EAlertDisplay,
sl@0: 	EInfoDisplay
sl@0: 	};
sl@0: 
sl@0: class CBaErrorHandler : public CBase
sl@0: /**
sl@0: deliberately *not* mixable - else couldn't be freely cast
sl@0: @internalComponent
sl@0: */
sl@0: 	{ 
sl@0: public:
sl@0: 	virtual TErrorHandlerResponse HandleError(TDes& aErrorText,TDes& aContextText)=0;
sl@0: 	inline static TErrorHandlerResponse CallBack(TInt aErrorNumber,TDes& aErrorText,TDes& aContextText);
sl@0: 	};
sl@0: 
sl@0: inline TErrorHandlerResponse CBaErrorHandler::CallBack(TInt aErrorNumber,TDes& aErrorText,TDes& aContextText)
sl@0: 	{
sl@0: 	return((CBaErrorHandler*)(aErrorNumber))->HandleError(aErrorText,aContextText);
sl@0: 	}
sl@0: 
sl@0: #endif