convergedcallengine/cce/inc/cccetransfercontroller.h
changeset 0 ff3b6d0fd310
child 19 7d48bed6ce0c
equal deleted inserted replaced
-1:000000000000 0:ff3b6d0fd310
       
     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:  Contains transfer handling logic
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CCCETRANSFERCONTROLLER_H
       
    20 #define CCCETRANSFERCONTROLLER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 #include "ccpdefs.h" // TCCPError defs
       
    25 
       
    26 #include "mccecallobserver.h"
       
    27 #include "mccpcallobserver.h"
       
    28 
       
    29 class CCCECallContainer;
       
    30 class MCCPCall;
       
    31 class MCCECall;
       
    32 class CCCECall;
       
    33 
       
    34 /**
       
    35  *  Contains transfer controlling logic
       
    36  *
       
    37  *  
       
    38  *
       
    39  *  @lib cce.dll
       
    40  *  @since S60 v3.2
       
    41  */
       
    42 NONSHARABLE_CLASS(CCCETransferController) : public CBase,
       
    43                                             public MCCPCallObserver
       
    44     {
       
    45 public:
       
    46     
       
    47     /** Defines all possible transfer types */
       
    48     enum TTransferType
       
    49         {
       
    50         ECCETypeNone,
       
    51         ECCETypeAttendedMT,
       
    52         ECCETypeAttendedMO,
       
    53         ECCETypeUnattended
       
    54         };
       
    55         
       
    56 public:
       
    57     /**
       
    58      * Two-phased constructor
       
    59      * @param aCallContainer Reference to callcontainer object
       
    60      */
       
    61     static CCCETransferController* NewL( CCCECallContainer& aCallContainer );
       
    62 
       
    63     /**
       
    64      * Destructor.
       
    65      */
       
    66     virtual ~CCCETransferController();
       
    67 
       
    68 
       
    69 // from base class MCCPCallObserver
       
    70 public:
       
    71     /**
       
    72     * An error has occurred concerning a specific call.
       
    73     * @since S60 3.2
       
    74     * @param aError Error code.
       
    75 	* @param aCall Current MCCPCall.
       
    76     * @return none
       
    77     */
       
    78     void ErrorOccurred( const TCCPError aError, MCCPCall* aCall ); 
       
    79       
       
    80     /**
       
    81     * The state of the call has changed.
       
    82     * @since S60 3.2
       
    83     * @param aState Call state.
       
    84     * @return none
       
    85     */
       
    86     void CallStateChanged( const MCCPCallObserver::TCCPCallState aState,
       
    87                            MCCPCall* aCall); 
       
    88 
       
    89     /**
       
    90     * The state of the call has changed.
       
    91     * @since S60 3.2
       
    92     * @param aState Call state.
       
    93 	* @param aCall Current MCCPCall.
       
    94     * @return none
       
    95     */
       
    96     void CallStateChangedWithInband( TCCPCallState aState, MCCPCall* aCall ); 
       
    97 
       
    98     /**
       
    99     * An event has occurred concerning a specific call.
       
   100     * @since S60 3.2
       
   101     * @param aEvent Occurred event.
       
   102 	* @param aCall Current MCCPCall.
       
   103     * @return none
       
   104     */
       
   105     void CallEventOccurred( const MCCPCallObserver::TCCPCallEvent aEvent, 
       
   106                             MCCPCall* aCall ); 
       
   107 
       
   108     /**
       
   109     * NOTE: change to:
       
   110     * virtual void CallCapsChanged( const MCCPCallObserver::TCCPCallControlCaps aCapsFlags ) = 0;
       
   111     * Notifies changed call capabilities
       
   112     * @since S60 3.2
       
   113     * @param aCaps New capabilities for the call
       
   114 	* @param aCall Current MCCPCall.
       
   115     * @return none
       
   116     */
       
   117     void CallCapsChanged( const TUint32 aCapsFlags, MCCPCall* aCall ); 
       
   118     
       
   119 public: // New methods
       
   120     
       
   121     /**
       
   122      * Handles transfer request coming from remote end
       
   123      * @since S60 3.2
       
   124      * @param aNewTransferCall New call which is used in transfer
       
   125      * @param aOriginator Call to be transferred
       
   126      * @param aAttended ETrue Attended EFalse Unattended
       
   127      * @return none
       
   128      */
       
   129     void HandleRemoteTransferRequest( MCCPCall* aNewTransferCall,
       
   130                                       MCCPCall* aOriginator, 
       
   131                                       TBool aAttented );
       
   132      
       
   133     /**
       
   134      * Handles incoming attended transfer call which replaces other call
       
   135      * @since S60 3.2
       
   136      * @param aNewTransferCall Incoming transfer call
       
   137      * @param aOriginator Call to be transferred (replaced)
       
   138      * @return none
       
   139      */
       
   140     void TransferCallIncoming( MCCPCall* aNewTransferCall,
       
   141                                MCCPCall* aOriginator );
       
   142     
       
   143     /**
       
   144      * Releases transfer call 
       
   145      * @since S60 3.2
       
   146      * @return none
       
   147      */
       
   148     void ReleaseTransferCall();
       
   149     
       
   150     /**
       
   151      * Returns ongoing transfer type 
       
   152      * @since S60 3.2
       
   153      * @return Ongoing transfer type
       
   154      */
       
   155     TTransferType OngoingTransferType() const;
       
   156     
       
   157     /**
       
   158      * Returns pointer to transfer call 
       
   159      * @since S60 3.2
       
   160      * @return Transfer call pointer
       
   161      */
       
   162     MCCPCall* TransferCall() const;
       
   163     
       
   164     /**
       
   165      * Returns pointer to call to be transferred 
       
   166      * @since S60 3.2
       
   167      * @return Original call pointer
       
   168      */
       
   169     MCCPCall* OriginatorCall() const;
       
   170     
       
   171     /**
       
   172      * Sets transfer accepted flag 
       
   173      * @since S60 3.2
       
   174      * @param aAccepted ETrue if user accepted unattended transfer
       
   175      * otherwise EFalse 
       
   176      * @return None
       
   177      */
       
   178     void SetTransferAccepted( TBool aAccepted );
       
   179     
       
   180     /**
       
   181      * Returns transfer accepted flag 
       
   182      * @since S60 3.2
       
   183      * @return Transfer accepted flag
       
   184      */
       
   185     TBool TransferAccepted() const;
       
   186     
       
   187     /**
       
   188      * Set flag indicating that transfer dial is pending 
       
   189      * @since S60 3.2
       
   190      * @return None
       
   191      */
       
   192     void SetTransferDialPending( TBool aDialPending );
       
   193     
       
   194     /**
       
   195      * Handles call state changes of transfer call and originator call 
       
   196      * @since S60 3.2
       
   197      * @param aCall Points to call which received status change
       
   198      * @param aStatus New status of the call
       
   199      * @return None
       
   200      */
       
   201     void HandleCallStateChanged( CCCECall* aCall,
       
   202             CCPCall::TCallState aStatus );
       
   203     
       
   204 private:
       
   205     
       
   206     /** Constructor */
       
   207     CCCETransferController( CCCECallContainer& aCallContainer );
       
   208         
       
   209     /**
       
   210      * Resets transfer controller to its initial state
       
   211      * @return None
       
   212      */
       
   213     void Reset();
       
   214    
       
   215 private:
       
   216     /**
       
   217      * Reference to call container 
       
   218      */
       
   219     CCCECallContainer& iCallContainer;
       
   220     
       
   221     /**
       
   222      * Ongoing transfer type 
       
   223      */
       
   224     TTransferType iOngoingTransferType;
       
   225     
       
   226     /**
       
   227      * CCE Call Id of the originator call 
       
   228      */
       
   229     TInt iOriginatorCallId;
       
   230     
       
   231     /**
       
   232      * Pointer to transfer call 
       
   233      * Not own
       
   234      */
       
   235     MCCPCall* iTransferCall;
       
   236     
       
   237     /**
       
   238      * Pointer to call to be transferred 
       
   239      * Not own
       
   240      */
       
   241     MCCPCall* iOriginatorCall;
       
   242     
       
   243     /**
       
   244      * Flag indicating transfer acception state 
       
   245      */
       
   246     TBool iTransferAccepted;
       
   247     
       
   248     /**
       
   249      * Flag indicating pending transfer dial 
       
   250      */
       
   251     TBool iTransferDialPending;
       
   252     
       
   253     /**
       
   254      * Pointer of a call which is currently being observed for call state
       
   255      * changes
       
   256      */
       
   257     MCCPCall* iObservedCall;
       
   258     };
       
   259     
       
   260     
       
   261 #endif