convergedcallengine/csplugin/inc/csptransferprovider.h
branchRCL_3
changeset 20 987c9837762f
parent 0 ff3b6d0fd310
equal deleted inserted replaced
19:7d48bed6ce0c 20:987c9837762f
       
     1 /*
       
     2 * Copyright (c) 2007-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:  Header of CSPTransferProvider which provides methods and
       
    15 *                functionality to handle call transfering
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CSPTRANSFERPROVIDER_H
       
    21 #define CSPTRANSFERPROVIDER_H
       
    22 
       
    23 #include <e32base.h>
       
    24 #include <mccptransferprovider.h>
       
    25 #include <mccptransferobserver.h>
       
    26 
       
    27 class RMobileCall;
       
    28 class MCSPCallErrorObserver;
       
    29 class MCSPCommonInfo;
       
    30 
       
    31 /**
       
    32 * Call transfer methods.
       
    33 * MCCPCallObserver is used for errors, statuses, notifications etc
       
    34 *
       
    35 *  @since S60 3.2
       
    36 */
       
    37 class CSPTransferProvider : public CActive,
       
    38                             public MCCPTransferProvider
       
    39     {
       
    40     
       
    41     public:
       
    42         /**
       
    43         * Two phased constructing of the transfer provider instance.
       
    44         * @param aCall mobile call handle
       
    45         * @return the Transfer provider instance
       
    46         */
       
    47         static CSPTransferProvider* NewL( RMobileCall& aCall, 
       
    48                 MCSPCallErrorObserver& aErrorObserver,
       
    49                 MCSPCommonInfo& aCommonInfo );        
       
    50 
       
    51         /** 
       
    52         * Destructs the transfer provider.
       
    53         * @since S60 3.2
       
    54         */
       
    55         virtual ~CSPTransferProvider();
       
    56         
       
    57     public:
       
    58 
       
    59     // from base class MCCPTransferProvider
       
    60         /**
       
    61         * Attended transfer to given call recipient.
       
    62         * There exist a call between A-B and A-C. A wants to transfer the call
       
    63         * to B-C. A itself will not be inline in case the transfer is made 
       
    64         * succesfully.In above case C will be the aTransferTargetCall. B is 
       
    65         * the recipient of the current call between A-B - called on A's call
       
    66         * object transfer provider. The A-B call is on hold (optional).
       
    67         *
       
    68         * @param aTransferTargetCall Target receiver of the transferred call. 
       
    69         *                            In this case there exist a call.
       
    70         * @return In case of an immediate error returns system error code, 
       
    71         *         if request has been started returns KErrNone.
       
    72         * Actual request result indication comes via observer class
       
    73         */
       
    74         TInt AttendedTransfer( MCCPCall& aTransferTargetCall );
       
    75 
       
    76         /**
       
    77         * Attended transfer to given address. There does not need to be 
       
    78         * a current call between the given transfer target.
       
    79         * @param aTransferTarget Transfer target address
       
    80         * @return In case of an immediate error returns system error code,
       
    81         *         if request has been started returns KErrNone.
       
    82         * Actual request result indication comes via observer class
       
    83         */
       
    84         TInt AttendedTransfer( const TDesC& aTransferTarget );
       
    85 
       
    86         /**
       
    87         * Unattended transfer. Call is requested to be transferred to given
       
    88         * address. After ECCPRemoteTransferring event current call will be
       
    89         * disconnected and no transfer status is checked from the operation. 
       
    90         * @param aTransferTarget Address of the target
       
    91         * @return In case of an immediate error returns system error code, 
       
    92         *         if request has been started returns KErrNone.
       
    93         * Actual request result indication comes via observer class
       
    94         */
       
    95         TInt UnattendedTransfer( const TDesC& aTransferTarget );
       
    96 
       
    97         /**
       
    98         * Accept incoming call transfer request from the call remote party.
       
    99         * @param aAccept ETrue - accept transfer, 
       
   100         *                EFalse do not accept transfer request.
       
   101         * @return In case of an immediate error returns system error code, 
       
   102         *         if request has been started returns KErrNone.
       
   103         * Actual request result indication comes via observer class
       
   104         */
       
   105         TInt AcceptTransfer( const TBool aAccept );
       
   106           
       
   107         /**
       
   108         * When the other end of the call has requested call transfer to
       
   109         * third party it is notified to 
       
   110         * CCPCallCall::EventOccurred(ECCPRemoteTransferring).
       
   111         * The new recipient of the call can be fetched via this method.
       
   112         * @return New recipient for the call after transfer
       
   113         */
       
   114         const TDesC& TransferTarget() const;
       
   115         
       
   116         /**
       
   117         * Add an observer for transfer related events.
       
   118         * Plug-in dependent feature if duplicates or more than one observers 
       
   119         * are allowed or not. Currently CCE will set only one observer.
       
   120         * @since S60 v3.2
       
   121         * @param aObserver Observer
       
   122         * @leave system error if observer adding fails
       
   123         */
       
   124         void AddObserverL( const MCCPTransferObserver& aObserver );
       
   125 
       
   126         /**
       
   127         * Remove an observer.
       
   128         * @since S60 v3.2
       
   129         * @param aObserver Observer
       
   130         * @return KErrNone if removed succesfully
       
   131         *         KErrNotFound if observer was not found.
       
   132         *         Any other system error depending on the error.
       
   133         */
       
   134         TInt RemoveObserver( const MCCPTransferObserver& aObserver );
       
   135         
       
   136         /**
       
   137         * A transfer event has occurred concerning a specific call.
       
   138         * @since S60 3.2
       
   139         * @param aEvent Occurred event.
       
   140         */
       
   141         void TransferEventOccurred( 
       
   142             const MCCPTransferObserver::TCCPTransferEvent aEvent );
       
   143 
       
   144     // from base class CActive
       
   145     protected:
       
   146             /**
       
   147         * From CActive
       
   148         * RunL
       
   149         * @since S60 3.2
       
   150         */
       
   151         void RunL();
       
   152             
       
   153         /**
       
   154         * From CActive
       
   155         * Cancels the monitor
       
   156         * @since S60 3.2
       
   157         */
       
   158         void DoCancel();  
       
   159 
       
   160     private:
       
   161         /**
       
   162         * Constructs the provider
       
   163         *
       
   164         * @param aCall handle mobile call
       
   165         */
       
   166         CSPTransferProvider( RMobileCall& aCall, 
       
   167                              MCSPCallErrorObserver& aErrorObserver,
       
   168                              MCSPCommonInfo& aCommonInfo );
       
   169 
       
   170         /**
       
   171         * Constructing 2nd phase.
       
   172         */
       
   173         void ConstructL();
       
   174         
       
   175     private: // data
       
   176 
       
   177         /**
       
   178         * DTMF event observer.
       
   179         */
       
   180         RPointerArray<MCCPTransferObserver> iObservers;
       
   181             
       
   182         /**
       
   183         * Etel call object
       
   184         */
       
   185         RMobileCall& iCall;
       
   186         
       
   187         /**
       
   188         * Error observer;
       
   189         */
       
   190         MCSPCallErrorObserver& iErrorObserver;
       
   191         
       
   192         /**
       
   193         * Common information for calls.
       
   194         */
       
   195         MCSPCommonInfo& iCommonInfo;
       
   196 
       
   197 
       
   198 };
       
   199 
       
   200 #endif CSPTRANSFERPROVIDER_H