telephonyserverplugins/common_tsy/commontsy/inc/mmtsy/cmmvoicecalltsy.h
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 /*
       
     2 * Copyright (c) 2006-2009 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:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CMMVOICECALLTSY_H
       
    21 #define CMMVOICECALLTSY_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include "cmmcalltsy.h"
       
    25 #include <ctsy/rmmcustomapi.h>
       
    26 
       
    27 #include "ctsysystemstatepluginhandler.h"
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class CMmVoiceLineTsy;
       
    31 class MTelephonyAudioControl;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36  *  CMmVoiceCallTsy contains extended voice call functionality that 
       
    37  *  is mode-dependent.
       
    38  */
       
    39 NONSHARABLE_CLASS( CMmVoiceCallTsy ) : public CMmCallTsy, 
       
    40                                        public MCtsySsmPluginCallback                                       
       
    41     {
       
    42     public:  // Constructors and destructor
       
    43         
       
    44         /**
       
    45          * Two-phased constructor.
       
    46          * @param aMmPhone Pointer to the Phone object
       
    47          * @param aMmLine Pointer to the Line from which this call object has 
       
    48          * been created.
       
    49          * @param aMode Call mode
       
    50          * @param aName Name of this call
       
    51          * @param aMessageManager Pointer to the Message Manager object
       
    52          * @param aTelephonyAudioControl Pointer Telephony Audio Control        
       
    53          * @return Created call object 
       
    54          */
       
    55         static CMmVoiceCallTsy* NewL( CMmPhoneTsy* aMmPhone, 
       
    56             CMmVoiceLineTsy* aMmLine, 
       
    57 		    RMobilePhone::TMobileService aMode, 
       
    58             TDes& aName, 
       
    59             CMmMessageManagerBase* aMessageManager,
       
    60             MTelephonyAudioControl* aTelephonyAudioControl );
       
    61         
       
    62         /**
       
    63          * Destructor.
       
    64          */
       
    65         ~CMmVoiceCallTsy();
       
    66 
       
    67         // New functions
       
    68 
       
    69         /**
       
    70          * Complete emergency call
       
    71          *          
       
    72          *
       
    73          * @param aResult Result of the request
       
    74          */
       
    75         void CompleteDialEmergencyCall( TInt aResult );
       
    76 
       
    77         /**
       
    78          * Complete hang up
       
    79          *          
       
    80          *
       
    81          * @param aResult Result of the request
       
    82          */
       
    83         void CompleteHangUp( TInt aResult );
       
    84 
       
    85         /**
       
    86          * Complete hold request
       
    87          *          
       
    88          *
       
    89          * @param aResult Result of the request
       
    90          */
       
    91         void CompleteHold( TInt aResult );
       
    92 
       
    93         /**
       
    94          * Complete resume request
       
    95          *          
       
    96          *
       
    97          * @param aResult Result of the request         
       
    98          */
       
    99         void CompleteResume( TInt aResult );
       
   100 
       
   101         /**
       
   102          * Complete swap request
       
   103          *          
       
   104          *
       
   105          * @param aResult Result of the request
       
   106          */
       
   107         void CompleteSwap( TInt aResult );
       
   108 
       
   109         /**
       
   110          * Completes GoOneToOne request
       
   111          *          
       
   112          *
       
   113          * @param aErrorCode error code
       
   114          */
       
   115         void CompleteGoOneToOne( TInt aErrorCode );
       
   116 
       
   117         /**
       
   118          * Complete status change notification
       
   119          *          
       
   120          *
       
   121          * @param aResult Result of the request
       
   122          * @param aDataPackage: new call status value
       
   123          */
       
   124         void CompleteNotifyStatusChange( TInt aResult, 
       
   125             CMmDataPackage* aDataPackage );
       
   126 
       
   127         /**
       
   128          * Fills current parameters of mobile call info 
       
   129          *          
       
   130          *
       
   131          * @param aInfo Pointer to mobile call information
       
   132          * @return Return value to ETel server
       
   133          */
       
   134         TInt FillMobileCallInfo( TDes8* aInfo );
       
   135 
       
   136 #ifdef REQHANDLE_TIMER
       
   137         /**
       
   138          * Calls the appropriate complete method due timer expiration
       
   139          *          
       
   140          *
       
   141          * @param aReqHandleType TSY request handle type.
       
   142          * @param aError Error value for completion
       
   143          */
       
   144         void Complete( TInt aReqHandleType, TInt aError );
       
   145 #endif
       
   146 		/**
       
   147          * Completes emergency nbr check for 3rd party clients
       
   148          *          
       
   149          * @param aIsEmergencyNbr boolean indicating check result
       
   150          */
       
   151 		void Complete3rdPartyCallNbrCheck( TBool aIsEmergencyNbr );
       
   152 
       
   153     public: // Functions from base classes
       
   154 
       
   155         /**
       
   156          * Returns request mode for given IPC number
       
   157          *          
       
   158          *
       
   159          * @param aIpc IPC number of the request
       
   160          * @return Request mode
       
   161          */
       
   162         CTelObject::TReqMode ReqModeL( const TInt aIpc );
       
   163 
       
   164         /**
       
   165          * Returns number of slots to be used for a given IPC
       
   166          *          
       
   167          *
       
   168          * @param aIpc IPC number of the request
       
   169          * @return Number of slots for this request
       
   170          */
       
   171         TInt NumberOfSlotsL( const TInt aIpc );
       
   172 
       
   173         /**
       
   174          * Cancels request that's IPC number and request handle are given as
       
   175          * parameters
       
   176          *          
       
   177          *
       
   178          * @param aIpc IPC number of the request
       
   179          * @param aTsyReqHandle Request handle from ETel server
       
   180          * @return KErrNone/KErrNotSupported
       
   181          */
       
   182         TInt CancelService( const TInt aIpc, 
       
   183             const TTsyReqHandle aTsyReqHandle );
       
   184 
       
   185         /**
       
   186          * Register given notification
       
   187          *          
       
   188          *
       
   189          * @param aIpc IPC number of the request
       
   190          * @return TInt Result of the request
       
   191          */
       
   192         TInt RegisterNotification( const TInt aIpc );
       
   193 
       
   194         /**
       
   195          * Deregister given notification
       
   196          *          
       
   197          *
       
   198          * @param aIpc IPC number of the request
       
   199          * @return Result of the request
       
   200          */
       
   201         TInt DeregisterNotification( const TInt aIpc );
       
   202 
       
   203         /**
       
   204          * Dials a call.
       
   205          *          
       
   206          *
       
   207          * @param aTsyReqHandle Tsy request handle
       
   208          * @param aCallParams Call parameters
       
   209          * @param aTelNumber Phone number to be called
       
   210          * @return KErrNone or KErrNotSupported
       
   211          */
       
   212         TInt Dial( const TTsyReqHandle aTsyReqHandle, 
       
   213             const TDesC8* aCallParams, TDesC* aTelNumber );
       
   214 
       
   215         /**
       
   216          * Answers to an incoming call
       
   217          *          
       
   218          *
       
   219          * @param aTsyReqHandle Request handle from the ETel server
       
   220          * @param aCallParams Call parameters
       
   221          * @return KErrNone/KErrNotSupported
       
   222          */
       
   223         TInt AnswerIncomingCall( const TTsyReqHandle aTsyReqHandle,
       
   224             const TDesC8* /*aCallParams*/ );
       
   225 
       
   226         /**
       
   227          * Hangs up the call
       
   228          *          
       
   229          *
       
   230          * @param aTsyReqHandle Request handle from ETel server
       
   231          * @return KErrNone/KErrNotSupported
       
   232          */
       
   233         TInt HangUp( const TTsyReqHandle aTsyReqHandle );
       
   234 
       
   235         /**
       
   236          * Returns bearer service information to the client.
       
   237          *          
       
   238          *
       
   239          * @param aTsyReqHandle TSY request handle
       
   240          * @param aBearerService Contains Bearer service info on return
       
   241          * @return KErrNotSupported
       
   242          */
       
   243         TInt GetBearerServiceInfo( const TTsyReqHandle /*aTsyReqHandle*/,
       
   244             RCall::TBearerService* /*aBearerService*/ );
       
   245 
       
   246         /**
       
   247          * Connects to an existing call (data calls).
       
   248          *          
       
   249          *
       
   250          * @param aTsyReqHandle Tsy request handle
       
   251          * @param aCallParams Call parameters
       
   252          * @return KErrNotSupported
       
   253          */
       
   254         TInt Connect( const TTsyReqHandle /*aTsyReqHandle*/,
       
   255             const TDesC8* /*aCallParams*/ );
       
   256         
       
   257         /**
       
   258          * Cancels connecting of a (data) call
       
   259          *          
       
   260          *
       
   261          * @param aTsyReqHandle Tsy request handle
       
   262          * @return KErrNotSupported
       
   263          */
       
   264         TInt ConnectCancel( const TTsyReqHandle /*aTsyReqHandle*/ );
       
   265 
       
   266         /**
       
   267          * Loans the dataport to the client.
       
   268          *          
       
   269          *
       
   270          * @param aTsyReqHandle TSY request handle
       
   271          * @param aCommPort Comm port
       
   272          * @return KErrNotSupported
       
   273          */
       
   274         TInt LoanDataPort( const TTsyReqHandle /*aTsyReqHandle*/,
       
   275             RCall::TCommPort* /*aCommPort*/ );
       
   276                 
       
   277         /**
       
   278          * Cancels dataport loaning.
       
   279          *          
       
   280          *
       
   281          * @param aTsyReqHandle Tsy request handle
       
   282          * @return KErrNotSupported
       
   283          */
       
   284         TInt LoanDataPortCancel( const TTsyReqHandle /*aTsyReqHandle*/ );
       
   285 
       
   286         /**
       
   287          * Recovers the dataport from the client.
       
   288          *          
       
   289          *
       
   290          * @param aTsyReqHandle
       
   291          * @return KErrNotSupported
       
   292          */
       
   293         TInt RecoverDataPort( const TTsyReqHandle /*aTsyReqHandle*/ );
       
   294 
       
   295         /**
       
   296          * Recovers the dataport from the client and relinquishes ownership.
       
   297          *          
       
   298          *
       
   299          * @return KErrNotSupported
       
   300          */
       
   301         TInt RecoverDataPortAndRelinquishOwnership();
       
   302         
       
   303         /**
       
   304          * Dial a call with NoFdn check
       
   305          *          
       
   306          *
       
   307          * @param aTsyReqHandle Tsy request handle
       
   308          * @param aCallParams Call parameters
       
   309          * @param aTelNumber Phone number to be called
       
   310          * @return Symbian error value 
       
   311          */
       
   312         TInt DialNoFdnCheck( const TTsyReqHandle aTsyReqHandle, 
       
   313             const TDesC8* aCallParams, TDesC* aTelNumber );
       
   314             
       
   315     public: // Functions from MCtsySsmPluginCallback
       
   316      	/**
       
   317          * This method is called from CMmCallGsmWcdmaExt, after 
       
   318          * sendinig request to LTSY         
       
   319          *
       
   320          * @param aResult -- result, returned either from SSM or from LTSY 
       
   321          */
       
   322          void SsmPluginCallback(TInt aResult, TCtsySsmCallbackData& aCallbackData);    	        
       
   323 
       
   324     protected:  // New functions
       
   325 
       
   326         /**
       
   327          * This method requests a private communication to the remote party of 
       
   328          * one call within a conference call.
       
   329          *          
       
   330          *
       
   331          * @param aTsyReqHandle Request handle from ETel server
       
   332          * @return KErrNone/KErrNotSupported
       
   333          */
       
   334         TInt GoOneToOneL( const TTsyReqHandle aTsyReqHandle );
       
   335 
       
   336         /**
       
   337          * Is this call an emergency call
       
   338          *          
       
   339          *
       
   340          * @return TRUE if emergency call, otherwise FALSE
       
   341          */
       
   342         TBool IsEmergencyCall() const;
       
   343 
       
   344         /**
       
   345          * Change emergency call mode
       
   346          *
       
   347          * @param aIsEmergency is call emergency call or normal call
       
   348          */
       
   349         void SetEmergencyMode( TBool aIsEmergency );
       
   350 
       
   351     private:  // Constructors and destructor
       
   352 
       
   353         /**
       
   354          * C++ default constructor.
       
   355          */
       
   356         CMmVoiceCallTsy();
       
   357         
       
   358         // new functions
       
   359         
       
   360         /**
       
   361          * Establishes call routing control and updates its state.
       
   362          * 
       
   363          * @param aCallName Call name
       
   364          * @param aMobileCallStatus Call status
       
   365          */
       
   366         void UpdateCallRoutingControl(  const TName& aCallName, 
       
   367 		                                RMobileCall::TMobileCallStatus aMobileCallStatus );
       
   368 
       
   369     private:  // Functions from base classes
       
   370 
       
   371         /**
       
   372          * Initialises miscellaneous internal attributes
       
   373          *          
       
   374          *
       
   375          */
       
   376         void InitInternalAttributes();
       
   377 
       
   378         /**
       
   379          * DoExtFuncL is called by the server when it has a "extended", 
       
   380          * i.e. non-core ETel request for the TSY. To process a request handle,
       
   381          * request type and request data are passed to the TSY. 
       
   382          *          
       
   383          *
       
   384          * @param aTsyReqHandle Request handle from ETel server
       
   385          * @param aIpc IPC number of the request
       
   386          * @param aPackage Reference to the input parameters.
       
   387          * @return KErrNone/KErrNotSupported
       
   388          */
       
   389         TInt DoExtFuncL( const TTsyReqHandle aTsyReqHandle, 
       
   390             const TInt aIpc, const TDataPackage& aPackage );
       
   391 
       
   392         /**
       
   393          * Sets the call on hold
       
   394          *          
       
   395          *
       
   396          * @param aTsyReqHandle TSY request handle
       
   397          * @return Return value to the ETel Server
       
   398          */
       
   399         TInt HoldL( const TTsyReqHandle aTsyReqHandle );
       
   400  
       
   401         /**
       
   402          * Resumes a held call
       
   403          *          
       
   404          *
       
   405          * @param aTsyReqHandle TSY request handle
       
   406          * @return Return value to the ETel Server
       
   407          */
       
   408         TInt ResumeL( const TTsyReqHandle aTsyReqHandle );
       
   409 
       
   410         /**
       
   411          * Swaps between the active and held call
       
   412          *          
       
   413          *
       
   414          * @param aTsyReqHandle TSY request handle
       
   415          * @return Return value to the ETel Server
       
   416          */
       
   417         TInt SwapL( const TTsyReqHandle aTsyReqHandle );
       
   418 
       
   419         /**
       
   420          * Creates an emergency call
       
   421          *          
       
   422          *
       
   423          * @param aTsyReqHandle TSY request handle
       
   424          * @param aNumber Emergency number
       
   425          * @return Return value to the ETel Server
       
   426          */
       
   427         TInt DialEmergencyCall( const TTsyReqHandle aTsyReqHandle, 
       
   428             const TDataPackage& aNumber);
       
   429         
       
   430         /**
       
   431          * Cancels creation of an emergency call
       
   432          *
       
   433          *          
       
   434          * @param aTsyReqHandle TSY request handle
       
   435          * @return Return value to the ETel Server
       
   436          */
       
   437         TInt DialEmergencyCallCancel( const TTsyReqHandle aTsyReqHandle );
       
   438 
       
   439 #ifdef REQHANDLE_TIMER
       
   440         /**
       
   441          * Chooses the type of response, automatic or common
       
   442          *          
       
   443          *
       
   444          * @param aReqHandleType TSY request handle type.
       
   445          * @param aTsyReqHandle TSY request handle to be stored.
       
   446          */
       
   447         void SetTypeOfResponse( const TInt aReqHandleType, 
       
   448             const TTsyReqHandle aTsyReqHandle );
       
   449 #endif
       
   450 
       
   451     public: //Data
       
   452           		
       
   453         /**
       
   454          * Boolean indicating number check state for 3rd party clients
       
   455          */        
       
   456         TBool i3rdPartyEmergencyNumberCheckDone;
       
   457 
       
   458         /**
       
   459          * Emergency number check mode 
       
   460          */  		 
       
   461         RMmCustomAPI::TEmerNumberCheckMode iNumberCheckMode;
       
   462 
       
   463     private: //Data
       
   464 
       
   465         /**
       
   466         * Temporary store for call params
       
   467         */        
       
   468         const TDesC8* iISVCallParams;
       
   469 
       
   470         /**
       
   471          * Dial made by 3rd Party client
       
   472          */
       
   473         TBool iIsDialISV;
       
   474 
       
   475     };
       
   476 
       
   477 #endif      // CMMVOICECALLTSY_H
       
   478             
       
   479 // End of File