convergedcallengine/csplugin/inc/csprovider.h
branchRCL_3
changeset 20 987c9837762f
parent 0 ff3b6d0fd310
equal deleted inserted replaced
19:7d48bed6ce0c 20:987c9837762f
       
     1 /*
       
     2 * Copyright (c) 2007-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:  Main class for CS Call Plug-in
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CSPROVIDER_H
       
    21 #define CSPROVIDER_H
       
    22 
       
    23 #include <e32base.h>
       
    24 #include <cconvergedcallprovider.h>
       
    25 #include <mccpcsobserver.h>
       
    26 #include <mccpdtmfprovider.h>
       
    27 #include <mccpcscall.h>
       
    28 #include <mccecall.h>
       
    29 
       
    30 #include "mcspincomingcallobserver.h"
       
    31 #include "mcspsecuritysettingobserver.h"
       
    32 #include "mcspcommoninfo.h"
       
    33 #include "mcsppubsubobserver.h"
       
    34 #include "mcspremotealertingtoneobserver.h"
       
    35 #include "mcspconferencestatusobserver.h"
       
    36 
       
    37 
       
    38 // FORWARD DECLARATIONS
       
    39 class CSPEtelIncomingCallMonitor;
       
    40 class CSPDTMFProvider;
       
    41 class CSPServiceSettingsHandler;
       
    42 class CSPEtelCallAddedMonitor;
       
    43 class CSPConferenceCall;
       
    44 class CSPCallArray;
       
    45 class CSPAudioHandler;
       
    46 class CSPEtelCallWaitingRequester;
       
    47 class CSPSupplementaryServicesMonitor;
       
    48 class MCCPSsObserver;
       
    49 class CSPCipheringStatusMonitor;
       
    50 class CSPSsSettingsHandler;
       
    51 class CSPCallAddedHandler;
       
    52 class CSPPubSubListener;
       
    53 class CSPCallCommandHandler;
       
    54 class CSPRemoteAlertingToneListener;
       
    55 class CSPEtelConferenceStatusMonitor; 
       
    56 
       
    57 /**
       
    58 * Main class for using CS Call Plug-in. Implements the CCP API.
       
    59 *
       
    60 *  @lib csplugin.dll
       
    61 *  @since S60 v3.2
       
    62 */
       
    63 class CSProvider : public CConvergedCallProvider,
       
    64                    public MCSPIncomingCallObserver,
       
    65                    public MCSPCommonInfo,
       
    66                    public MCSPSecuritySettingObserver,
       
    67                    public MCSPPubSubObserver,
       
    68                    public MCSPRemoteAlertingToneObserver, 
       
    69                    public MCSPConferenceStatusObserver
       
    70 {
       
    71     public:
       
    72     
       
    73         /**
       
    74         * Two-phased constructor.
       
    75         * @return new instance of the class
       
    76         */    
       
    77         static CSProvider* NewL();
       
    78         
       
    79         /**
       
    80         * C++ default destructor
       
    81         */        
       
    82         virtual ~CSProvider();
       
    83         
       
    84         /**
       
    85         * Notification of SS event.
       
    86         * @param aSsTypeAndMode SS type and SS mode
       
    87         * @param aSsInfo SS info
       
    88         */ 
       
    89         void NotifySsEvent( RMmCustomAPI::TSsTypeAndMode& aSsTypeAndMode,
       
    90                             RMmCustomAPI::TSsInfo& aSsInfo );
       
    91 
       
    92 
       
    93 // from base class CConvergedCallProvider    
       
    94 
       
    95         /**
       
    96         * Initializes plug-in. All required parameters must be passed
       
    97         * with this function in order to use services.
       
    98         * Simplifies pluging construct removing need to pass parameters 
       
    99         * to ECom interface
       
   100         * @since S60 3.2
       
   101         * @param aAppUID Application UID of Telephony application
       
   102         * @param aObserver general observer
       
   103         * @param aSsObserver observer for events related to supplementary 
       
   104         *        services.
       
   105         */
       
   106         void InitializeL( const MCCPObserver& aObserver,
       
   107                           const MCCPSsObserver& aSsObserver );
       
   108 
       
   109         /**
       
   110         * Creates a new call and checks secure status from profile.
       
   111         * @since S60 3.2
       
   112         * @param aServiceId service id
       
   113         * @param aRemoteParty Recipients address/number
       
   114         * @param aObserver Observer
       
   115         * @return MCCPMoCall
       
   116         */
       
   117         MCCPCall* NewCallL( const CCCPCallParameters& aCallParameters,
       
   118                             const TDesC& aRemoteParty, 
       
   119                             const MCCPCallObserver& aObserver );
       
   120 
       
   121 
       
   122         /**
       
   123         * From CConvergedCallProvider
       
   124         * Releases all bindings to call and deletes it. 
       
   125         * This will be called by CCE to free all the resources reserved for the call.
       
   126         * After this call CCE will not access the call object anymore and observer 
       
   127         * for the class must not be used in plug-in.
       
   128         * This operation must always succeed. If plug-in decides to pre-allocate the 
       
   129         * call object it can choose to do so, but plug-in has to make sure call is 
       
   130         * returned to the state it was before calling CConvergedCallProvider::NewCallL.
       
   131         * @param aCalltoRemove Call to remove.
       
   132         * @return KErrNone or KErrNotFound if removed call is not found.
       
   133         * @pre None, can always be called.
       
   134         * @post Plug-in must quarantee all resources for the call will be cleaned up. 
       
   135         * and plug-in must not call observer after this call!
       
   136         * @since S60 3.2
       
   137         */
       
   138         virtual TInt ReleaseCall( MCCPCall& aCalltoRemove );
       
   139         
       
   140         /**
       
   141         * From CConvergedCallProvider
       
   142         * Creates a new Emergency call and add user-agent header.
       
   143         * @since S60 3.2
       
   144         * @param aServiceId service id
       
   145         * @param aAddress address of emergency call
       
   146         * @param aObserver Observer
       
   147         * @return MCCPEmergencyCall
       
   148         */
       
   149         MCCPEmergencyCall* NewEmergencyCallL( 
       
   150                                           const TUint32 aServiceId,
       
   151                                           const TDesC& aAddress,
       
   152                                           const MCCPCallObserver& aObserver );
       
   153 
       
   154         /**
       
   155         * From CConvergedCallProvider.
       
   156         * Releases all bindings to call and deletes it. 
       
   157         * This must be called to free all the resources reserved for the call.
       
   158         * After this call CCE must not be access the call object anymore and observer 
       
   159         * for the class must not be used in plug-in.
       
   160         * This operation mustways succeed. If plug-in decides to pre-allocate the 
       
   161         * call object it can choose to do so, but client has to be sure call is 
       
   162         * cleared from the plug-in and all resuorces are returned to the state before calling 
       
   163         * CConvergedCallProvider::NewEmergencyCallL.
       
   164         * @param aCalltoRemove Call to remove.
       
   165         * @return KErrNone or KErrNotFound if removed call is not found.
       
   166         * @pre None, can always be called.
       
   167         * @post Plug-in must quarantee all resources for the call will be cleaned up. Call must not 
       
   168         * be referenced anymore from CCE and plug-in must not call observer after this call!
       
   169         * @since S60 3.2
       
   170         */
       
   171         TInt ReleaseEmergencyCall( MCCPEmergencyCall& aCalltoRemove );
       
   172         
       
   173         /**
       
   174         * From CConvergedCallProvider
       
   175         * Creates a new conference call.
       
   176         * @since S60 3.2
       
   177         * @param aServiceId service id
       
   178         * @param aObserver Observer
       
   179         * @return MCCPConferenceCall
       
   180         */
       
   181         MCCPConferenceCall* NewConferenceL( const TUint32 aServiceId, 
       
   182                                   const MCCPConferenceCallObserver& aObserver );
       
   183 
       
   184         /**
       
   185         * From CConvergedCallProvider
       
   186         * Releases all bindings to conference call. CCE will call this after receiving 
       
   187         * MCCPConferenceCallObserver::ECCPConferenceIdle from plug-in or when it itself 
       
   188         * wants to release the call. In normal sequence called from CCE after HangUp is completed.
       
   189         * @param aCalltoRemove Call to remove.
       
   190         * @return KErrNone or KErrNotFound if removed call is not found.
       
   191         * @pre None, can always be called.
       
   192         * @post Plug-in must quarantee all resources for the call will be cleaned up. Call must not 
       
   193         * be referenced anymore from CCE and plug-in must not call observer after this call!
       
   194         * @since S60 3.2
       
   195         */
       
   196         TInt ReleaseConferenceCall( MCCPConferenceCall& aCalltoRemove );
       
   197 
       
   198         /**
       
   199         * Returns Uid of plug-in which is on use.
       
   200         * @since S60 3.2
       
   201         * @return Uid of plug-in
       
   202         */   
       
   203         const TUid& Uid() const;
       
   204 
       
   205         /**
       
   206         * Get Plug-In capabilities
       
   207         * @since S60 3.2
       
   208         * @return caps
       
   209         */
       
   210         TUint32 Caps( ) const;
       
   211 
       
   212         /**
       
   213         * Get DTMF provider
       
   214         * @since S60 3.2
       
   215         * @return Pointer to MCCPDTMFProvider if succesfull,
       
   216         *         NULL if not available
       
   217         */
       
   218         MCCPDTMFProvider* DTMFProviderL( const MCCPDTMFObserver& aObserver );
       
   219 
       
   220         /**
       
   221         * Get extension provider
       
   222         * @since S60 3.2
       
   223         * @return Pointer to MCCPExtensionProvider if succesfull,
       
   224         *         NULL if not available
       
   225         */
       
   226         MCCPExtensionProvider* ExtensionProviderL( 
       
   227                             const MCCPExtensionObserver& aObserver );
       
   228                             
       
   229         /**
       
   230         * This method gets the lifetime of the MS. The lifetime information 
       
   231         * includes the manufacturing date of the MS and the total amount of airtime use, 
       
   232         * from the manufacturing date until the call to this method. Calling this method 
       
   233         * does not reset any data. This is used only CS, other plug-ins may ignore this method.
       
   234         * @since S60 3.2
       
   235         * @param aLifeTimeInfo Life time information
       
   236         * @return none 
       
   237         */
       
   238         TBool GetLifeTime( TDes8& aLifeTimeInfo );
       
   239 	   
       
   240         /**
       
   241         * This method gets serial number from MS. The CSInfo includes
       
   242         * the serial number.
       
   243         * @since S60 5.0
       
   244         * @param aCSInfo CS specific information from MS.
       
   245         * @return Get succeeded or not.
       
   246         */
       
   247         TBool GetCSInfo( CSInfo& aCSInfo );
       
   248 
       
   249 // from base class MCSPIncomingCallObserver
       
   250 
       
   251         /**
       
   252         * From MCSPIncomingCallObserver.
       
   253         * Informs incoming call.
       
   254         * 
       
   255         * @since S60 3.2
       
   256         * @param aLine the line that corresponds to the call
       
   257         * @param aCallName the name of call
       
   258         * @param aLineId line identifier for the call
       
   259         */    
       
   260         void IncomingCallArrived( RMobileLine& aLine, TName aCallName,
       
   261                                   RCSPLineContainer::TCSPLineId aLineId );
       
   262         
       
   263 // from base class MCSPCommonInfo
       
   264 
       
   265         /**
       
   266         * From MCSPCommonInfo
       
   267         * Makes the request. Note that ERequestTypeDial is made with a 
       
   268         * separate MakeDialRequest function.
       
   269         *
       
   270         * @since S60 3.2
       
   271         * @param aRequest type of request
       
   272         * @return ETrue if active, EFalse if not
       
   273         */
       
   274         void GetCallWaitingL( const CCCECallParameters& iParams,
       
   275                               TBool& aCallWaitingStatus );
       
   276                               
       
   277         /**
       
   278         * From MCSPCommonInfo
       
   279         * Diagnostic error fetching.
       
   280         * @param aCallName name of call related to error
       
   281         * @return diagnostic error code
       
   282         */
       
   283         TInt GetDiagnosticError( TName& aCallName );
       
   284 
       
   285         /**
       
   286         * From MCSPCommonInfo
       
   287         *
       
   288         * Network security status
       
   289         * 
       
   290         * @since Series60_4.0
       
   291         * @return true if security enabled
       
   292         */
       
   293         TBool NetworkSecurityStatus() const;
       
   294 
       
   295         /**
       
   296         * From MCSPCommonInfo         
       
   297         * Secure specified status. 
       
   298         * @since Series60_5.0
       
   299         * @return true if secure specified
       
   300         */
       
   301         TBool SecureSpecified() const;
       
   302         
       
   303         /**
       
   304         * From MCSPCommonInfo
       
   305         * Remote alerting tone status.
       
   306         * @return tone status for remote alerting tone playing
       
   307         */
       
   308         RMmCustomAPI::TRemoteAlertingToneStatus GetRemoteAlertingToneStatus();
       
   309         
       
   310         /**
       
   311          * From MCSPCommonInfo
       
   312          * Initializes with current settings.
       
   313          * @param aParams call params 
       
   314          */
       
   315         void InitializeCallParameters( RMobileCall::TMobileCallParamsV7& aParams );
       
   316 
       
   317         /**
       
   318          * From MCSPCommonInfo
       
   319          * Initializes with current data call settings.
       
   320          * @param aParams call params 
       
   321          */
       
   322         void InitializeDataCallParameters( RMobileCall::TMobileHscsdCallParamsV1& aParams );
       
   323         
       
   324         /**
       
   325         * From MCPSCommonInfo
       
   326         * @param aCall client call to be indicated
       
   327         */
       
   328         void IndicateClientCall( MCCPCSCall* aCall );
       
   329         
       
   330         /**
       
   331         * Indicates incoming call for CCE.
       
   332         * @param aCall incoming call
       
   333         */
       
   334         TInt IndicateIncomingCall( MCCPCSCall* aCall );
       
   335         
       
   336         /**
       
   337         * Notify data port name about a loaned data port.
       
   338         * @param aDataPortName port name
       
   339         */
       
   340         void NotifyDataPortName( TName& aDataPortName );
       
   341 
       
   342         /**
       
   343         * Indicates active hangup command.
       
   344         * @param aCall MT call
       
   345         * @return system wide error code
       
   346         */
       
   347         TInt IndicateActiveHangup( MCCPCallCommandHandling& aCall );
       
   348         
       
   349         /**
       
   350         * Indicates hangup command complete.
       
   351         * @param aCall MT call
       
   352         * @return system wide error code
       
   353         */
       
   354         TInt IndicateHangupComplete( MCCPCallCommandHandling& aCall );
       
   355         
       
   356         /**
       
   357         * Indicates active hangup command.
       
   358         * @param aCall MT call
       
   359         * @return system wide error code
       
   360         */
       
   361         TInt IndicateDialRequest( MCCPCallCommandHandling& aCall );
       
   362         
       
   363         /**
       
   364         * Indicates active hangup command.
       
   365         * @param aCall MT call
       
   366         * @return system wide error code
       
   367         */
       
   368         TInt IndicateAnswerRequest( MCCPCallCommandHandling& aCall );
       
   369         
       
   370         /**
       
   371         * Don't report termination error
       
   372         * @since Series60_5.0
       
   373         * @return system wide error code
       
   374         */
       
   375         TInt DontReportTerminationError();
       
   376         
       
   377 // From base class MCSPSecuritySettingObserver
       
   378 
       
   379         /**
       
   380         * From MCSPSecuritySettingObserver
       
   381         * Notifies about changed security status.
       
   382         * @param aValue 
       
   383         */
       
   384         void SecuritySettingChanged( TInt aValue );
       
   385         
       
   386 // From base class MCSPPubSubObserver
       
   387 
       
   388         /**
       
   389         * Handler for changed event.
       
   390         * @param aUid uid of setting 
       
   391         * @param aKey id of setting
       
   392         * @param aStatus status of completed AO operation
       
   393         */
       
   394         void HandleNotifyPSL( const TUid aUid, const TInt& aKey, 
       
   395             const TRequestStatus& aStatus );
       
   396         
       
   397 // From base class MCSPRemoteAlertingToneObserver
       
   398         
       
   399         /**
       
   400          * From MCSPRemoteAlertingToneObserver
       
   401          * @see MCSPRemoteAlertingToneObserver
       
   402          */
       
   403         void RemoteAlertingToneStatusChanged(
       
   404             RMmCustomAPI::TRemoteAlertingToneStatus aNewStatus );
       
   405 
       
   406 // From base class MCSPConferenceStatusObserver
       
   407         
       
   408         /**
       
   409         * From MCSPConferenceStatusObserver.
       
   410         * Notifies event to observers.
       
   411         * @param aStatus new status of the conference call
       
   412         */        
       
   413         void NotifyStateChange( 
       
   414             MCSPConferenceStatusObserver::TCSPConferenceState aStatus );
       
   415                         
       
   416     private:
       
   417     
       
   418         /**
       
   419         * C++ default constructor
       
   420         */
       
   421         CSProvider();
       
   422         
       
   423         /**
       
   424         * By default Symbian 2nd phase constructor is private.
       
   425         */
       
   426         void ConstructL();
       
   427 
       
   428         /**
       
   429         * Creates connections to ETel.
       
   430         */
       
   431         void CreateEtelConnectionsL();
       
   432         
       
   433         /**
       
   434         * Handles diverting and barring notifications.
       
   435         * @param aAddr address
       
   436         * @param aSsTypeAndMode ss type and mode struct
       
   437         */
       
   438         void HandleDivertOrBarring(TDesC& addr, 
       
   439                          RMmCustomAPI::TSsTypeAndMode& aSsTypeAndMode);
       
   440         
       
   441         /**
       
   442         * Handles SIM status
       
   443         */
       
   444         void HandleSIMStatusL();
       
   445         
       
   446     // data
       
   447     private:
       
   448         
       
   449         /**
       
   450         * Implementation UID
       
   451         */
       
   452         TUid iImplementationUid;
       
   453         
       
   454         /**
       
   455         * ETel connection
       
   456         */
       
   457         RTelServer iServer;
       
   458         
       
   459         /**
       
   460         * Mobile phone handle.
       
   461         */
       
   462         RMobilePhone iMobilePhone;
       
   463 
       
   464         /**
       
   465         * Mobile conference call handle.
       
   466         */
       
   467         RMobileConferenceCall iMobileConferenceCall;
       
   468         
       
   469         /**
       
   470         * Observer for provider level functionality.
       
   471         * Not own.
       
   472         */        
       
   473         MCCPCSObserver* iCCPObserver;
       
   474 
       
   475         /**
       
   476         * Observer for SS events.
       
   477         * Not own.
       
   478         */
       
   479         MCCPSsObserver* iSsObserver;
       
   480         
       
   481         /**
       
   482         * DTMF provider.
       
   483         * Own.
       
   484         */
       
   485         CSPDTMFProvider* iDTMFProvider;
       
   486         
       
   487         /**
       
   488         * Monitors line for incoming calls.
       
   489         * Own.
       
   490         */        
       
   491         CSPEtelIncomingCallMonitor* iIncomingVoiceCallMonitor;
       
   492         
       
   493         /**
       
   494         * Monitors line for incoming data/video calls.
       
   495         * Own.
       
   496         */        
       
   497         CSPEtelIncomingCallMonitor* iIncomingDataCallMonitor;
       
   498         
       
   499         /**
       
   500         * Monitors line for incoming calls from aux line
       
   501         * Own.
       
   502         */        
       
   503         CSPEtelIncomingCallMonitor* iIncomingAuxCallMonitor;
       
   504         
       
   505         /**
       
   506         * Call array.
       
   507         * Own.
       
   508         */
       
   509         CSPCallArray* iCallArray;
       
   510                 
       
   511         /**
       
   512         * Custom API handle for custom functionality.
       
   513         */        
       
   514         RMmCustomAPI iMmCustom;
       
   515         
       
   516         /**
       
   517         * Line container.
       
   518         */
       
   519         RCSPLineContainer iLineContainer;
       
   520         
       
   521         /**
       
   522         * Service settings handler for reading 
       
   523         * service id and name information.
       
   524         * Own.
       
   525         */
       
   526         CSPServiceSettingsHandler* iServiceHandler;
       
   527         
       
   528         /**
       
   529         * Initialisation status.
       
   530         */
       
   531         TBool iInitialized;
       
   532                 
       
   533         /**
       
   534         * Call added monitor.
       
   535         * Own.
       
   536         */
       
   537         CSPCallAddedHandler* iCallAddedHandler;
       
   538         
       
   539         /**
       
   540         * Service ID.
       
   541         */
       
   542         TUint32 iServiceId;
       
   543         
       
   544         /**
       
   545         * Dev sound handler.
       
   546         * Own.
       
   547         */
       
   548         CSPAudioHandler* iAudioHandler;
       
   549         
       
   550         /**
       
   551         * Call waiting requester.
       
   552         * Own.
       
   553         */
       
   554         CSPEtelCallWaitingRequester* iCwRequester;
       
   555         
       
   556         /**
       
   557         * Supplementary service related event monitor.
       
   558         * Own.
       
   559         */ 
       
   560         CSPSupplementaryServicesMonitor* iSsMonitor;
       
   561         
       
   562         /**
       
   563          * Ciphering (network security level On/Off) setting monitor.
       
   564          */
       
   565         CSPCipheringStatusMonitor* iCipheringStatusMonitor;
       
   566         
       
   567         /**
       
   568          * SS Settings handler for reading ALS line and ALS supported status.
       
   569          */
       
   570         CSPSsSettingsHandler* iSsSettingsHandler;
       
   571         
       
   572         /**
       
   573         * Sim status listener.
       
   574         * Own.
       
   575         */ 
       
   576         CSPPubSubListener* iSimStatusListener;
       
   577         
       
   578         /**
       
   579         * CallCommandHandler.
       
   580         * Own.
       
   581         */ 
       
   582         CSPCallCommandHandler* iCallCommandHandler;
       
   583         
       
   584         /** 
       
   585          * Remote Alerting Tone listener.
       
   586          */
       
   587         CSPRemoteAlertingToneListener* iRemoteAlertingToneListener;
       
   588         
       
   589         /** 
       
   590          * Monitor for conference status changes.
       
   591          * Own.
       
   592          */
       
   593         CSPEtelConferenceStatusMonitor* iConferenceStatusMonitor;
       
   594 
       
   595         /** 
       
   596          * Keep track of conference existence.
       
   597          */
       
   598         CSPConferenceCall* iConferenceCall; 
       
   599 };
       
   600 
       
   601 #endif // CSPROVIDER_H