phonesrv_plat/string_parser_api/inc/PhoneGsmParser.h
changeset 46 2fa1fa551b0b
parent 42 35488577e233
child 48 78df25012fda
equal deleted inserted replaced
42:35488577e233 46:2fa1fa551b0b
     1 /*
       
     2 * Copyright (c) 2002 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:  It is class containing static methods to create 
       
    15 *                instances of parser and parser results.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef PHONEGSMPARSER_H
       
    21 #define PHONEGSMPARSER_H
       
    22 
       
    23 // INCLUDES
       
    24 #include    <e32base.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CPhoneGsmParserBase;
       
    28 class CPhoneGsmParserResult;
       
    29 class CPhoneGsmOptionContainerBase;
       
    30 class CPhoneParserFeatures;
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35 * It is class containing static methods to create 
       
    36 * instances of parser and parser results.
       
    37 *
       
    38 * @since 1.0
       
    39 * @lib phoneparser.lib
       
    40 */
       
    41 class PhoneGsmParser 
       
    42     {
       
    43     public: // New functions
       
    44            
       
    45         /**
       
    46         * Creates an instance of CPhoneGsmParser, GSM specific parser.
       
    47         *
       
    48         * @return Returns new instance of CPhoneGsmParser.
       
    49         */
       
    50         IMPORT_C static CPhoneGsmParserBase* 
       
    51             CreateParserL();
       
    52 
       
    53         /**
       
    54         * Creates an instance of CPhoneGsmParserResult.
       
    55         *
       
    56         * @return Returns new instance of CPhoneGsmParserResult.
       
    57         */
       
    58         IMPORT_C static CPhoneGsmParserResult* 
       
    59             CreateResultL();
       
    60 
       
    61         /**
       
    62         * Creates option container.
       
    63         *
       
    64         * Note that options are defined and set to initial status.
       
    65         *
       
    66         * @return Returns new instance of CPhoneGsmOptionContainerBase.
       
    67         */
       
    68         IMPORT_C static CPhoneGsmOptionContainerBase*
       
    69             CreateOptionContainerL();
       
    70         
       
    71         /**
       
    72         * Enumerates all common types.
       
    73         */
       
    74         enum TContentType
       
    75             {
       
    76             EContentInvalid,
       
    77             EContentUnknown, // but still valid
       
    78             EContentPhoneNumber,
       
    79             EContentSupplementaryService,
       
    80             EContentUnstructuredService
       
    81             };
       
    82 
       
    83         /**
       
    84         * Determines the type of content.
       
    85         */
       
    86         IMPORT_C static TContentType DetermineContentType( 
       
    87             const CPhoneGsmParserResult& aResult );
       
    88 
       
    89         /**
       
    90         * Checks if it is allowed for arriving call.
       
    91         *
       
    92         * Note that this is ui issue. This could be done otherwise,
       
    93         * but this is clearly the simplest option.
       
    94         *
       
    95         * @return ETrue if allowed.
       
    96         */
       
    97         IMPORT_C static TBool IsAllowedForArriving(
       
    98             const CPhoneGsmParserResult& aResult );
       
    99 
       
   100         /**
       
   101         * Checks if it is allowed for bad sim state.
       
   102         *
       
   103         * Note that this is ui issue. This could be done otherwise,
       
   104         * but this is clearly the simplest option.
       
   105         *
       
   106         * @return ETrue if allowed.
       
   107         */
       
   108         IMPORT_C static TBool IsAllowedForBadSim(
       
   109             const CPhoneGsmParserResult& aResult );
       
   110 
       
   111 #ifdef __WINS__
       
   112         /**
       
   113         * For testing purposes.
       
   114         *
       
   115         * @param aStub feature stub.
       
   116         */
       
   117         IMPORT_C static void UseFeatureStub( CPhoneParserFeatures* aStub );
       
   118 #endif // __WINS__
       
   119 
       
   120         /**
       
   121         * It enumerates the reasons for panics in parser.
       
   122         */
       
   123         enum TPanicReason
       
   124             {
       
   125             EIncorrectServiceDescription,
       
   126             EIncorrectUse,
       
   127             EOptionNotDefined,
       
   128             EOptionAlreadyDefined,
       
   129             EShouldNeverHappen
       
   130             };
       
   131 
       
   132         /**
       
   133         * Panic!
       
   134         *
       
   135         * @param aReason It is the reason for panic.
       
   136         */
       
   137         static void Panic( TPanicReason aReason );
       
   138 
       
   139     private:
       
   140 
       
   141         /** 
       
   142         * Define all options.
       
   143         *
       
   144         * @param aOptions It is the option container.
       
   145         */
       
   146         static void DefineOptionsL( 
       
   147             CPhoneGsmOptionContainerBase& aOptions );
       
   148         
       
   149         /**
       
   150         * Initialise options to default values.
       
   151         */
       
   152         static void InitialiseOptionsToDefaultValues(
       
   153                 CPhoneGsmOptionContainerBase& aOptions );
       
   154 
       
   155         /**
       
   156         * Creates parser for manufacturer specific procedures.
       
   157         */
       
   158         static CPhoneGsmParserBase* CreateManufacturerProcedureParserLC();
       
   159 
       
   160     };
       
   161 
       
   162 #endif      // PHONEGSMPARSER_H
       
   163             
       
   164 // End of File