diff -r e8e63152f320 -r 2a9601315dfc javaextensions/location/common/inc/lapipanics.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaextensions/location/common/inc/lapipanics.h Mon May 03 12:27:20 2010 +0300 @@ -0,0 +1,69 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Location API Panic description and codes + * +*/ + + +#ifndef LAPIPANICS_H +#define LAPIPANICS_H + +#ifdef _DEBUG + +// EXTERNAL INCLUDES +#include + +/** + * Panic codes for Location API + */ +enum TLAPIPanicCode +{ + // Indicates that the passed argument is null + ELAPIPanicNullArgument, + // Indicates that the name of the landmarks is null + ELAPIPanicNullLandmarkName, + // Indicates that the passed array had insufficient number of elements + ELAPIPanicInvalidAddressInfoCount, + // Indicates that the passed array was too short + ELAPIPanicJniIncorrectArrayLength, + // Indicates that the passed id is not valid + ELAPIPanicInvalidFieldId, + // Indicates that the passed landmark id is incorrect + ELAPIPanicInvalidLandmarkId +}; + +/** + * Location API internal panic tool. Note that this tool must only + * be used in debug builds + */ +namespace LAPIError +{ +/// Panic category for Location API Panics +_LIT(KPanicCategory, "java-location"); + +/** + * Called if an unrecoverable error is detected. + * Stops the thread with User::Panic. + */ +inline void Panic(TLAPIPanicCode aPanicCode); +} + +inline void LAPIError::Panic(TLAPIPanicCode aPanicCode) +{ + User::Panic(KPanicCategory, aPanicCode); +} + +#endif // _DEBUG +#endif // LAPIPANICS_H +// End of file