phoneapp/phoneuicontrol/inc/cphonecbamanager.h
changeset 74 d1c62c765e48
parent 65 2a5d4ab426d3
child 75 949d9e5675bf
child 76 cfea66083b62
equal deleted inserted replaced
65:2a5d4ab426d3 74:d1c62c765e48
     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: Class takes care of CBA's.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPHONECBAMANAGER_H
       
    20 #define CPHONECBAMANAGER_H
       
    21 
       
    22 //INCLUDES
       
    23 #include <e32base.h>
       
    24 
       
    25 //FORWARD
       
    26 class MPhoneViewCommandHandle;
       
    27 class MPhoneStateMachine;
       
    28 class CPhoneState;
       
    29 
       
    30 /**
       
    31  * Class takes care of CBA's.
       
    32  *
       
    33  * @lib phoneuicontrol
       
    34  * @since S60 v9.1
       
    35  */
       
    36 NONSHARABLE_CLASS( CPhoneCbaManager ) :  public CBase
       
    37     {
       
    38     public:
       
    39         
       
    40         /**
       
    41         * Creates new instance of CPhoneCbaManager
       
    42         * @param aStateMachine: a state machine
       
    43         * @param aViewCommandHandle: handle to the PhoneUIView
       
    44         * @return CPhoneCbaManager* object  
       
    45         */
       
    46         static CPhoneCbaManager* NewL(
       
    47                     CPhoneState* aState,
       
    48                     MPhoneViewCommandHandle& aViewCommandHandle,
       
    49                     MPhoneStateMachine& aStateMachine );
       
    50         /**
       
    51         * Destructor.
       
    52         */
       
    53         virtual ~CPhoneCbaManager();
       
    54         
       
    55     public:
       
    56 
       
    57         /**
       
    58         * Update CBA
       
    59         */
       
    60         IMPORT_C void UpdateCbaL( TInt aResource );
       
    61 
       
    62         /**
       
    63         * Set CBA
       
    64         */
       
    65         IMPORT_C void SetCbaL( TInt aResource );
       
    66         
       
    67         /**
       
    68         * Update incoming CBAs
       
    69         */
       
    70         IMPORT_C void UpdateIncomingCbaL( TInt aCallId );
       
    71         
       
    72     public:
       
    73         
       
    74         /**
       
    75         * Update In Call CBA
       
    76         */ 
       
    77         void UpdateInCallCbaL();
       
    78         
       
    79         /**
       
    80         * Sets the ringtone silenced status
       
    81         * @param aSilenceStatus, new status
       
    82         */
       
    83         void SetRingtoneSilencedStatus( const TBool aSilenceStatus );
       
    84         
       
    85         /**
       
    86         * Sets the soft reject status
       
    87         * @param aSoftRejectStatus, new status
       
    88         */
       
    89         void SetSoftRejectStatus( TBool aSoftRejectStatus );
       
    90         
       
    91         /**
       
    92         * Returns the soft reject status
       
    93         * @return Soft reject status
       
    94         */
       
    95         TBool SoftRejectStatus();
       
    96         
       
    97     private:
       
    98         
       
    99         /*
       
   100         * Updated Cba when Swivel state changes.
       
   101         */
       
   102         void UpdateCbaSwivelStateChangedL();
       
   103         
       
   104         /**
       
   105         * Check is alerting or active voice call
       
   106         */
       
   107         TBool IsVoiceCallAlertingOrActiveL();
       
   108         
       
   109         /**
       
   110         * Get silence cba resource when incomng call
       
   111         * @param aSoftRejectActivated Is soft reject activated or not
       
   112         * @return Resource id of CBA
       
   113         */
       
   114         TInt GetIncomingCallSilenceCBA( const TBool aSoftRejectActivated ); 
       
   115 
       
   116         /**
       
   117         * Sets soft reject flag
       
   118         */
       
   119         void SetSoftRejectDimmedFlag();
       
   120         
       
   121     private:
       
   122     
       
   123         /**
       
   124         * C++ default constructor.
       
   125         */
       
   126         CPhoneCbaManager(
       
   127                 CPhoneState* aState,
       
   128                 MPhoneViewCommandHandle& aViewCommandHandle,
       
   129                 MPhoneStateMachine& aStateMachine );
       
   130         
       
   131     private:
       
   132         
       
   133         // Not owned:
       
   134         CPhoneState* iState;
       
   135         MPhoneViewCommandHandle& iViewCommandHandle;
       
   136         MPhoneStateMachine& iStateMachine;
       
   137         
       
   138         // RingtoneSilenced flag.
       
   139         // This is used to determine if the ringtone
       
   140         // for incoming call is silenced. The information
       
   141         // is used while updating softkeys in method
       
   142         // UpdateIncomingCbaL only
       
   143         TBool iRingtoneSilenced;
       
   144         
       
   145         // Soft reject status flag
       
   146         TBool iSoftRejectStatus;
       
   147     };
       
   148 
       
   149 
       
   150 #endif // CPHONECBAMANAGER_H