convergedcallengine/csplugin/inc/cspetelcallwaitingrequester.h
branchRCL_3
changeset 20 987c9837762f
parent 0 ff3b6d0fd310
equal deleted inserted replaced
19:7d48bed6ce0c 20:987c9837762f
       
     1 /*
       
     2 * Copyright (c) 2007 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:  Fetches call waiting status from ETel
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CSPETELCALLWAITINGREQUESTER_H
       
    20 #define CSPETELCALLWAITINGREQUESTER_H
       
    21 
       
    22 
       
    23 #include <e32base.h>
       
    24 #include <mccpcscall.h>
       
    25 #include <mccecall.h>
       
    26 #include <etelmm.h>
       
    27 
       
    28 class RMobilePhone;
       
    29 class CRetrieveMobilePhoneCWList;
       
    30 
       
    31 /**
       
    32 * Makes asynchronic request to ETel interface according to given request type.
       
    33 * Provides canceling via CActive::Cancel().
       
    34 * 
       
    35 */
       
    36 class CSPEtelCallWaitingRequester
       
    37         : public CActive
       
    38     {
       
    39         
       
    40     public:
       
    41         
       
    42         /**
       
    43         * Constructs the requester via two phase.
       
    44         *
       
    45         * @param aPhone mobile phone reference needed for reading cw setting
       
    46         * @return requester object
       
    47         */
       
    48         static CSPEtelCallWaitingRequester* NewL( RMobilePhone& aPhone );
       
    49         
       
    50         /**
       
    51         * C++ default destructor
       
    52         */
       
    53         virtual ~CSPEtelCallWaitingRequester( );
       
    54         
       
    55         /**
       
    56         * Makes the request. Note that ERequestTypeDial is made with a 
       
    57         * separate MakeDialRequest function.
       
    58         *
       
    59         * @since S60 3.2
       
    60         * @param aRequest type of request
       
    61         * @return ETrue if active, EFalse if not
       
    62         */
       
    63         void GetCallWaitingL( const CCCECallParameters& iParams,
       
    64                               TBool& aCallWaitingStatus );
       
    65         
       
    66 
       
    67     
       
    68     protected: // From CActive
       
    69         /**
       
    70         * From CActive
       
    71         * RunL
       
    72         * @since S60 3.2
       
    73         */
       
    74         void RunL();
       
    75         
       
    76         /**
       
    77         * From CActive
       
    78         * Cancels the monitor
       
    79         * @since S60 3.2
       
    80         */
       
    81         void DoCancel();
       
    82 
       
    83 
       
    84     private:
       
    85     
       
    86         /**
       
    87         * Requester can be inactive (from boot to first Cw request),
       
    88         * requesting value from network 
       
    89         *       (with first MT call that gets Queue-request from CCE),
       
    90         * or monitoring (after first request).
       
    91         */        
       
    92         enum ECSPCwRequesterMode {
       
    93             ECwRequesterInactive,
       
    94             ECwRequesterGetStarted,
       
    95             ECwRequesterMonitoring
       
    96         };
       
    97         
       
    98     private:
       
    99     
       
   100         /**
       
   101         * Constructor.
       
   102         * @param aPhone mobile phone reference needed for reading cw setting
       
   103         *
       
   104         */
       
   105         CSPEtelCallWaitingRequester::CSPEtelCallWaitingRequester(RMobilePhone& aPhone);
       
   106                               
       
   107         /**
       
   108         * Constructs the requester.
       
   109         *
       
   110         * @param aPhone phone reference
       
   111         */
       
   112         void CSPEtelCallWaitingRequester::ConstructL();
       
   113         
       
   114         /**
       
   115         * Starts monitoring call waiting setting.
       
   116         */
       
   117         void StartMonitoring();
       
   118         
       
   119         /**
       
   120         * Returns the call waiting status from call waiting status list by linetype.
       
   121         */
       
   122         void GetCallWaitingStatusByLineType( const CCCECallParameters& iParams,
       
   123                                              TBool& aCallWaitingStatus );
       
   124         
       
   125         
       
   126     private: // data
       
   127         
       
   128         /**
       
   129         * List of call waiting settings.
       
   130         * Own.
       
   131         */        
       
   132         CRetrieveMobilePhoneCWList* iList;
       
   133         
       
   134         /**
       
   135         * Making the asynchronous request synchronous.
       
   136         */ 
       
   137         CActiveSchedulerWait iWait;
       
   138         
       
   139         /**
       
   140         * Phone handle for listening cw status changes.
       
   141         */
       
   142         RMobilePhone& iPhone;
       
   143         
       
   144         /**
       
   145         * Cw status descriptor for reading changed cw status.
       
   146         */
       
   147         TPckgBuf<RMobilePhone::TMobilePhoneCWInfoEntryV1> iDesCwStatus;
       
   148         
       
   149         /**
       
   150         * Current mode according to the enumeration.
       
   151         */
       
   152         ECSPCwRequesterMode iMode;
       
   153         
       
   154         /**
       
   155         * Actual call waiting status for primary line: On/Off = True/False.
       
   156         */
       
   157         TBool iPrimaryLineCwStatus;
       
   158         
       
   159         /**
       
   160         * Actual call waiting status for aux line: On/Off = True/False.
       
   161         */
       
   162         TBool iAuxLineCwStatus;
       
   163     };
       
   164 
       
   165 #endif // CSPETELCALLWAITINGREQUESTER_H