phoneapp/phoneuivoipextension/inc/cphonestateutilsvoip.h
changeset 0 5f000ab63145
child 65 2a5d4ab426d3
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     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:  Utility class for voip-states.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CPHONESTATEUTILSVOIP_H
       
    20 #define C_CPHONESTATEUTILSVOIP_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 class MPhoneStateMachine;
       
    25 class MPhoneViewCommandHandle;
       
    26 class CPhCltEmergencyCall;
       
    27 class CConvergedServiceSelector;
       
    28 
       
    29 /**
       
    30  *  Provides common utility functions for voip-states.
       
    31  *
       
    32  *  @lib PhoneUIVoIPExtension.dll
       
    33  *  @since S60 v5.1
       
    34  */
       
    35 NONSHARABLE_CLASS( CPhoneStateUtilsVoip ) : public CBase
       
    36     {
       
    37 
       
    38 public:
       
    39 
       
    40     /**
       
    41      * Two-phased constructor.
       
    42      * @param    aStateMachine       Handle to the state machine.
       
    43      * @param    aViewCommandHandle  Handle to the PhoneUIView.
       
    44      */
       
    45     static CPhoneStateUtilsVoip* NewL( MPhoneStateMachine& aStateMachine,
       
    46         MPhoneViewCommandHandle& aViewCommandHandle );
       
    47     
       
    48     /**
       
    49      * Two-phased constructor.
       
    50      * @param    aStateMachine       Handle to the state machine.
       
    51      * @param    aViewCommandHandle  Handle to the PhoneUIView.
       
    52      */
       
    53     static CPhoneStateUtilsVoip* NewLC( MPhoneStateMachine& aStateMachine,
       
    54         MPhoneViewCommandHandle& aViewCommandHandle );
       
    55     
       
    56     /**
       
    57      * Destructor.
       
    58      */
       
    59     virtual ~CPhoneStateUtilsVoip();
       
    60 
       
    61     /**
       
    62      * Dials a VoIP call.
       
    63      * 
       
    64      * @param   aNumber     Phone number.
       
    65      * @param   aServiceId  Service identifier.
       
    66      */
       
    67     void DialVoIPL( const TDesC& aNumber, TUint aServiceId = 0 );
       
    68     
       
    69     /**
       
    70      * Checks is VoIP preferred call type. If VoIP is preferred, service 
       
    71      * identifier is returned by the parameter aServiceId.
       
    72      * 
       
    73      * @param   aServiceId  Service identifier.
       
    74      * @return  ETrue if VoIP is preferred, EFalse otherwise.
       
    75      */
       
    76     TBool IsVoipPreferredCall( TUint& aServiceId );
       
    77     
       
    78     /**
       
    79      * Checks whether number entry contain VoIP number.
       
    80      * 
       
    81      * @return  ETrue if number entry contains VoIP number, EFalse otherwise.
       
    82      */
       
    83     TBool IsVoipNumber();
       
    84 
       
    85     /**
       
    86      * Selects VoIP service and makes dial.
       
    87      * 
       
    88      * @param  aNumber      Phone number.
       
    89      * @param  aServiceId   Service identifier for the call.
       
    90      */
       
    91     void SelectServiceAndDialL( const TDesC& aNumber = KNullDesC,
       
    92         TUint aServiceId = 0 );
       
    93 
       
    94     /**
       
    95      * Checks is the given number valid emergency number.
       
    96      * 
       
    97      * @param   aNumber     Number to be checked.
       
    98      * @return  ETrue if number is emergency number, EFalse otherwise.
       
    99      */
       
   100     TBool IsEmergencyNumber( const TDesC& aNumber ) const;
       
   101     
       
   102 private:
       
   103 
       
   104     CPhoneStateUtilsVoip( MPhoneStateMachine& aStateMachine,
       
   105         MPhoneViewCommandHandle& aViewCommandHandle );
       
   106 
       
   107     void ConstructL();
       
   108 
       
   109 private: // data
       
   110 
       
   111     /** 
       
   112      * Number entry string buffer.
       
   113      * Own.
       
   114      */
       
   115     HBufC* iBuffer;
       
   116 
       
   117     /** 
       
   118      * Phone client emergency call.
       
   119      * Own.
       
   120      */
       
   121     CPhCltEmergencyCall* iEmergencyCall;
       
   122     
       
   123     /** 
       
   124      * Service selector.
       
   125      * Own.
       
   126      */
       
   127     CConvergedServiceSelector* iServiceSelector;
       
   128     
       
   129     /**
       
   130      * Interface to the state machine.
       
   131      * Not own.
       
   132      */
       
   133     MPhoneStateMachine& iStateMachine;
       
   134     
       
   135     /**
       
   136      * Interface to the phone ui view.
       
   137      * Not own.
       
   138      */
       
   139     MPhoneViewCommandHandle& iViewCommandHandle;
       
   140     };
       
   141 
       
   142 
       
   143 #endif // C_CPHONESTATEUTILSVOIP_H