satengine/satserver/Engine/inc/csatmultimodeapi.h
author hgs
Fri, 17 Sep 2010 17:09:13 +0300
changeset 48 78df25012fda
parent 33 8d5d7fcf9b59
permissions -rw-r--r--
201037
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
33
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description:  Encapsule the access to ETel MM API in sat
hgs
parents:
diff changeset
    15
*
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
hgs
parents:
diff changeset
    19
#ifndef CSATMULTIMODEAPI_H
hgs
parents:
diff changeset
    20
#define CSATMULTIMODEAPI_H
hgs
parents:
diff changeset
    21
hgs
parents:
diff changeset
    22
#include <e32base.h>
hgs
parents:
diff changeset
    23
#include "msatmultimodeapi.h"
hgs
parents:
diff changeset
    24
hgs
parents:
diff changeset
    25
class CSatSActiveWrapper;
hgs
parents:
diff changeset
    26
hgs
parents:
diff changeset
    27
/**
hgs
parents:
diff changeset
    28
 *  Encapsule the access to ETel MM API in sat
hgs
parents:
diff changeset
    29
 *  
hgs
parents:
diff changeset
    30
 *  This class is an active object. It will submit
hgs
parents:
diff changeset
    31
 *  Etel asynchronous request and wait for response.
hgs
parents:
diff changeset
    32
 *  Clients for this class will implement the interface
hgs
parents:
diff changeset
    33
 *  in MSatETelClient which is the callback function
hgs
parents:
diff changeset
    34
 *  when CSatMultiModeApi get the ETel request response.
hgs
parents:
diff changeset
    35
 *
hgs
parents:
diff changeset
    36
 *  @lib satengine.lib
hgs
parents:
diff changeset
    37
 *  @since S60 v5.0
hgs
parents:
diff changeset
    38
 */
hgs
parents:
diff changeset
    39
class CSatMultiModeApi : public CBase,
hgs
parents:
diff changeset
    40
                         public MSatMultiModeApi
