convergedcallengine/csplugin/inc/cspforwardprovider.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:  Header of CSPForwardProvider which provides methods and
       
    15 *                functionality to handle call forwarding
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CSPFORWARDPROVIDER_H
       
    21 #define CSPFORWARDPROVIDER_H
       
    22 
       
    23 #include <e32base.h>
       
    24 #include <mccpforwardprovider.h>
       
    25 #include <mccpforwardobserver.h>
       
    26 
       
    27 /**
       
    28 * Call forward methods.
       
    29 * MCCPCallObserver is used for errors, statuses, notifications etc
       
    30 *
       
    31 *  @since S60 3.2
       
    32 */
       
    33 class CSPForwardProvider : public CBase,
       
    34                            public MCCPForwardProvider
       
    35     {
       
    36     
       
    37     public:
       
    38         /**
       
    39         * Two phased constructing of the forward provider instance.
       
    40         * @return the Forward provider instance
       
    41         */
       
    42         static CSPForwardProvider* NewL();
       
    43 
       
    44         /** 
       
    45         * Destructs the forward provider.
       
    46         * @since S60 3.2
       
    47         */
       
    48         virtual ~CSPForwardProvider();
       
    49         
       
    50         /**
       
    51         * Updates the call event for observers.
       
    52         * @param aEvent the event to be notified
       
    53         */
       
    54         void NotifyForwardEventOccurred( 
       
    55                         MCCPForwardObserver::TCCPForwardEvent aEvent );
       
    56         
       
    57 // from base class MCCPForwardProvider
       
    58         
       
    59         /**
       
    60         * Returns pointer to array containing addresses to forward the call to.
       
    61         * Index zero contains the first address. If there are no addresses available
       
    62         * returns an empty array.
       
    63         * @return Reference to array containing addresses
       
    64         * @leave KErrNotReady call is not in forwarding state
       
    65         * @leave KErrNotSupported if call is not mobile originated
       
    66         * @leave system error code 
       
    67         * @pre Call state is MCCPCallObserver::ECCPStateForwarding and call type is MO
       
    68         * @pre Call MCCPForwardObserver::ECCPMultipleChoices event is received
       
    69         */
       
    70         virtual const CDesC8Array& GetForwardAddressChoicesL();
       
    71     
       
    72         /**
       
    73         * Forward call to address at given index.
       
    74         * @param aIndex Index of address where the call is to be forwarded. Address is 
       
    75         * found in the array received from GetForwardAddressChoicesL. Index starts from zero.
       
    76         * @leave KErrArgument Index is not in array
       
    77         * @leave KErrNotReady Call is not in forwarding state
       
    78         * @leave KErrNotSupported If call is not mobile originated
       
    79         * @pre Call state is MCCPCallObserver::ECCPStateForwarding and call type is MO
       
    80         * @pre Call MCCPForwardObserver::ECCPMultipleChoices event is received
       
    81         */
       
    82         virtual void ForwardToAddressL( const TInt aIndex );
       
    83         
       
    84         /**
       
    85         * Add an observer for forward related events.
       
    86         * Currently CCE will set only one observer.
       
    87         * @since S60 v3.2
       
    88         * @param aObserver Observer
       
    89         * @leave system error if observer adding fails
       
    90         */
       
    91         virtual void AddObserverL( const MCCPForwardObserver& aObserver );
       
    92     
       
    93         /**
       
    94         * Remove an observer.
       
    95         * @since S60 v3.2
       
    96         * @param aObserver Observer
       
    97         * @return KErrNone if removed succesfully. 
       
    98         * @return KErrNotFound if observer was not found.
       
    99         */
       
   100         virtual TInt RemoveObserver( const MCCPForwardObserver& aObserver );
       
   101 
       
   102     private:
       
   103         
       
   104         /**
       
   105         * Constructs the provider
       
   106         *
       
   107         */
       
   108         CSPForwardProvider( );
       
   109 
       
   110         /**
       
   111         * Constructing 2nd phase.
       
   112         */
       
   113         void ConstructL();
       
   114         
       
   115     private: // data
       
   116 
       
   117         /**
       
   118         * DTMF event observer.
       
   119         */
       
   120         RPointerArray<MCCPForwardObserver> iObservers;
       
   121         
       
   122         CDesC8Array* iEmptyArray;
       
   123             
       
   124 
       
   125 };
       
   126 
       
   127 #endif CSPFORWARDPROVIDER_H