cellular/telephonysettings/xqbindings/psetwrapper/tsrc/mocks/mock_cphcltemergencycall.h
branchRCL_3
changeset 20 987c9837762f
parent 19 7d48bed6ce0c
child 21 0a6dd2dc9970
equal deleted inserted replaced
19:7d48bed6ce0c 20:987c9837762f
     1 /*
       
     2 * Copyright (c) 2009 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:
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CPHCLTEMERGENCYCALLMOCK_H
       
    19 #define CPHCLTEMERGENCYCALLMOCK_H
       
    20 
       
    21 #include <e32base.h>
       
    22 #include <cphcltemergencycall.h>
       
    23 
       
    24 // FORWARD DECLARATIONS
       
    25 class MPhCltEmergencyCallObserver;
       
    26 
       
    27 // CLASS DECLARATION
       
    28 /**
       
    29 *   Phone Client Emergency Call Api for emergency number query
       
    30 *   and emergency dialing.
       
    31 *
       
    32 *   @lib phoneclient.lib
       
    33 *   @since SeriesS60_3.2
       
    34 */
       
    35 class CPhCltEmergencyCallMock : public CPhCltEmergencyCall
       
    36     {
       
    37     public:
       
    38         static TBool iSimulateEmergencyNumberMatch;
       
    39     
       
    40     public:  // Constructors and destructor
       
    41  
       
    42         /**
       
    43         * Create an instance that implements the interface.
       
    44         *
       
    45         * @param aObserver It is the observer for the instance.
       
    46         * @return Returns the created instance.
       
    47         */
       
    48         static CPhCltEmergencyCallMock* NewL( 
       
    49             MPhCltEmergencyCallObserver* aObserver );
       
    50 
       
    51     public: // New functions    
       
    52         
       
    53        /**
       
    54         * Returns information whether the number specified was an emergency number.
       
    55         * 
       
    56         * @param aNumber Number to be queried. aNumber might contain prefix (SS code)
       
    57         *                and/or postfix (DTMF part).  
       
    58         *                The aNumber parameter should be a buffer and the 
       
    59         *                clients are provided with a typedef called 
       
    60         *                TPhCltEmergencyNumber.
       
    61         *
       
    62         * @param aIsEmergencyNumber If ETrue, then the aNumber 
       
    63         *                           parameter included emergency number.
       
    64         * @return Returns error code of the success of the operation.
       
    65         */
       
    66         TInt IsEmergencyPhoneNumber( const TDesC& aNumber, 
       
    67             TBool& aIsEmergencyNumber );
       
    68 
       
    69         /**
       
    70         * Method can be used to check if the number specified contains 
       
    71         * a valid emergency number in the end of the number.
       
    72         * 
       
    73         * @param aNumber Number to be queried, matched emergency number 
       
    74         *                is returned in this parameter.
       
    75         *                The aNumber parameter should be a buffer and the 
       
    76         *                clients are provided with a typedef called 
       
    77         *                TPhCltTelephoneNumber.
       
    78         *             
       
    79         * @param aIsEmergencyNumber If ETrue, then the aNumber parameter 
       
    80         *                           was emergency number. 
       
    81         * @return Returns error code of the success of the operation.
       
    82         */
       
    83         TInt FindEmergencyPhoneNumber( TDes& aNumber, 
       
    84             TBool& aIsEmergencyNumber );
       
    85 
       
    86         /**
       
    87         * Initiates an emergency call.
       
    88         *
       
    89         * @param aNumber Emergency number to be dialed.
       
    90         *                The aNumber parameter should be a buffer and the 
       
    91         *                clients are provided with a typedef called 
       
    92         *                TPhCltEmergencyNumber. 
       
    93         *
       
    94         *                If the aNumber parameter supplies an "empty" buffer 
       
    95         *                the call is created either dialing the default emergency 
       
    96         *                phone number or use the SET UP EMERGENCY request  
       
    97         *                that does not contain a  dialling number.
       
    98         *
       
    99         *                Leaves with KErrArgument, if parameter aNumber was
       
   100         *                not an emergency number.
       
   101         *
       
   102         * @pre IsActive() returns EFalse, otherwise leaves with KErrInUse.
       
   103         */
       
   104         void DialEmergencyCallL( const TDesC& aNumber );
       
   105         
       
   106         /**
       
   107         * Returns information whether the number specified was an emergency 
       
   108         * number and also returns the plain emergency number.
       
   109         * 
       
   110         * @param aNumber Number to be queried.aNumber might contain prefix (SS code)
       
   111         *                and/or postfix (DTMF part).
       
   112         *                The aNumber parameter should be a buffer and the 
       
   113         *                clients are provided with a typedef called 
       
   114         *                TPhCltEmergencyNumber. 
       
   115         *
       
   116         * @param aMatchedEmergencyNumber Matched emergencynumber without prefix or 
       
   117         *                postfix is returned in this parameter. The aMatchedEmergencyNumber 
       
   118         *                parameter should be a buffer and the clients are
       
   119         *                provided with atypedef called TPhCltEmergencyNumber.
       
   120         * 
       
   121         * @param aIsEmergencyNumber If ETrue, then the aNumber 
       
   122         *                           parameter included emergency number.
       
   123         *
       
   124         * @return Returns error code of the success of the operation.
       
   125         */
       
   126         TInt IsEmergencyPhoneNumber( const TDesC& aNumber,
       
   127             TDes& aMatchedEmergencyNumber, TBool& aIsEmergencyNumber );                    
       
   128         
       
   129     protected:
       
   130 
       
   131         /**
       
   132         * C++ constructor.
       
   133         */
       
   134         CPhCltEmergencyCallMock( MPhCltEmergencyCallObserver* aObserver );
       
   135         
       
   136         void RunL();
       
   137         
       
   138         void DoCancel();
       
   139 
       
   140     };
       
   141 
       
   142 #endif      // CPHCLTEMERGENCYCALLMOCK_H
       
   143 
       
   144 // End of File