iptel_plat/vcc_api/inc/cvccperformer.h
branchRCL_3
changeset 21 f742655b05bf
parent 20 65a3ef1d5bd0
child 22 d38647835c2e
equal deleted inserted replaced
20:65a3ef1d5bd0 21:f742655b05bf
     1 /*
       
     2 * Copyright (c) 2006-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:   CCP reference plug-in implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CVCCPERFORMER_H
       
    19 #define CVCCPERFORMER_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <e32base.h>
       
    23 #include <e32cmn.h> // HBufC
       
    24 #include <mccpcallobserver.h> //CCP API
       
    25 #include <mccpcscall.h>//CCP API
       
    26 #include <cccpcallparameters.h>
       
    27 #include <cccecallparameters.h>
       
    28 
       
    29 #include "cconvergedcallprovider.h"
       
    30 #include "tvccstate.h"
       
    31 
       
    32 class CVccEngPsPropertyListener;
       
    33 class CVccEngPsProperty;
       
    34 class CVccHoTrigger;
       
    35 class CVccTransferProvider;
       
    36 
       
    37 /**
       
    38 * The class acts as a proxy forward the CCE. 
       
    39 * It forwards the call to the actual MCCP interface implementation 
       
    40 * and initiates new call if instructed to do the handover.
       
    41 * 
       
    42 *  @lib vccperformer.dll
       
    43 *  @since S60 3.2
       
    44 * 
       
    45 */
       
    46 class CVccPerformer : public CBase,
       
    47                    	  public MCCPCSCall,
       
    48                    	  public MCCPCallObserver
       
    49                    
       
    50     {
       
    51 public:
       
    52 
       
    53  	/*
       
    54  	* The c'tor
       
    55  	* @param aProviders Array or call providers
       
    56  	* @param aState State of the call to be created
       
    57  	* @param aVccHoTrigger Reference to handover trigger object
       
    58  	* @since S60 3.2
       
    59  	*/
       
    60     static CVccPerformer* NewL(RPointerArray<CConvergedCallProvider>& aProviders, 
       
    61     						   TVccState& aState, CVccHoTrigger& aVccHoTrigger,
       
    62     						   TBool aCsOriginated );
       
    63     
       
    64     /*
       
    65     * dtor
       
    66     */
       
    67     ~CVccPerformer();
       
    68     
       
    69     /**
       
    70      * Starts Handover procedure
       
    71      * @since S60 3.2
       
    72      * @param aValue Type and direction of the possible HO
       
    73      * @return void
       
    74      */
       
    75     void SwitchL( const TInt aValue );
       
    76 
       
    77     /**
       
    78     * Gets the observer for the call events
       
    79     * @since Series60 3.2
       
    80     * @return Call event observer 
       
    81     */
       
    82     MCCPCallObserver* CallObserver();
       
    83     
       
    84     
       
    85     /**
       
    86     * Makes run-time decision what technology to use for the call
       
    87     * @since Series60 3.2
       
    88     * @param aParameters Call parameters
       
    89     * @param aRecipient Recipient
       
    90     * @param aObserver Reference to call observer
       
    91     * @return Reference to created call object or leaves with Symbian error code
       
    92     */
       
    93     MCCPCall* CreatePrimaryCallL(const CCCPCallParameters& aParameters,
       
    94                           const TDesC& aRecipient,
       
    95                           const MCCPCallObserver& aObserver );
       
    96                           
       
    97     /**
       
    98     * handles incoming call
       
    99     * @since Series60 3.2
       
   100     * @param aCall Reference to call object
       
   101     * @return reference to this object
       
   102     */
       
   103     
       
   104     MCCPCall* IncomingCall( MCCPCall* aCall );
       
   105     
       
   106     /**
       
   107     * handles 3rd party mo call
       
   108     * @since Series60 3.2
       
   109     * @param aCall Reference to call object
       
   110     * @return reference to this object
       
   111     */
       
   112     MCCPCall* MoCall( MCCPCall* aCall );
       
   113     
       
   114     /**
       
   115     * Gets the actual implementation of the active call
       
   116     * @since Series60 3.2
       
   117     * @return reference to call object
       
   118     */
       
   119     MCCPCall* PrimaryCall();
       
   120     
       
   121     /**
       
   122     * returns cs provider
       
   123     * @since Series60 3.2
       
   124     * @return reference to CS call provider
       
   125     */
       
   126     CConvergedCallProvider& CsProvider();
       
   127     
       
   128     /**
       
   129     * returns ps provider
       
   130     * @since Series60 3.2
       
   131     * @return reference to PS call provider
       
   132     */
       
   133     CConvergedCallProvider& PsProvider();
       
   134                               
       
   135     /**
       
   136     * Changing the call object
       
   137     * @since Series60 3.2
       
   138     * @param aCall Reference to a new call object
       
   139     */                                            
       
   140     void SetCall( MCCPCall* aCall );                
       
   141 
       
   142     /**
       
   143     * Changing the call object
       
   144     * @since Series60 3.2
       
   145     * @param aCall Reference to a new call object
       
   146     * leaves with system error code
       
   147     */                                            
       
   148     void SetCallL( MCCPCall* aCall );                
       
   149 
       
   150                           
       
   151     /**
       
   152     * Releases call
       
   153     * @since Series60 3.2
       
   154     * @param aCall Call to be removed
       
   155     * @return Symbian error code
       
   156     */
       
   157     TInt ReleaseCall( MCCPCall& aCall );
       
   158     
       
   159     /**
       
   160     * Informat that the domain has been changed.
       
   161     * @since Series60 3.2
       
   162     */
       
   163     void HandoverReady();           
       
   164 
       
   165     /**
       
   166     * Creates an implementation for making handover
       
   167     * @since Series60 3.2
       
   168     * @param aParameters Call parameters
       
   169     * @param aRecipient Recipient
       
   170     * @param aObserver Reference to call observer
       
   171     */
       
   172     void CreateSecondaryCallL(const CCCPCallParameters& aParameters,
       
   173                                const TDesC& aRecipient,
       
   174                                const MCCPCallObserver& aObserver);
       
   175     /**
       
   176     * Returns created local implementation
       
   177     * @since Series60 3.2
       
   178     * @return local implementation for hand-over, NULL if not created.
       
   179     */                         
       
   180     MCCPCall* SecondaryCall();
       
   181     
       
   182     /**
       
   183     * Updates the current state with the next state
       
   184     * @since Series60 3.2
       
   185     * @param aState reference to a new call state
       
   186     */
       
   187     void SetState( TVccState& aState );
       
   188     
       
   189     /**
       
   190     * Returns current state name
       
   191     * @since Series60 3.2
       
   192     * @return current state, see state headers for the state names
       
   193     */
       
   194     TUint StateName() const;
       
   195     
       
   196     /**
       
   197     * Gets the notifier
       
   198     * @since Series60 3.2
       
   199     * @return the notifier to be used for the reporting hand-over process
       
   200     */
       
   201     CVccEngPsProperty& Notifier();
       
   202     
       
   203     /**
       
   204      * Activates the trigger if call is connected, stops otherwise
       
   205      * @since Series60 3.2
       
   206      * @param aActivation activate or deactivate trigger
       
   207      */
       
   208     void ActivateTrigger( TBool aActivation );
       
   209     
       
   210     /**
       
   211      * PS key is updated via this method, so that UI item is removed from 
       
   212      * in call Options menu when needed
       
   213      * @since Series60 3.2
       
   214      * @param aAllow to show or hide HO option in menu
       
   215      */
       
   216     void AllowHo( TBool aAllow );
       
   217 
       
   218     /**
       
   219      * PS key is updated via this method, so that UI item is removed from 
       
   220      * in call Options menu when needed
       
   221      * @since Series60 3.2
       
   222      * @param aAllow to show or hide HO option in menu
       
   223      * @leave with system wide error if fails 
       
   224      */
       
   225     void AllowHoL( TBool aAllow );
       
   226     
       
   227     /**
       
   228      * Checks own state after conference and starts trigger if state is connected.
       
   229      * @since Series60 3.2
       
   230      */
       
   231     void ConferenceEnded();    
       
   232 
       
   233     /**
       
   234      * Release secondary call leg, if needed, before calling destructor.
       
   235      * @since Series60 3.2
       
   236      */
       
   237     void ReleaseSecondaryCallLeg();
       
   238     
       
   239     /**
       
   240      * Save original RemoteParty and RemotePartyName, so that call bubble
       
   241      * stays intact also after handover
       
   242      */
       
   243     void SetRemoteParties();
       
   244     
       
   245     /**
       
   246      * Finds provider index number from array
       
   247      * @param aVoipIndex true if voip index should be searched, false if
       
   248      *                   cs index
       
   249      * @return index number from which the provider can be found, KErrNotFound
       
   250      *         if provider not found from array
       
   251      */
       
   252     TInt VoipProviderIndex( TBool aVoipIndexWanted );
       
   253     
       
   254       
       
   255 // from base class MCCPCall    
       
   256     /**
       
   257     * @see MCCPCall::Answer()
       
   258     */
       
   259     TInt Answer();
       
   260       
       
   261     /**
       
   262     * @see MCCPCall::Reject()
       
   263     */
       
   264     TInt Reject();
       
   265 
       
   266     /**
       
   267     * @see MCCPCall::Queue()
       
   268     */
       
   269     TInt Queue();
       
   270 
       
   271     /**
       
   272     * @see MCCPCall::Dial()
       
   273     */
       
   274     TInt Dial();
       
   275 
       
   276     /**
       
   277     * @see MCCPCall::Ringing()
       
   278     */
       
   279     TInt Ringing();
       
   280       
       
   281     /**
       
   282     * @see MCCPCall::HangUp()
       
   283     */
       
   284     TInt HangUp();
       
   285       
       
   286     /**
       
   287     * @see MCCPCall::Cancel()
       
   288     */
       
   289     TInt Cancel();
       
   290       
       
   291     /**
       
   292     * @see MCCPCall::Hold()
       
   293     */
       
   294     TInt Hold();
       
   295       
       
   296     /**
       
   297     * @see MCCPCall::Resume()
       
   298     */
       
   299     TInt Resume();
       
   300       
       
   301     /**
       
   302     * @see MCCPCall::Swap()
       
   303     */
       
   304     TInt Swap();
       
   305       
       
   306     /**
       
   307     * @see MCCPCall::RemoteParty()
       
   308     */
       
   309     const TDesC& RemoteParty() const;
       
   310 
       
   311     /**
       
   312     * @see MCCPCall::RemotePartyName()
       
   313     */
       
   314     const TDesC& RemotePartyName();
       
   315 
       
   316     /**
       
   317     * @see MCCPCall::DialledParty()
       
   318     */
       
   319     const TDesC& DialledParty() const;
       
   320       
       
   321     /**
       
   322     * @see MCCPCall::IsCallForwarded()
       
   323     */
       
   324     TBool IsCallForwarded() const;
       
   325      
       
   326     /**
       
   327     * @see MCCPCall::IsMobileOriginated()
       
   328     */
       
   329     TBool IsMobileOriginated() const;
       
   330       
       
   331     /**
       
   332     * @see MCCPCall::State()
       
   333     */
       
   334     MCCPCallObserver::TCCPCallState State() const;
       
   335       
       
   336     /**
       
   337     * @see MCCPCall::Uid()
       
   338     */
       
   339     TUid Uid() const;
       
   340       
       
   341     /**
       
   342     * @see MCCPCall::Caps()
       
   343     */
       
   344     MCCPCallObserver::TCCPCallControlCaps Caps() const;     
       
   345     
       
   346     /**
       
   347     * @see MCCPCall::SecureSpecified()
       
   348     */
       
   349     TBool SecureSpecified() const;
       
   350     
       
   351     /**
       
   352     * @see MCCPCall::IsSecured()
       
   353     */
       
   354     TBool IsSecured() const;
       
   355       
       
   356     /**
       
   357 	* @see MCCPCall::SetParameters()
       
   358 	*/
       
   359     void SetParameters( const CCCPCallParameters& aNewParams );
       
   360 
       
   361     /**
       
   362 	* @see MCCPCall::Parameters()
       
   363 	*/
       
   364     const CCCPCallParameters& Parameters() const;
       
   365       
       
   366     /**
       
   367 	* @see MCCPCall::Tone()
       
   368     */
       
   369     TCCPTone Tone() const;
       
   370       
       
   371 	/**
       
   372 	* @see MCCPCall::ForwardProviderL()
       
   373 	*/
       
   374 	MCCPForwardProvider* ForwardProviderL( const MCCPForwardObserver& aObserver );
       
   375 
       
   376 	/**
       
   377     * @see MCCPCall::TransferProviderL()
       
   378     */
       
   379 	MCCPTransferProvider* TransferProviderL( const MCCPTransferObserver& aObserver );
       
   380       
       
   381     /**
       
   382     * @see MCCPCall::AddObserverL()
       
   383     */
       
   384     void AddObserverL( const MCCPCallObserver& aObserver );
       
   385 
       
   386     /**
       
   387     * @see MCCPCall::RemoveObserver()
       
   388     */
       
   389     TInt RemoveObserver( const MCCPCallObserver& aObserver );
       
   390     
       
   391 //from base class MCCPCSCall
       
   392     
       
   393     /**
       
   394     * @see MCCPCSCall::Dial()
       
   395     */
       
   396 	TInt Dial( const TDesC8& aCallParams );
       
   397 
       
   398     /**
       
   399     * @see MCCPCSCall::NoFDNCheck()
       
   400     */
       
   401 	void NoFDNCheck();
       
   402 
       
   403     /**
       
   404     * @see MCCPCSCall::GetMobileCallInfo()
       
   405     */
       
   406 	TInt GetMobileCallInfo( TDes8& aCallInfo ) const;
       
   407 
       
   408     /**
       
   409     * @see MCCPCSCall::SwitchAlternatingCall()
       
   410     */
       
   411 	TInt SwitchAlternatingCall();
       
   412 
       
   413     /**
       
   414     * @see MCCPCSCall::GetMobileDataCallCaps()
       
   415     */
       
   416 	TInt GetMobileDataCallCaps( TDes8& aCaps ) const;
       
   417 	
       
   418     /**
       
   419     * @see MCCPCSCall::LogDialedNumber()
       
   420     */
       
   421     TBool LogDialedNumber() const;
       
   422     
       
   423     
       
   424 //from base class MCCPCallObserver
       
   425     
       
   426     /**
       
   427     * @see MCCPCallObserver::ErrorOccurred()
       
   428     */
       
   429 	void ErrorOccurred( const TCCPError aError, MCCPCall* aCall );
       
   430 
       
   431     /**
       
   432     * @see MCCPCallObserver::CallStateChanged()
       
   433     */
       
   434 	void CallStateChanged( const MCCPCallObserver::TCCPCallState aState, 
       
   435 	                       MCCPCall* aCall );
       
   436 
       
   437     /**
       
   438     * @see MCCPCallObserver::CallStateChangedWithInband()
       
   439     */
       
   440 	void CallStateChangedWithInband( const MCCPCallObserver::TCCPCallState aState,
       
   441 	                                 MCCPCall* aCall );
       
   442 
       
   443     /**
       
   444     * @see MCCPCallObserver::CallEventOccurred()
       
   445     */
       
   446 	void CallEventOccurred( const MCCPCallObserver::TCCPCallEvent aEvent, 
       
   447 	                        MCCPCall* aCall  );
       
   448 
       
   449     /**
       
   450     * @see MCCPCallObserver::CallCapsChanged()
       
   451     */
       
   452 	void CallCapsChanged( const TUint32 aCapsFlags, MCCPCall* aCall );
       
   453 	
       
   454 private:
       
   455 
       
   456     /**
       
   457     * constructor.
       
   458     */
       
   459     CVccPerformer(RPointerArray<CConvergedCallProvider>& aProviders,
       
   460     			  TVccState& aState, CVccHoTrigger& aVccHoTrigger,
       
   461     			  TBool aCsOriginated);
       
   462 
       
   463     /**
       
   464     * By default Symbian 2nd phase constructor is private.
       
   465     */
       
   466     void ConstructL();
       
   467     
       
   468        /**
       
   469     * Removes SIP-uri from remoteparty number if call is VoIP call
       
   470     */
       
   471     void ParseRemoteParty();
       
   472 
       
   473 private: // data
       
   474     
       
   475     /**
       
   476      * Call provider array
       
   477      * Not own
       
   478      */
       
   479 	RPointerArray<CConvergedCallProvider>& iProviders;
       
   480 
       
   481     
       
   482     /**
       
   483      * actual call implementation, can be changed run-time
       
   484      * Own
       
   485      */
       
   486 	MCCPCall* iPrimaryCall; 
       
   487 	
       
   488     /**
       
   489      * actual call implementation, created to perfome a handover
       
   490      * Own
       
   491      */
       
   492 	MCCPCall* iSecondaryCall; 
       
   493 	
       
   494     /**
       
   495      * remembering the call observer because it needs to change
       
   496      * Not own
       
   497      */
       
   498 	MCCPCallObserver* iCallObs;
       
   499 	
       
   500     /**
       
   501      * for informing the states
       
   502      * Own
       
   503      */
       
   504 	CVccEngPsProperty* iVccPsp;
       
   505 	
       
   506     /**
       
   507      * current state in case of the hand-over
       
   508      * Own
       
   509      */
       
   510 	TVccState* iCurrentState;
       
   511 	
       
   512     /**
       
   513      * trigger for initiating automatic HOs
       
   514      * Not own
       
   515      */
       
   516 	CVccHoTrigger& iVccHoTrigger;
       
   517 	
       
   518 	/**
       
   519 	 * Originating domain of the call
       
   520 	 * */
       
   521 	TBool iCsOriginated;
       
   522 
       
   523 	/**
       
   524 	 * Transfer provider for handling call transfer 
       
   525 	 * Own
       
   526 	 */
       
   527 	CVccTransferProvider* iTransferProvider;
       
   528 
       
   529 	/**
       
   530 	 *For storing the remote party information 
       
   531 	 */
       
   532 
       
   533 	TBuf<100> iOrigRemotePartyName;
       
   534 	TBuf<100> iOrigRemoteParty;
       
   535 	
       
   536 	TBool iRemotePartiesSet;
       
   537 	friend class T_CVccPerformer;
       
   538     };
       
   539 
       
   540 #endif      // CVCCPERFORMER_H
       
   541 
       
   542 // End of File