javaextensions/location/common/inc/lapipanics.h
branchRCL_3
changeset 19 04becd199f91
equal deleted inserted replaced
16:f5050f1da672 19:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Location API Panic description and codes
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef LAPIPANICS_H
       
    20 #define LAPIPANICS_H
       
    21 
       
    22 #ifdef _DEBUG
       
    23 
       
    24 // EXTERNAL INCLUDES
       
    25 #include <e32std.h>
       
    26 
       
    27 /**
       
    28  * Panic codes for Location API
       
    29  */
       
    30 enum TLAPIPanicCode
       
    31 {
       
    32     // Indicates that the passed argument is null
       
    33     ELAPIPanicNullArgument,
       
    34     // Indicates that the name of the landmarks is null
       
    35     ELAPIPanicNullLandmarkName,
       
    36     // Indicates that the passed array had insufficient number of elements
       
    37     ELAPIPanicInvalidAddressInfoCount,
       
    38     // Indicates that the passed array was too short
       
    39     ELAPIPanicJniIncorrectArrayLength,
       
    40     // Indicates that the passed id is not valid
       
    41     ELAPIPanicInvalidFieldId,
       
    42     // Indicates that the passed landmark id is incorrect
       
    43     ELAPIPanicInvalidLandmarkId
       
    44 };
       
    45 
       
    46 /**
       
    47  * Location API internal panic tool. Note that this tool must only
       
    48  * be used in debug builds
       
    49  */
       
    50 namespace LAPIError
       
    51 {
       
    52 /// Panic category for Location API Panics
       
    53 _LIT(KPanicCategory, "java-location");
       
    54 
       
    55 /**
       
    56  * Called if an unrecoverable error is detected.
       
    57  * Stops the thread with User::Panic.
       
    58  */
       
    59 inline void Panic(TLAPIPanicCode aPanicCode);
       
    60 }
       
    61 
       
    62 inline void LAPIError::Panic(TLAPIPanicCode aPanicCode)
       
    63 {
       
    64     User::Panic(KPanicCategory, aPanicCode);
       
    65 }
       
    66 
       
    67 #endif // _DEBUG
       
    68 #endif // LAPIPANICS_H
       
    69 // End of file