callcontinuity/vcc/inc/tvccstate.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:   The base class for VCC state machine
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef TVCCSTATE_H
       
    21 #define TVCCSTATE_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <e32cmn.h> // HBufC
       
    26 #include <mccpcscall.h>
       
    27 #include <cccpcallparameters.h>
       
    28 
       
    29 #include "vccengpsproperty.h"
       
    30 #include "cconvergedcallprovider.h"
       
    31 
       
    32 //forward declarations
       
    33 class CVccPerformer;
       
    34 
       
    35 /**  Value for indicating unsuccesfull HO */
       
    36 const TUint KVccHoNok = 0;
       
    37 
       
    38 /**  Value for indicating succesfull HO */
       
    39 const TUint KVccHoOk = 1;
       
    40 
       
    41 /**
       
    42 * The base class for VCC state machine implementation.
       
    43 * Contains default implementations for the functions.
       
    44 * 
       
    45 *  @lib vccperformer.dll
       
    46 *  @since S60 3.2
       
    47 * 
       
    48 */
       
    49 class TVccState 
       
    50     {
       
    51 public:
       
    52     
       
    53     /**
       
    54     * Releases call
       
    55     * @since Series60 3.2
       
    56     * @param aCall Call to be removed
       
    57     * @param aProvs Reference to call provider array
       
    58     * @return Symbian error code
       
    59     */
       
    60     virtual TInt ReleaseCall( MCCPCall& aCall, 
       
    61                               RPointerArray<CConvergedCallProvider>& aProvs );
       
    62   
       
    63     /**
       
    64     * Gets the state name.
       
    65     * @since Series60 3.2 
       
    66     * @return Derived states name.
       
    67     */
       
    68     virtual TUint Name() const = 0;
       
    69     
       
    70     /**
       
    71     * Initiates a handover
       
    72     * @since Series60 3.2
       
    73     * @param aContext Reference to Performer object
       
    74     * @leave Symbian error code in error case. 
       
    75     */
       
    76     virtual void SwitchL( CVccPerformer& aContext );
       
    77      
       
    78 // From  MCCPCall - look alikes.    
       
    79     /**
       
    80     * Answers to an incoming call.
       
    81     * @since S60 3.2
       
    82     * @param aCall Reference to a call object
       
    83     * @return KErrNone if request was started succesfully. In that case plug-in 
       
    84     * must return MCCPCallObserver::ECCPStateAnswering.
       
    85     * @return KErrNotReady if call is not in ringing or queued state.
       
    86     * @return KErrNotSupported if call does not support queueing. Plug-in will 
       
    87     * disconnect the call in this case.
       
    88     */
       
    89     virtual TInt Answer( MCCPCall& aCall );
       
    90       
       
    91     /**
       
    92     * Rejects an incoming call.
       
    93     * @since S60 3.2
       
    94     * @param aCall Reference to a call object
       
    95     * @return KErrNone if request was started succesfully. 
       
    96     * @return KErrNotReady if call is not in ringing or queued state.
       
    97     */
       
    98     virtual TInt Reject( MCCPCall& aCall );
       
    99 
       
   100     /**
       
   101     * Reguests plug-in to queue the call. 
       
   102     * @since S60 3.2
       
   103     * @param aCall Reference to a call object
       
   104     * @return KErrNone if request was started succesfully. 
       
   105     * @return KErrNotReady if call is not in ringing state or call waiting is not supported at the moment.
       
   106     */
       
   107     virtual TInt Queue( MCCPCall& aCall );
       
   108 
       
   109     /**
       
   110     * Starts dialing to recipient
       
   111     * @since S60 3.2
       
   112     * @param aCall Reference to a call object
       
   113     * @return KErrNone if request was started succesfully. In this case plug-in must return 
       
   114     * MCCPCallObserver::ECCPStateDialling.
       
   115     * @return KErrNotReady if call is not in idle state.
       
   116     * @return KErrNotSupported If call is not mobile originated.
       
   117     */
       
   118     virtual TInt Dial( MCCPCall& aCall );
       
   119 
       
   120     /**
       
   121     * Call is ringing
       
   122     * @since S60 3.2
       
   123     * @param aCall Reference to a call object
       
   124     * @return KErrNone if request was started succesfully.
       
   125     * @return KErrNotReady if call is not in idle state.
       
   126     */
       
   127     virtual TInt Ringing( MCCPCall& aCall );
       
   128       
       
   129     /**
       
   130     * Ends an ongoing call.
       
   131     * @since S60 3.2
       
   132     * @param aContext Reference to a Performer object
       
   133     * @param aCall Reference to a call object
       
   134     * @return KErrNone if request was started succesfully.
       
   135     * @return KErrAlreadyExists if call is already in idle state.
       
   136     */
       
   137     virtual TInt HangUp( CVccPerformer& aContext, MCCPCall& aCall );
       
   138       
       
   139     /**
       
   140     * Cancels the ongoing request
       
   141     * @since S60 3.2
       
   142     * @param aCall Reference to a call object
       
   143     * @return KErrNone if request was started succesfully.
       
   144     */
       
   145     virtual TInt Cancel( MCCPCall& aCall );
       
   146       
       
   147     /**
       
   148     * Puts the specified call on hold.
       
   149     * @since S60 3.2
       
   150     * @param aCall Reference to a call object
       
   151     * @return KErrNone if request was started succesfully. 
       
   152     * @return KErrNotReady if call is not in connected state.
       
   153     * @return KErrAlreadyExists if call is already held 
       
   154     * (MCCPCallObserver::ECCPStateHold).
       
   155     */
       
   156     virtual TInt Hold( MCCPCall& aCall );
       
   157       
       
   158     /**
       
   159     * Resumes the call.
       
   160     * @since S60 3.2
       
   161     * @param aCall Reference to a call object
       
   162     * @return KErrNone if request was started succesfully.
       
   163     * @return KErrNotReady if call is not in on-hold state.
       
   164     * @return KErrAlreadyExists if call is already in connected state 
       
   165     * MCCPCallObserver::ECCPStateConnected.
       
   166     */
       
   167     virtual TInt Resume( MCCPCall& aCall );
       
   168       
       
   169     /**
       
   170     * Swaps a connected call to its opposite state, either active or on hold
       
   171     * @since S60 3.2
       
   172     * @param aCall Reference to a call object
       
   173     * @return KErrNone if request was started succesfully.
       
   174     * @return KErrNotReady if call is not on in holded or connected state.
       
   175     */
       
   176     virtual TInt Swap( MCCPCall& aCall );
       
   177       
       
   178     /**
       
   179     * Returns the remote party of the call.
       
   180     * @since S60 3.2
       
   181     * @param aCall Reference to a call object
       
   182     * @return remote party address,
       
   183     */
       
   184     virtual const TDesC& RemoteParty( const MCCPCall& aCall ) const;
       
   185 
       
   186     /**
       
   187     * Returns the dialled party information.
       
   188     * @since S60 3.2
       
   189     * @param aCall Reference to a call object
       
   190     * @return dialled party address,
       
   191     */
       
   192     virtual const TDesC& DialledParty( const MCCPCall& aCall ) const;
       
   193       
       
   194     /**
       
   195     * Return boolean value if the incoming call is forwarded or not.
       
   196     * @since S60 3.2
       
   197     * @param aCall Reference to a call object
       
   198     * @return ETrue if call is forwarded, else EFalse
       
   199     */
       
   200     virtual TBool IsCallForwarded( const MCCPCall& aCall ) const;
       
   201      
       
   202     /**
       
   203     * Returns boolean value if the call is mobile originated or not.
       
   204     * @since S60 3.2
       
   205     * @param aCall Reference to a call object
       
   206     * @return ETrue if call is mobile originated, otherwise EFalse
       
   207     */
       
   208     virtual TBool IsMobileOriginated( const MCCPCall& aCall ) const;
       
   209       
       
   210     /**
       
   211     * Returns the state of the call.
       
   212     * @since S60 3.2
       
   213     * @param aCall Reference to a call object
       
   214     * @return TCCPCallState The current state of the call
       
   215     */
       
   216     virtual MCCPCallObserver::TCCPCallState State( const MCCPCall& aCall ) const;
       
   217       
       
   218     /**
       
   219     * Returns call control caps for this call.
       
   220     * This tells for CCE what call can currently do.
       
   221     * @since S60 3.2
       
   222     * @param aCall Reference to a call object
       
   223     * @return Call control caps defined in MCCPCallObserver::TCCPCallControlCaps.
       
   224     */
       
   225     virtual MCCPCallObserver::TCCPCallControlCaps Caps( const MCCPCall& aCall ) const;     
       
   226     
       
   227     /**
       
   228     * Return if call secure status is specified or not.
       
   229     * @since Series 60 5.0
       
   230     * @param None.
       
   231     * @return TBool ETrue if security is specified, else EFalse.
       
   232     */
       
   233     virtual TBool SecureSpecified( const MCCPCall& aCall ) const;
       
   234     
       
   235     /**
       
   236     * Get call's secure status.
       
   237     * @since Series 60 3.2
       
   238     * @param aCall Reference to a call object
       
   239     * @return TBool ETrue if security is enabled, else EFalse.
       
   240     */
       
   241     virtual TBool IsSecured( const MCCPCall& aCall ) const;
       
   242       
       
   243     /**
       
   244 	* Set call parameters.
       
   245 	* @since S60 3.2
       
   246 	* @param aNewParams New call paramater information.
       
   247 	* @return none
       
   248 	*/
       
   249     virtual void SetParameters( const CCCPCallParameters& aNewParams );
       
   250 
       
   251     /**
       
   252 	* Cet call parameters.
       
   253 	* @since S60 3.2
       
   254 	* @param aCall Reference to a call object
       
   255 	* @return Current call paramater information.
       
   256 	*/
       
   257     virtual const CCCPCallParameters& Parameters( const MCCPCall& aCall ) const;
       
   258       
       
   259     /**
       
   260     * Returns currently used tone for the call. Used in case tones are needed to be played.
       
   261 	* See defenition for TCCPTone.
       
   262     * @since S60 3.2
       
   263     * @param aCall Reference to a call object
       
   264     * @return TCCPTone Used tone.
       
   265     */
       
   266     virtual TCCPTone Tone( const MCCPCall& aCall ) const;
       
   267       
       
   268     /**
       
   269     * Adds a new observer for MCCECall object. Called in MT call case. In MO 
       
   270     * case observer will be given at call construction.
       
   271     * Plug-in dependent feature if duplicates or more than one observers 
       
   272     * are allowed or not. Currently CCE will set only one observer.
       
   273     * @since S60 v3.2
       
   274     * @param aObserver Observer
       
   275     * @param aCall Reference to a call object
       
   276     * @return none
       
   277     * @leave system error if observer adding fails
       
   278     */
       
   279     virtual void AddObserverL( const MCCPCallObserver& aObserver, 
       
   280                                MCCPCall& aCall );
       
   281 
       
   282     /**
       
   283     * Remove an observer.
       
   284     * @since S60 v3.2
       
   285     * @param aObserver Observer
       
   286     * @param aCall Reference to a call object
       
   287     * @return KErrNone if removed succesfully. KErrNotFound if observer was not found.
       
   288     * Any other system error depending on the error.
       
   289     */
       
   290     virtual TInt RemoveObserver( const MCCPCallObserver& aObserver, 
       
   291                                  MCCPCall& aCall );
       
   292     
       
   293 //from MCCPCSCall - look alikes.
       
   294 
       
   295   /**
       
   296 	* Starts dialing to recipient
       
   297 	* @since S60 3.2
       
   298 	* @param aCallParams The call parameters used by the TSY (a TCallParamsPckg object)
       
   299 	* @param aCall Reference to a call object
       
   300     * @return KErrNone if request was started succesfully. 
       
   301     * @return KErrNotReady if call is not in idle state.
       
   302     * @return KErrNotSupported If call is not mobile originated.
       
   303     * @pre Call state is MCCPCallObserver::ECCPStateIdle and call type is MO.
       
   304     * @since S60 3.2
       
   305     */	
       
   306 	virtual TInt Dial( const TDesC8& aCallParams, MCCPCSCall& aCall );
       
   307 
       
   308 	/**
       
   309 	* Instruct to do no FDN checking when dialling.
       
   310 	* Needs to be called before every dial for each call separately.
       
   311 	* If this method is not called at all default is to use FDN. 
       
   312 	* Value will be reset to default when call goes back to disconnected state.
       
   313 	* @since S60 v3.2
       
   314 	* @param aCall Reference to a call object
       
   315 	* @return none
       
   316 	*/
       
   317 	virtual void NoFDNCheck( MCCPCSCall& aCall );
       
   318 
       
   319 	/**
       
   320 	* Returns call information
       
   321 	* @since S60 3.2
       
   322 	* @param aCallInfo TMobileCallInfoV3
       
   323 	* @param aCall Reference to a call object
       
   324 	* @return KErrNone if succesfull, otherwise another system wide error code
       
   325 	*/
       
   326 	virtual TInt GetMobileCallInfo( TDes8& aCallInfo, 
       
   327 	                                const MCCPCSCall& aCall  ) const;
       
   328 
       
   329 	/**
       
   330 	* Switch in the alternating call mode of an alternating call
       
   331 	* @since S60 3.2
       
   332 	* @param aCall Reference to a call object
       
   333     * @return KErrNone or system error code.
       
   334 	*/
       
   335 	virtual TInt SwitchAlternatingCall( MCCPCSCall& aCall );
       
   336 
       
   337 	/**
       
   338 	* Gets the calls data call capabilities
       
   339 	* @since S60 3.2
       
   340 	* @param aCaps TMobileCallDataCapsV1
       
   341 	* @param aCall Reference to a call object
       
   342 	* @return KErrNone if the function member was successful, 
       
   343 	* @return KErrNotSupported if call does not support circuit switched data, 
       
   344 	* @return KErrNotFound if this call is not a data call
       
   345 	*/
       
   346 	virtual TInt GetMobileDataCallCaps( TDes8& aCaps, 
       
   347 	                                    const MCCPCSCall& aCall ) const;
       
   348 	
       
   349     /**
       
   350     * Log dialed  number. SAT related, check if dialed number is to be logged or not.
       
   351     * @since S60 3.2
       
   352     * @param aCall Reference to a call object
       
   353     * @return Log dialed number or not.
       
   354     */
       
   355     virtual TBool LogDialedNumber( const MCCPCSCall& aCall ) const;	
       
   356 
       
   357 //from MCCPCallObserver - look alikes. 
       
   358     
       
   359  	/**
       
   360 	* An error has occurred concerning a specific call.
       
   361 	* @since S60 3.2
       
   362 	* @param aContext Reference to Performer object
       
   363 	* @param aError Error code.
       
   364 	* @param aCall Reference to a call object
       
   365 	* @return none
       
   366 	*/
       
   367 	virtual void ErrorOccurred( CVccPerformer& aContext, 
       
   368 	                            const TCCPError aError,
       
   369 	                            MCCPCall* aCall );
       
   370 
       
   371 	/**
       
   372 	* The state of the call has changed.
       
   373 	* @since S60 3.2
       
   374 	* @param aContext Reference to Performer object
       
   375 	* @param aState Call state.
       
   376 	* @param aCall Reference to a call object
       
   377 	* @return none
       
   378 	*/
       
   379 	virtual void CallStateChanged( CVccPerformer& aContext, 
       
   380 	        const MCCPCallObserver::TCCPCallState aState,
       
   381 	        MCCPCall* aCall );
       
   382 
       
   383 	/**
       
   384 	* The state of the call has changed with inband tone, meaning network is playing 
       
   385 	* the tone relating to the state.
       
   386 	* @since S60 3.2
       
   387 	* @param aContext Reference to Performer object
       
   388 	* @param aState Call state.
       
   389 	* @param aCall Reference to a call object
       
   390 	* @return none
       
   391 	*/
       
   392 	virtual void CallStateChangedWithInband( CVccPerformer& aContext, 
       
   393             const MCCPCallObserver::TCCPCallState aState,
       
   394             MCCPCall* aCall );
       
   395 
       
   396 	/**
       
   397 	* An event has occurred concerning a specific call.
       
   398 	* @since S60 3.2
       
   399 	* @param aContext Reference to Performer object
       
   400 	* @param aEvent Occurred event.
       
   401 	* @param aCall Reference to a call object
       
   402 	* @return none
       
   403 	*/
       
   404 	virtual void CallEventOccurred( CVccPerformer& aContext, 
       
   405 	        const MCCPCallObserver::TCCPCallEvent aEvent,
       
   406 	        MCCPCall* aCall );
       
   407 
       
   408 	/**
       
   409 	* Notifies changed call capabilities.
       
   410 	* @since S60 3.2
       
   411 	* @param aContext Reference to Performer object
       
   412 	* @param aCapsFlags New capabilities for the call
       
   413 	* @param aCall Reference to a call object
       
   414 	* @return none
       
   415 	*/
       
   416 	virtual void CallCapsChanged( CVccPerformer& aContext, 
       
   417 	                const TUint32 aCapsFlags,
       
   418 	                MCCPCall* aCall);
       
   419 
       
   420 protected:
       
   421  
       
   422     /**
       
   423     * Releases ongoing call.
       
   424     * @since Series60 3.2 
       
   425     * @param aContext Reference to Performer object
       
   426     * @param aCall Reference to a call object
       
   427     * @param aState Next call state
       
   428     * @param aHoValue Was the handover succesfull or not succesfull
       
   429     * @return KErrNone or Symbian error code
       
   430     */
       
   431     TInt ReleaseCall( CVccPerformer& aContext, MCCPCall& aCall, 
       
   432                       TVccState& aState, TUint aHoValue );
       
   433      
       
   434 	 /**
       
   435      * C++ Constructor
       
   436      */
       
   437      TVccState();
       
   438     };
       
   439 
       
   440 #endif      // TVCCSTATE_H
       
   441 
       
   442 // End of File