hgs
parents:
diff changeset
    41
    {
hgs
parents:
diff changeset
    42
hgs
parents:
diff changeset
    43
public:
hgs
parents:
diff changeset
    44
    /**
hgs
parents:
diff changeset
    45
    * Two-phased constructor.
hgs
parents:
diff changeset
    46
    */
hgs
parents:
diff changeset
    47
    static CSatMultiModeApi* NewL();
hgs
parents:
diff changeset
    48
hgs
parents:
diff changeset
    49
    /**
hgs
parents:
diff changeset
    50
    * Destructor
hgs
parents:
diff changeset
    51
    */
hgs
parents:
diff changeset
    52
    virtual ~CSatMultiModeApi();
hgs
parents:
diff changeset
    53
hgs
parents:
diff changeset
    54
// from base class MSatMultiModeApi
hgs
parents:
diff changeset
    55
    
hgs
parents:
diff changeset
    56
    /**
hgs
parents:
diff changeset
    57
     * Gives pointer to active RMobilePhone session
hgs
parents:
diff changeset
    58
     *
hgs
parents:
diff changeset
    59
     * @return pointer to active RMobilePhone server session
hgs
parents:
diff changeset
    60
     */
hgs
parents:
diff changeset
    61
    RMobilePhone* Phone();
hgs
parents:
diff changeset
    62
hgs
parents:
diff changeset
    63
    /**
hgs
parents:
diff changeset
    64
     * Gives reference to active Dummy RMobilePhone session
hgs
parents:
diff changeset
    65
     *
hgs
parents:
diff changeset
    66
     * @return Reference to active Dummy RMobilePhone server session
hgs
parents:
diff changeset
    67
     */
hgs
parents:
diff changeset
    68
    RMobilePhone* DummyPhone();
hgs
parents:
diff changeset
    69
hgs
parents:
diff changeset
    70
    /**
hgs
parents:
diff changeset
    71
     * Gives pointer to active RMmCustomApi session
hgs
parents:
diff changeset
    72
     *
hgs
parents:
diff changeset
    73
     * @return pointer to active RMmCustomApi server session
hgs
parents:
diff changeset
    74
     */
hgs
parents:
diff changeset
    75
    RMmCustomAPI* CustomApi();
hgs
parents:
diff changeset
    76
hgs
parents:
diff changeset
    77
    /**
hgs
parents:
diff changeset
    78
     * Lowers error granularity to basic errors
hgs
parents:
diff changeset
    79
     */
hgs
parents:
diff changeset
    80
    void LowerErrorGranularity();
hgs
parents:
diff changeset
    81
hgs
parents:
diff changeset
    82
    /**
hgs
parents:
diff changeset
    83
     * Raises error granularity to extended errors
hgs
parents:
diff changeset
    84
     */
hgs
parents:
diff changeset
    85
    void RaiseErrorGranularity();
hgs
parents:
diff changeset
    86
hgs
parents:
diff changeset
    87
    /**
hgs
parents:
diff changeset
    88
     * Access RMobilePhone::GetNetworkRegistrationStatus
hgs
parents:
diff changeset
    89
     * for the paramter information please see the etelmm.h
hgs
parents:
diff changeset
    90
     */
hgs
parents:
diff changeset
    91
    void GetNetworkRegistrationStatus( TRequestStatus& aReqStatus, 
hgs
parents:
diff changeset
    92
            RMobilePhone::TMobilePhoneRegistrationStatus& aStatus );
hgs
parents:
diff changeset
    93
    
hgs
parents:
diff changeset
    94
    /**
hgs
parents:
diff changeset
    95
     * Access RMobilePhone::NotifyNetworkRegistrationStatusChange
hgs
parents:
diff changeset
    96
     * for the paramter information please see the etelmm.h
hgs
parents:
diff changeset
    97
     */ 
hgs
parents:
diff changeset
    98
    void NotifyNetworkRegistrationStatusChange( TRequestStatus& aReqStatus,
hgs
parents:
diff changeset
    99
            RMobilePhone::TMobilePhoneRegistrationStatus& aStatus );
hgs
parents:
diff changeset
   100
hgs
parents:
diff changeset
   101
    /**
hgs
parents:
diff changeset
   102
     * Access RMobilePhone::NotifyNetworkRegistrationStatusChange
hgs
parents:
diff changeset
   103
     * for the paramter information please see the etelmm.h
hgs
parents:
diff changeset
   104
     */ 
hgs
parents:
diff changeset
   105
    void GetSubscriberId( TRequestStatus& aReqStatus, 
hgs
parents:
diff changeset
   106
            RMobilePhone::TMobilePhoneSubscriberId& aId );
hgs
parents:
diff changeset
   107
hgs
parents:
diff changeset
   108
    /**
hgs
parents:
diff changeset
   109
     * Access RMobilePhone::SendDTMFTones
hgs
parents:
diff changeset
   110
     * for the paramter information please see the etelmm.h
hgs
parents:
diff changeset
   111
     */ 
hgs
parents:
diff changeset
   112
    void SendDTMFTones( TRequestStatus& aReqStatus, const TDesC& aTones);   
hgs
parents:
diff changeset
   113
    
hgs
parents:
diff changeset
   114
    /**
hgs
parents:
diff changeset
   115
     * Access RMobilePhone::ContinueDTMFStringSending
hgs
parents:
diff changeset
   116
     * for the paramter information please see the etelmm.h
hgs
parents:
diff changeset
   117
     */ 
hgs
parents:
diff changeset
   118
    TInt ContinueDTMFStringSending( TBool aContinue );
hgs
parents:
diff changeset
   119
    
hgs
parents:
diff changeset
   120
    /**
hgs
parents:
diff changeset
   121
     * Access RMobilePhone::CancelAsyncRequest
hgs
parents:
diff changeset
   122
     * for the paramter information please see the etelmm.h
hgs
parents:
diff changeset
   123
     */
hgs
parents:
diff changeset
   124
    void CancelAsyncRequest(TInt aReqToCancel);
hgs
parents:
diff changeset
   125
hgs
parents:
diff changeset
   126
    /**
hgs
parents:
diff changeset
   127
     * Access RMobilePhone::SendNetworkServiceRequestNoFdnCheck
hgs
parents:
diff changeset
   128
     * for the paramter information please see the etelmm.h
hgs
parents:
diff changeset
   129
     */
hgs
parents:
diff changeset
   130
    void SendNetworkServiceRequestNoFdnCheck( TRequestStatus& aReqStatus, 
hgs
parents:
diff changeset
   131
            const TDesC& aServiceString);
hgs
parents:
diff changeset
   132
        
hgs
parents:
diff changeset
   133
    /**
hgs
parents:
diff changeset
   134
     * Access RMobileCall::DialNoFdnCheck
hgs
parents:
diff changeset
   135
     * for the paramter information please see the etelmm.h
hgs
parents:
diff changeset
   136
     */
hgs
parents:
diff changeset
   137
    void DialNoFdnCheck( TRequestStatus& aStatus,
hgs
parents:
diff changeset
   138
            const TDesC8& aCallParams,const TDesC& aTelNumber );
hgs
parents:
diff changeset
   139
                                                        
hgs
parents:
diff changeset
   140
    /**
hgs
parents:
diff changeset
   141
     * Access RMobileUssdMessaging::SendMessageNoFdnCheck
hgs
parents:
diff changeset
   142
     * for the paramter information please see the etelmm.h
hgs
parents:
diff changeset
   143
     */
hgs
parents:
diff changeset
   144
    void SendMessageNoFdnCheck( TRequestStatus& aReqStatus,
hgs
parents:
diff changeset
   145
            const TDesC8& aMsgData, const TDesC8& aMsgAttributes );
hgs
parents:
diff changeset
   146
    /**
hgs
parents:
diff changeset
   147
     * Access RMobileCall::DialCancel
hgs
parents:
diff changeset
   148
     */
hgs
parents:
diff changeset
   149
    void DialCancel();
hgs
parents:
diff changeset
   150
hgs
parents:
diff changeset
   151
    /**
hgs
parents:
diff changeset
   152
     * Check if there is an incoming call 
hgs
parents:
diff changeset
   153
     * @return ETrue if there is an incoming call
hgs
parents:
diff changeset
   154
     */
hgs
parents:
diff changeset
   155
    TBool IsCallIncoming();
hgs
parents:
diff changeset
   156
    
hgs
parents:
diff changeset
   157
    /**
hgs
parents:
diff changeset
   158
     * Access RMobileCall::NotifyMobileCallStatusChange
hgs
parents:
diff changeset
   159
     */
hgs
parents:
diff changeset
   160
    void NotifyMobileCallStatusChange( TRequestStatus& aReqStatus,
hgs
parents:
diff changeset
   161
                    RMobileCall::TMobileCallStatus& aStatus) ; 
hgs
parents:
diff changeset
   162
hgs
parents:
diff changeset
   163
    /**
hgs
parents:
diff changeset
   164
     * Access RMobileCall::NotifyStatusChangeCancel
hgs
parents:
diff changeset
   165
     */
hgs
parents:
diff changeset
   166
    void NotifyCallStatusChangeCancel();
hgs
parents:
diff changeset
   167
    /**
hgs
parents:
diff changeset
   168
     * Access RMobilePhone::TerminateActiveCalls NotifyMobileCallStatusChange
hgs
parents:
diff changeset
   169
     */
hgs
parents:
diff changeset
   170
    void TerminateActiveCalls(TRequestStatus& aReqStatus);
hgs
parents:
diff changeset
   171
hgs
parents:
diff changeset
   172
    
hgs
parents:
diff changeset
   173
    /**
hgs
parents:
diff changeset
   174
     * Access RMboileCall::GetMobileCallInfo
hgs
parents:
diff changeset
   175
     */
hgs
parents:
diff changeset
   176
    TInt GetMobileCallInfo(TDes8& aCallInfo);
hgs
parents:
diff changeset
   177
    
hgs
parents:
diff changeset
   178
    /**
hgs
parents:
diff changeset
   179
     * Access RMboileCall::DialEmergencyCall
hgs
parents:
diff changeset
   180
     */
hgs
parents:
diff changeset
   181
    virtual void DialEmergencyCall(TRequestStatus& aReqStatus, 
hgs
parents:
diff changeset
   182
                const TDesC& aNumber);
48
hgs
parents: 33
diff changeset
   183
hgs
parents: 33
diff changeset
   184
    /**
hgs
parents: 33
diff changeset
   185
     * Check validity of a given Data Coding Cheme (Dcs).
hgs
parents: 33
diff changeset
   186
     * used by call control handler and send ussd handler
hgs
parents: 33
diff changeset
   187
     * @param aDcs Data Coding Cheme to be validated.
hgs
parents: 33
diff changeset
   188
     * @return TBool indicating Dcs validity.
hgs
parents: 33
diff changeset
   189
     */           
hgs
parents: 33
diff changeset
   190
    virtual TBool IsValidUssdDcs( const TUint8 aDcs );
33
hgs
parents:
diff changeset
   191
            
hgs
parents:
diff changeset
   192
private:
hgs
parents:
diff changeset
   193
hgs
parents:
diff changeset
   194
    /**
hgs
parents:
diff changeset
   195
    * Default C++ constructor
hgs
parents:
diff changeset
   196
    */
hgs
parents:
diff changeset
   197
    CSatMultiModeApi();
hgs
parents:
diff changeset
   198
hgs
parents:
diff changeset
   199
    /**
hgs
parents:
diff changeset
   200
    * By default Symbian 2nd phase constructor is private.
hgs
parents:
diff changeset
   201
    */
hgs
parents:
diff changeset
   202
    void ConstructL();
hgs
parents:
diff changeset
   203
    
hgs
parents:
diff changeset
   204
// New functions
hgs
parents:
diff changeset
   205
    /**
hgs
parents:
diff changeset
   206
     * Makes the connections to ETel Server
hgs
parents:
diff changeset
   207
     */
hgs
parents:
diff changeset
   208
    void ConnectETelServerL();
hgs
parents:
diff changeset
   209
hgs
parents:
diff changeset
   210
    /**
hgs
parents:
diff changeset
   211
     * Loads and opens phone module
hgs
parents:
diff changeset
   212
     *
hgs
parents:
diff changeset
   213
     * @param aPhone reference to phone that is loaded
hgs
parents:
diff changeset
   214
     * @param aModuleName Name of the phone module
hgs
parents:
diff changeset
   215
     * @param aPhoneName Name of the phone
hgs
parents:
diff changeset
   216
     */
hgs
parents:
diff changeset
   217
    void LoadPhoneModuleL( RMobilePhone& aPhone, const TDesC& aModuleName,
hgs
parents:
diff changeset
   218
            const TDesC& aPhoneName );
hgs
parents:
diff changeset
   219
hgs
parents:
diff changeset
   220
    /**
hgs
parents:
diff changeset
   221
     * Open the RMobileUssdMessaging
hgs
parents:
diff changeset
   222
     */ 
hgs
parents:
diff changeset
   223
    void LoadUssdMessagingL();
hgs
parents:
diff changeset
   224
    
hgs
parents:
diff changeset
   225
    /**
hgs
parents:
diff changeset
   226
     * Open the RMobileCall
hgs
parents:
diff changeset
   227
     */
hgs
parents:
diff changeset
   228
    TInt LoadMobileCall();
hgs
parents:
diff changeset
   229
    
hgs
parents:
diff changeset
   230
hgs
parents:
diff changeset
   231
private: // data
hgs
parents:
diff changeset
   232
hgs
parents:
diff changeset
   233
    /**
hgs
parents:
diff changeset
   234
     * The Etel server.
hgs
parents:
diff changeset
   235
     * Own
hgs
parents:
diff changeset
   236
     */
hgs
parents:
diff changeset
   237
    RTelServer iTelServer;
hgs
parents:
diff changeset
   238
hgs
parents:
diff changeset
   239
    /**
hgs
parents:
diff changeset
   240
     * Used to access phone based functionality
hgs
parents:
diff changeset
   241
     * Own
hgs
parents:
diff changeset
   242
     */
hgs
parents:
diff changeset
   243
    RMobilePhone iPhone;
hgs
parents:
diff changeset
   244
hgs
parents:
diff changeset
   245
    /**
hgs
parents:
diff changeset
   246
     * Phone module for Dummy TSY
hgs
parents:
diff changeset
   247
     * Own
hgs
parents:
diff changeset
   248
     */
hgs
parents:
diff changeset
   249
    RMobilePhone iDummyPhone;
hgs
parents:
diff changeset
   250
hgs
parents:
diff changeset
   251
    /**
hgs
parents:
diff changeset
   252
     * RMmCustomAPI
hgs
parents:
diff changeset
   253
     * Own
hgs
parents:
diff changeset
   254
     */
hgs
parents:
diff changeset
   255
    RMmCustomAPI iCustomPhone;
hgs
parents:
diff changeset
   256
    
hgs
parents:
diff changeset
   257
    /**
hgs
parents:
diff changeset
   258
     * Line needed by iCall
hgs
parents:
diff changeset
   259
     * own
hgs
parents:
diff changeset
   260
     */
hgs
parents:
diff changeset
   261
    RMobileLine iLine;
hgs
parents:
diff changeset
   262
    
hgs
parents:
diff changeset
   263
    /**
hgs
parents:
diff changeset
   264
     * Access call based functionality
hgs
parents:
diff changeset
   265
     * own
hgs
parents:
diff changeset
   266
     */
hgs
parents:
diff changeset
   267
    RMobileCall iCall;
hgs
parents:
diff changeset
   268
    
hgs
parents:
diff changeset
   269
    /**
hgs
parents:
diff changeset
   270
     * Access USSD Messaging
hgs
parents:
diff changeset
   271
     * own
hgs
parents:
diff changeset
   272
     */
hgs
parents:
diff changeset
   273
    RMobileUssdMessaging iUssd;
hgs
parents:
diff changeset
   274
hgs
parents:
diff changeset
   275
    /**
hgs
parents:
diff changeset
   276
     * Pointer to Active Wrapper. Used in startup
hgs
parents:
diff changeset
   277
     * Own.
hgs
parents:
diff changeset
   278
     */
hgs
parents:
diff changeset
   279
    CSatSActiveWrapper* iWrapper;
hgs
parents:
diff changeset
   280
    
hgs
parents:
diff changeset
   281
    /**
hgs
parents:
diff changeset
   282
     * Indicate if the iLine has been openned
hgs
parents:
diff changeset
   283
     */
hgs
parents:
diff changeset
   284
    TBool iLineOpened;
hgs
parents:
diff changeset
   285
hgs
parents:
diff changeset
   286
    /**
hgs
parents:
diff changeset
   287
     * Indicate if the iCall has been openned
hgs
parents:
diff changeset
   288
     */
hgs
parents:
diff changeset
   289
    TBool iCallOpened;
hgs
parents:
diff changeset
   290
    
hgs
parents:
diff changeset
   291
    /**
hgs
parents:
diff changeset
   292
     * Indicate if the iUssd has been openned
hgs
parents:
diff changeset
   293
     */
hgs
parents:
diff changeset
   294
    TBool iUssdOpened;
hgs
parents:
diff changeset
   295
    
hgs
parents:
diff changeset
   296
    };
hgs
parents:
diff changeset
   297
hgs
parents:
diff changeset
   298
#endif // CSATMULTIMODEAPI_H