telutils/phoneparser/inc/CPhoneParserFeatures.h
changeset 46 2fa1fa551b0b
parent 42 35488577e233
child 48 78df25012fda
equal deleted inserted replaced
42:35488577e233 46:2fa1fa551b0b
     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:  It encapsulates all dependencies.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPHONEPARSERFEATURES_H
       
    20 #define CPHONEPARSERFEATURES_H
       
    21 
       
    22 #include    <e32base.h>
       
    23 
       
    24 class CPhCltEmergencyCall;
       
    25 class CRepository;
       
    26 
       
    27 // INCLUDES
       
    28 #include    <mphcltemergencycallobserver.h> 
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35 * It is extension for options. 
       
    36 *
       
    37 * @since 1.2
       
    38 * @lib phoneparser.lib
       
    39 */
       
    40 NONSHARABLE_CLASS( CPhoneParserFeatures )
       
    41     : public CBase, public MPhCltEmergencyCallObserver
       
    42     {
       
    43     public:  // Constructors and destructor      
       
    44         
       
    45         /**
       
    46         * Two-phased constructor.
       
    47         */
       
    48         static CPhoneParserFeatures* InstanceL();
       
    49         
       
    50        /**
       
    51         * To release resources.
       
    52         */
       
    53         static void Free();
       
    54 
       
    55     public:  // From MPhCltEmergencyCallObserver   
       
    56         
       
    57         /**
       
    58         * It is called whenever client's dial request is completed.
       
    59         *
       
    60         * @param aStatus error code of the success of the operation.
       
    61         */       
       
    62         void HandleEmergencyDialL( const TInt aStatus );
       
    63 
       
    64     public: // New functions
       
    65         
       
    66         /**
       
    67         * Checks if two digit calling is enabled.
       
    68         *
       
    69         * @return ETrue if supported.
       
    70         */
       
    71         static TBool TwoDigitCallingEnabled();
       
    72             
       
    73         /**
       
    74         * Checks if zero send should make a call.
       
    75         *
       
    76         * @return ETrue if enabled.
       
    77         */
       
    78         static TBool IsZeroDialEnabled();
       
    79 
       
    80         /**
       
    81         * Checks if feature is supported.
       
    82         *
       
    83         * @param aFeature feature.
       
    84         * @return ETrue if supported.
       
    85         */
       
    86         static TBool FeatureSupported( TInt aFeature );
       
    87         
       
    88         /**
       
    89         * Checks if given number is emergency.
       
    90         *
       
    91         * @param aNumber Number to be queried.aNumber might contain prefix (SS code)
       
    92         *                and/or postfix (DTMF part).
       
    93         *                The aNumber parameter should be a buffer and the 
       
    94         *                clients are provided with a typedef called 
       
    95         *                TPhCltEmergencyNumber. 
       
    96         *
       
    97         * @param aEmergencyNumber Matched emergencynumber without prefix or 
       
    98         *                postfix is returned in this parameter. The aMatchedEmergencyNumber 
       
    99         *                parameter should be a buffer and the clients are
       
   100         *                provided with atypedef called TPhCltEmergencyNumber.
       
   101         * 
       
   102         * @returns ETrue if emergency.
       
   103         */
       
   104         static TBool IsEmergencyNumber( 
       
   105             const TDesC& aNumber, 
       
   106             TDes& aEmergencyNumber );
       
   107             
       
   108         /**
       
   109         * To set stub for testing purposes.
       
   110         *
       
   111         * @param aStub test stub.
       
   112         */       
       
   113 #ifdef __WINS__
       
   114         static void SetInstance( CPhoneParserFeatures* aStub );
       
   115 #endif // __WINS__
       
   116     
       
   117 
       
   118     private:
       
   119 
       
   120         /**
       
   121         * C++ default constructor.
       
   122         */
       
   123         CPhoneParserFeatures();
       
   124 
       
   125         /**
       
   126         * Symbian OS constructor.
       
   127         */
       
   128         void ConstructL();
       
   129 
       
   130         /**
       
   131         * Non leaving instance method.
       
   132         */
       
   133         static CPhoneParserFeatures* Instance();
       
   134         
       
   135         /**
       
   136         * Destructor.
       
   137         */
       
   138         ~CPhoneParserFeatures();
       
   139 
       
   140         /**
       
   141         * Checks if given number is emergency.
       
   142         *
       
   143         * @param aNumber Number to be queried.aNumber might contain prefix (SS code)
       
   144         *                and/or postfix (DTMF part).
       
   145         *                The aNumber parameter should be a buffer and the 
       
   146         *                clients are provided with a typedef called 
       
   147         *                TPhCltEmergencyNumber. 
       
   148         *
       
   149         * @param aEmergencyNumber Matched emergencynumber without prefix or 
       
   150         *                postfix is returned in this parameter. The aMatchedEmergencyNumber 
       
   151         *                parameter should be a buffer and the clients are
       
   152         *                provided with atypedef called TPhCltEmergencyNumber.
       
   153         * 
       
   154         * @returns ETrue if emergency.
       
   155         */
       
   156         virtual TBool IsEmergencyPhoneNumber( 
       
   157             const TDesC& aNumber, 
       
   158             TDes& aEmergencyNumber );
       
   159             
       
   160         /**
       
   161         * Checks if feature is supported.
       
   162         *
       
   163         * @param aFeature feature.
       
   164         * @return ETrue if supported.
       
   165         */
       
   166         virtual TBool IsFeatureSupported( TInt aFeature );
       
   167         
       
   168         virtual TInt GetTelephoneVariant();
       
   169 
       
   170     private:    // Data
       
   171 
       
   172 
       
   173         // Owned: Phone client emergency number session.
       
   174         CPhCltEmergencyCall* iEmergencyCall;
       
   175  
       
   176         CRepository* iRepository;
       
   177         
       
   178     };
       
   179 
       
   180 #endif      // CPHONEPARSERFEATURES_H
       
   181             
       
   182 // End of File