telephonyserverplugins/common_tsy/commontsy/inc/mmtsy/cmmfaxcalltsy.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 CMMFAXCALLTSY_H
       
    21 #define CMMFAXCALLTSY_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <et_phone.h>
       
    25 #include "cmmcalltsy.h"
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CMmFaxLineTsy;
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /**
       
    33  * CMmFaxCallTsy contains extended fax call functionality that is mode-dependent
       
    34  */
       
    35 NONSHARABLE_CLASS( CMmFaxCallTsy ) : public CMmCallTsy
       
    36     {
       
    37         friend class CMmFaxExt;
       
    38         friend class CMmFaxExtStub;
       
    39             
       
    40     public:  // Constructors and destructor
       
    41         
       
    42         /**
       
    43          * Two-phased constructor.
       
    44          * @param aMmPhone Pointer to the Phone object
       
    45          * @param aMmLine Pointer to the Line from which this call object has 
       
    46          * been created.
       
    47          * @param aMode Call mode
       
    48          * @param aName Name of this call
       
    49          * @param aMessageManager Pointer to the Message Manager object
       
    50          * @return Created call object 
       
    51          */
       
    52         static CMmFaxCallTsy* NewL( CMmPhoneTsy* aMmPhone, 
       
    53             CMmFaxLineTsy* aMmLine, RMobilePhone::TMobileService aMode, 
       
    54             TDes& aName, CMmMessageManagerBase* aMessageManager);
       
    55         
       
    56         /**
       
    57          * Destructor.
       
    58          */
       
    59         ~CMmFaxCallTsy();
       
    60 
       
    61         // New functions
       
    62 
       
    63         /**
       
    64          * Complete status change notification
       
    65          *          
       
    66          *
       
    67          * @param aResult Result of the request
       
    68          * @param aDataPackage: new call status value
       
    69          */
       
    70         void CompleteNotifyStatusChange( TInt aResult, 
       
    71             CMmDataPackage* aDataPackage );
       
    72 
       
    73         // Functions from base classes
       
    74 
       
    75         /**
       
    76          * Opens a fax object using given name
       
    77          *          
       
    78          *
       
    79          * @param aName Object name that should be opened
       
    80          * @return Opened object 
       
    81          */
       
    82         CTelObject* OpenNewObjectByNameL( const TDesC& aName );
       
    83  
       
    84         /**
       
    85          * Returns request mode for given IPC number
       
    86          *          
       
    87          *
       
    88          * @param aIpc IPC number of the request
       
    89          * @return Request mode
       
    90          */
       
    91         CTelObject::TReqMode ReqModeL( const TInt aIpc );
       
    92 
       
    93         /**
       
    94          * Returns number of slots to be used for a given IPC
       
    95          *          
       
    96          *
       
    97          * @param aIpc IPC number of the request
       
    98          * @return Number of slots for this request
       
    99          */
       
   100         TInt NumberOfSlotsL( const TInt aIpc );
       
   101 
       
   102         /**
       
   103          * Cancels request that's IPC number and request handle are given as         
       
   104          * parameters
       
   105          *          
       
   106          *
       
   107          * @param aIpc: IPC number of the request
       
   108          * @param aTsyReqHandle Request handle from ETel server
       
   109          * @return KErrNone/KErrNotSupported
       
   110          */
       
   111         TInt CancelService( const TInt aIpc, 
       
   112             const TTsyReqHandle aTsyReqHandle );
       
   113 
       
   114         /**
       
   115          * Register given notification
       
   116          *          
       
   117          *
       
   118          * @param aIpc IPC number of the request
       
   119          * @return Result of the request
       
   120          */
       
   121         TInt RegisterNotification( const TInt aIpc );
       
   122 
       
   123         /**
       
   124          * Deregister given notification
       
   125          *          
       
   126          *
       
   127          * @param aIpc IPC number of the request
       
   128          * @return Result of the request
       
   129          */
       
   130         TInt DeregisterNotification( const TInt aIpc );
       
   131 
       
   132         /**
       
   133          * Transfers call ownership.
       
   134          *          
       
   135          *
       
   136          * @param aTsyReqHandle TSY request handle
       
   137          * @return KErrNone
       
   138          */
       
   139         TInt TransferOwnership( const TTsyReqHandle aTsyReqHandle );
       
   140 
       
   141         /**
       
   142          * Acquires ownership.
       
   143          *          
       
   144          *
       
   145          * @param aTsyReqHandle TSY request handle
       
   146          * @return KErrNone
       
   147          */
       
   148         TInt AcquireOwnership( const TTsyReqHandle aTsyReqHandle );
       
   149         
       
   150         /**
       
   151          * Cancels method for AcquireOwnership.
       
   152          *          
       
   153          *
       
   154          * @param aTsyReqHandle TSY request handle
       
   155          * @return KErrNone
       
   156          */
       
   157         TInt AcquireOwnershipCancel(
       
   158             const TTsyReqHandle aTsyReqHandle );
       
   159         
       
   160         /**
       
   161          * Relinquishes ownership.
       
   162          *          
       
   163          *
       
   164          * @return KErrNone
       
   165          */
       
   166         TInt RelinquishOwnership();
       
   167 
       
   168         /**
       
   169          * Get call ownership status.
       
   170          *          
       
   171          *
       
   172          * @param aTsyReqHandle TSY request handle
       
   173          * @param aOwnershipStatus Ownership status
       
   174          * @return KErrNone
       
   175          */
       
   176         TInt GetOwnershipStatus(
       
   177             const TTsyReqHandle aTsyReqHandle,
       
   178             RCall::TOwnershipStatus* aOwnershipStatus );
       
   179 
       
   180         /**
       
   181          * Dials a call.
       
   182          *
       
   183          *          
       
   184          * @param aTsyReqHandle Tsy request handle
       
   185          * @param aCallParams Call parameters
       
   186          * @param aTelNumber Phone number to be called
       
   187          * @return KErrNone or KErrNotSupported
       
   188          */
       
   189         TInt Dial( const TTsyReqHandle aTsyReqHandle, 
       
   190             const TDesC8* aCallParams, TDesC* aTelNumber );
       
   191 
       
   192         /**
       
   193          * Cancels dialling.
       
   194          *          
       
   195          *
       
   196          * @param aTsyReqHandle Tsy request handle
       
   197          * @return KErrNone, KErrNotSupported, KErrInUse or KErrGeneral
       
   198          */
       
   199         TInt DialCancel( const TTsyReqHandle aTsyReqHandle );
       
   200 
       
   201         /**
       
   202          * Answers to an incoming call
       
   203          *          
       
   204          *
       
   205          * @param aTsyReqHandle Request handle from the ETel server
       
   206          * @param aCallParams Call parameters
       
   207          * @return KErrNone/KErrNotSupported
       
   208          */
       
   209         TInt AnswerIncomingCall( const TTsyReqHandle aTsyReqHandle,
       
   210             const TDesC8* aCallParams );
       
   211 
       
   212         /**
       
   213          * Cancels answering to an incoming call
       
   214          *          
       
   215          *
       
   216          * @param aTsyReqHandle Request handle from the ETel server
       
   217          * @return KErrNone/KErrNotSupported
       
   218          */
       
   219         TInt AnswerIncomingCallCancel( 
       
   220             const TTsyReqHandle aTsyReqHandle );
       
   221 
       
   222         /**
       
   223          * Hangs up the call
       
   224          *          
       
   225          *
       
   226          * @param aTsyReqHandle Request handle from ETel server
       
   227          * @return KErrNone/KErrNotSupported
       
   228          */
       
   229         TInt HangUp( const TTsyReqHandle aTsyReqHandle );
       
   230 
       
   231         /**
       
   232          * Returns bearer service information to the client.
       
   233          *          
       
   234          *
       
   235          * @param aTsyReqHandle TSY request handle
       
   236          * @param aBearerService Contains Bearer service info on return
       
   237          * @return KErrNone
       
   238          */
       
   239         TInt GetBearerServiceInfo( const TTsyReqHandle aTsyReqHandle,
       
   240             RCall::TBearerService* );
       
   241 
       
   242         /**
       
   243          * Set correct data call attributes, depending on parameter extension.
       
   244          *          
       
   245          *
       
   246          * @param aTsyReqHandle Tsy request handle
       
   247          * @param aCallParams Call parameters
       
   248          * @return KErrNone/KErrArgument
       
   249          */
       
   250         TInt Connect( const TTsyReqHandle aTsyReqHandle,
       
   251             const TDesC8* aCallParams );
       
   252         
       
   253         /**
       
   254          * Cancels connecting of a (data) call
       
   255          *          
       
   256          *
       
   257          * @param aTsyReqHandle Tsy request handle
       
   258          * @return KErrNone
       
   259          */
       
   260         TInt ConnectCancel( const TTsyReqHandle /*aTsyReqHandle*/ );
       
   261 
       
   262         /**
       
   263          * Loans the dataport to the client.
       
   264          *          
       
   265          *
       
   266          * @param aTsyReqHandle TSY request handle
       
   267          * @param aCommPort Comm port
       
   268          * @return KErrNone
       
   269          */
       
   270         TInt LoanDataPort( const TTsyReqHandle aTsyReqHandle,
       
   271             RCall::TCommPort* aCommPort );
       
   272                 
       
   273         /**
       
   274          * Cancels dataport loaning.
       
   275          *          
       
   276          *
       
   277          * @param aTsyReqHandle Tsy request handle
       
   278          * @return KErrNone
       
   279          */
       
   280         TInt LoanDataPortCancel( const TTsyReqHandle /*aTsyReqHandle*/ );
       
   281         
       
   282         /**
       
   283          * Recovers the dataport from the client.
       
   284          *          
       
   285          *
       
   286          * @param aTsyReqHandle
       
   287          * @return KErrNone
       
   288          */
       
   289         TInt RecoverDataPort( const TTsyReqHandle aTsyReqHandle );
       
   290 
       
   291         /**
       
   292          * Recovers the dataport from the client and relinquishes ownership.
       
   293          *          
       
   294          *
       
   295          * @return KErrNone
       
   296          */
       
   297         TInt RecoverDataPortAndRelinquishOwnership();
       
   298 
       
   299         /**
       
   300          * Returns fax settings to the client
       
   301          *          
       
   302          *
       
   303          * @param aTsyReqHandle TSY req handle
       
   304          * @param aSettings Fax settings
       
   305          * @return KErrNone
       
   306          */
       
   307         TInt GetFaxSettings( const TTsyReqHandle aTsyReqHandle,
       
   308             RCall::TFaxSessionSettings* aSettings );
       
   309          
       
   310         /**
       
   311          * Sets new fax settings
       
   312          *          
       
   313          *
       
   314          * @param aTsyReqHandle TSY req handle
       
   315          * @param aSettings Fax settings
       
   316          * @return KErrNone
       
   317          */
       
   318         TInt SetFaxSettings( const TTsyReqHandle aTsyReqHandle,
       
   319             const RCall::TFaxSessionSettings* aSettings );
       
   320 
       
   321     protected:  // New functions
       
   322 
       
   323         /**
       
   324          * Returns ETrue if the call object is "used" data call object
       
   325          *          
       
   326          *
       
   327          * @return Value of iIsFinishedDataCall boolean
       
   328          */
       
   329         TBool IsFinishedData() const;
       
   330 
       
   331     private:  // Constructors and destructor
       
   332 
       
   333         /**
       
   334          * C++ default constructor.
       
   335          */
       
   336         CMmFaxCallTsy();
       
   337 
       
   338     private:  // Functions from base classes
       
   339 
       
   340         /**
       
   341          * Initialises extension modules
       
   342          *          
       
   343          *
       
   344          * @param RMobilePhone::TMobileService Call mode
       
   345          */
       
   346         void InitExtensionModulesL( RMobilePhone::TMobileService aMode );
       
   347 
       
   348         /**
       
   349          * Initialises miscellaneous internal attributes
       
   350          *          
       
   351          *
       
   352          */
       
   353         void InitInternalAttributes();
       
   354 
       
   355         /**
       
   356          * DoExtFuncL is called by the server when it has a "extended", 
       
   357          * i.e. non-core ETel request for the TSY. To process a request handle,
       
   358          * request type and request data are passed to the TSY. 
       
   359          *          
       
   360          *
       
   361          * @param aTsyReqHandle Request handle from ETel server
       
   362          * @param aIpc IPC number of the request
       
   363          * @param aPackage Reference to the input parameters.
       
   364          * @return KErrNone/KErrNotSupported
       
   365          */
       
   366         TInt DoExtFuncL( const TTsyReqHandle aTsyReqHandle, const TInt aIpc, 
       
   367             const TDataPackage& aPackage );
       
   368 
       
   369         /**
       
   370          * Resets the status of the call
       
   371          *          
       
   372          *
       
   373          */
       
   374         void ClearCallStatus();
       
   375 
       
   376 #ifdef REQHANDLE_TIMER
       
   377         /**
       
   378          * Chooses the type of response, automatic or common
       
   379          *          
       
   380          *
       
   381          * @param aReqHandleType TSY request handle type.
       
   382          * @param aTsyReqHandle TSY request handle to be stored.
       
   383          */
       
   384         void SetTypeOfResponse( const TInt aReqHandleType, 
       
   385             const TTsyReqHandle aTsyReqHandle );
       
   386 #endif
       
   387 
       
   388     private:  // New functions
       
   389 
       
   390         /**
       
   391          * Get Data Call RLP Range.
       
   392          *          
       
   393          *
       
   394          * @param aTsyReqHandle
       
   395          * @param aRLPVersion
       
   396          * @param aRLPRange
       
   397          * @return KErrNotSupported
       
   398          */
       
   399         TInt GetMobileDataCallRLPRange(
       
   400             const TTsyReqHandle aTsyReqHandle,
       
   401             TInt* /*aRLPVersion*/,
       
   402             TDes8* /*aRLPRange*/ );
       
   403 
       
   404     private:    // Data
       
   405 
       
   406         /**Boolean that indicates if this call object is finished data call.
       
   407          * Required as Symbian CSD agent in situation where first data call
       
   408          * fails due wrong number and it then opens second data call, which
       
   409          * dials correct number. Call status notifications go to wrong call
       
   410          * object (the first one) and causes problems for clients.
       
   411          */         
       
   412         TBool iIsFinishedDataCall;
       
   413 
       
   414         /**
       
   415          * Dataport loaned to client
       
   416          */                 
       
   417         RCall::TCommPort iLoanedCommPort;
       
   418 
       
   419     private:    // Friend classes
       
   420 
       
   421         /**
       
   422          * Pointer to Internal fax call extension object.
       
   423          * Own.         
       
   424          */
       
   425         class CMmFaxExtInterface* iMmFaxExt;
       
   426 
       
   427     };
       
   428 
       
   429 #endif      // CMMFAXCALLTSY_H
       
   430             
       
   431 // End of File