telephonyserverplugins/ctsydispatchlayer/inc/csatdispatcher.h
changeset 0 3553901f7fa8
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @internalAll 
       
    19 */
       
    20 
       
    21 #ifndef __CSATDISPATCHER_H_
       
    22 #define __CSATDISPATCHER_H_
       
    23 
       
    24 // INCLUDES
       
    25 #include <e32std.h>
       
    26 #include <e32base.h>
       
    27 #include <e32def.h>
       
    28 #include <etelmm.h>
       
    29 #include <etelsat.h>
       
    30 
       
    31 #include <ctsy/ltsy/mltsydispatchfactory.h>
       
    32 
       
    33 #include "requestqueueoneshot.h"
       
    34 #include <ctsy/ltsy/ltsylogger.h>
       
    35 #include "mdispatchercallback.h"
       
    36 #include <ctsy/ltsy/mltsydispatchsatinterface.h>
       
    37 
       
    38 // FORWARD DECLARATIONS
       
    39 class CMmDataPackage;
       
    40 class MmMessageManagerCallback;
       
    41 class TDispatcherHolder;
       
    42 class MLtsyDispatchSatSmsDeliverReport;
       
    43 class MLtsyDispatchSatGetImageInstance;
       
    44 class MLtsyDispatchSatGetIconData;
       
    45 class MLtsyDispatchSatGetClut;
       
    46 class MLtsyDispatchSatGetDefaultBearerCapability;
       
    47 class MLtsyDispatchSatGetSmsPpDownloadSupported;
       
    48 class MLtsyDispatchSatGetSmsControlActivated;
       
    49 class MLtsyDispatchSatCellBroadcastEnvelope;
       
    50 class MLtsyDispatchSatGetAccessTechnology;
       
    51 class MLtsyDispatchSatTimingAdvance;
       
    52 class MLtsyDispatchSatSmControlResponseData;
       
    53 class MLtsyDispatchSatProvideLocationInfo;
       
    54 class MLtsyDispatchSatSetPollingInterval;
       
    55 class MLtsyDispatchSatSmsPpDownloadEnvelope;
       
    56 class MLtsyDispatchSatLocalInformationNmr;
       
    57 class MLtsyDispatchSatCallAndSmsControlEnvelope;
       
    58 class MLtsyDispatchSatRefreshAllowed;
       
    59 class MLtsyDispatchSatReady;
       
    60 class MLtsyDispatchSatPCmdNotification;
       
    61 class MLtsyDispatchSatUssdControlEnvelopeError;
       
    62 class MLtsyDispatchSatTimerExpirationEnvelope;
       
    63 class MLtsyDispatchSatTerminalRsp;
       
    64 class MLtsyDispatchSatMenuSelectionEnvelope;
       
    65 class MLtsyDispatchSatEventDownloadEnvelope;
       
    66 class MLtsyDispatchSatGetUssdControlSupported;
       
    67 
       
    68 class MStkTsyCallOrigin;
       
    69 
       
    70 
       
    71 
       
    72 // CLASS DECLARATION
       
    73 
       
    74 /**
       
    75  * This class is responsible for packing and unpacking data belonging
       
    76  * to Sat related requests to the Licensee LTSY.
       
    77  */
       
    78 class CSatDispatcher : public CBase, public MDispatcherCallback
       
    79 	{
       
    80 public:
       
    81 
       
    82 	virtual ~CSatDispatcher();
       
    83 	
       
    84 	static CSatDispatcher* NewL(
       
    85 			MLtsyDispatchFactoryV1& aLtsyFactory,
       
    86 			MmMessageManagerCallback& aTsyMessageManagerCallback,
       
    87 			MmMessageManagerCallback& aSatMessageManagerCallback,
       
    88 			CRequestQueueOneShot& aRequestAsyncOneShot);
       
    89 	
       
    90 	static CSatDispatcher* NewLC(
       
    91 			MLtsyDispatchFactoryV1& aLtsyFactory,
       
    92 			MmMessageManagerCallback& aTsyMessageManagerCallback,
       
    93 			MmMessageManagerCallback& aSatMessageManagerCallback,
       
    94 			CRequestQueueOneShot& aRequestAsyncOneShot);
       
    95 	
       
    96 
       
    97 	// Dispatcher functions for dispatching requests DOWN to the Licensee LTSY
       
    98 	
       
    99 	TInt DispatchSmsDeliverReportL(const CMmDataPackage* aDataPackage);
       
   100 	TInt DispatchGetImageInstanceL(const CMmDataPackage* aDataPackage);
       
   101 	TInt DispatchGetIconDataL(const CMmDataPackage* aDataPackage);
       
   102 	TInt DispatchGetClutL(const CMmDataPackage* aDataPackage);
       
   103 	TInt DispatchGetDefaultBearerCapabilityL();
       
   104 	TInt DispatchSmsPpDdlStatusL();
       
   105 	TInt DispatchGetSmsControlActivatedL();
       
   106 	TInt DispatchCellBroadcastL(const CMmDataPackage* aDataPackage);
       
   107 	TInt DispatchTimingAdvanceL();
       
   108 	TInt DispatchNotifySmControlRequestL(const CMmDataPackage* aDataPackage);
       
   109 	TInt DispatchProvideLocationInfoL();
       
   110 	TInt DispatchSetPollingIntervalL(const CMmDataPackage* aDataPackage);
       
   111 	TInt DispatchSmsPpDdlL(const CMmDataPackage* aDataPackage);
       
   112 	TInt DispatchAccessTechnologyL();
       
   113 	TInt DispatchLocalInformationNmrL();
       
   114 	TInt DispatchSendEnvelopeL(const CMmDataPackage* aDataPackage);
       
   115 	TInt DispatchServiceRequestL(const CMmDataPackage* aDataPackage);
       
   116 	TInt DispatchReadyL();
       
   117 	TInt DispatchPCmdNotificationL(const CMmDataPackage* aDataPackage);
       
   118 	TInt DispatchUssdControlEnvelopeErrorL();
       
   119 	TInt DispatchTimerExpiredL(const CMmDataPackage* aDataPackage);
       
   120 	TInt DispatchTerminalRspL(const CMmDataPackage* aDataPackage);
       
   121 	TInt DispatchMenuSelectionL(const CMmDataPackage* aDataPackage);
       
   122 	TInt DispatchEventDownloadL(const CMmDataPackage* aDataPackage);
       
   123 	TInt DispatchGetUssdControlSupportedL();
       
   124 	
       
   125 	
       
   126 	// Complete functions for receiving completions UP from the Licensee LTSY
       
   127 	// via the CCtsyDispatcherCallback object.
       
   128 	
       
   129 	void CallbackUssdControlSupported(TInt aError, TBool aUssdStatus);
       
   130 	void CallbackPcmd(TInt aError, const TDesC8& aData);
       
   131 	void CallbackNotifyProactiveSimSessionEnd(TInt aError, TUint8 aStatusWord1, TUint8 aStatusWord2);
       
   132 	void CallbackTimeZoneChange(TInt aError, TUint8 aTimeZone);
       
   133 	void CallbackAccessTechnologyChange(TInt aError, TUint8 aCurrentAccessTechnology);
       
   134 	void CallbackCallConnected(TInt aError, TUint8 aTransactionId, TBool aNearEnd);
       
   135 	void CallbackSsChange(TInt aError, DispatcherSat::TSsStatus aStatus);
       
   136 	void CallbackCallDisconnected(TInt aError, TUint8 aTransactionId, TBool aNearEnd, const TDesC8& aCause);
       
   137 	void CallbackMtCall(TInt aError, TUint8 aTransactionId, const TDesC8& aAddress, const TDesC8& aSubAddress);
       
   138 	void CallbackCallControlEnvelopeResponse(TInt aError, const TDesC8& aResponseTlv);
       
   139 	void CallbackCreateCallControlEnvelope(TInt aError, TUint8 aTag, const TDesC8& aBcc1, const TDesC8& aBcc2, const TDesC8& aAddress, TUint8 aTonNpi, TUint8 aDcs);
       
   140 	void CallbackCreateSmControlEnvelope(TInt aError, const TDesC8& aRpDestinationAddress, const TDesC8& aTpDestinationAddress);
       
   141 	void CallbackImsiChanged(TInt aError);
       
   142 	void CallbackLocationStatus(TInt aError, TUint8 aLcnStatus, const TDesC8& aCountryCode,
       
   143 			TUint16 aLcnAreaCode, TUint16 aCellId);
       
   144 	void CallbackRemoveEventList(TInt aError);
       
   145 	void CallbackCreateRefreshTerminalRsp(TInt aError, RSat::TPCmdResult aGeneralResult, const TDesC& aResultAdditionalInfo);
       
   146 	void CallbackSmControlEnvelopeResponse(TInt aError, const TDesC8& aResponseTlv);
       
   147 	void CallbackSatCreateSmsPpDownloadEnvelope(TInt aError, const TDesC8& aAddress, const TDesC8& aSmsTpdu);
       
   148 	void CallbackCreateSmsDeliverReport(TInt aError);
       
   149 	void CallbackCreateCellBroadcastEnvelope(TInt aError, const TDesC8& aCellBroadcastPage);
       
   150 	void CallbackGetImageInstance(TInt aError, const TDesC8& aImageInstanceData, const TDesC8& aImageInstanceBody);
       
   151 	void CallbackGetIconData(TInt aError, const TDesC8& aIconEfImgRecord);
       
   152 	void CallbackGetClut(TInt aError, const TDesC8& aClut);
       
   153 	void CallbackGetDefaultBearerCapability(TInt aError, const TDesC8& aCapability);
       
   154 	void CallbackGetSmsPpDownloadSupported(TInt aError, TBool aSupported);
       
   155 	void CallbackGetSmsControlActivated(TInt aError, TBool aSmsMoControlActivated);
       
   156 	void CallbackTimingAdvance(TInt aError, TUint8 aTimingAdvance, TUint8 aMeStatus);
       
   157 	void CallbackProvideLocationInfo(TInt aError, TUint16 aLocationAreaCode, TUint16 aCellId, 
       
   158 			const TDesC8& aOperatorCode);
       
   159 	void CallbackSetPolling(TInt aError, TUint8 aPollingInterval);
       
   160 	void CallbackLocalInformationNmr(TInt aError, const TDesC8& aNmr, const TDesC& aBcchList);
       
   161 	void CallbackRefreshAllowed(TInt aError);
       
   162 	void CallbackReady(TInt aError);
       
   163 	void CallbackGetAccessTechnology(TInt aError, TUint8 aAccessTechnology);
       
   164 	void CallbackUssdControlEnvelopeError(TInt aError);
       
   165 	void CallbackTerminalRsp(TInt aError);
       
   166 	
       
   167 	// From MDispatcherCallback
       
   168 	void CallbackSync(CRequestQueueOneShot::TIpcDataPackage& aIpcDataPackage);
       
   169 
       
   170 	// Other public functions
       
   171 	void SetDispatcherHolder(TDispatcherHolder& aDispatcherHolder);
       
   172 	
       
   173 	void SetSatCallOriginInterface(MStkTsyCallOrigin& aSatCallOrigin);
       
   174 	
       
   175 	TBool IsSimOriginatedCall(const RMobilePhone::TMobileAddress& aDialledParty);
       
   176 
       
   177 private:
       
   178 
       
   179 	CSatDispatcher(MLtsyDispatchFactoryV1& aLtsyFactory,
       
   180 	   			  	 MmMessageManagerCallback& aMessageManagerCallback,
       
   181 	   			  	 MmMessageManagerCallback& aSatMessageManagerCallback,
       
   182 	   			  	 CRequestQueueOneShot& aRequestAsyncOneShot);		
       
   183 	
       
   184 	void ConstructL();
       
   185 	
       
   186 	void CompleteNotifyLocalInfo(TInt aError);
       
   187 	
       
   188 private:	// Not owned
       
   189 	MStkTsyCallOrigin* iStkTsyCallOrigin;
       
   190 
       
   191 private:	// Not owned
       
   192 	MLtsyDispatchFactoryV1& iLtsyFactoryV1;
       
   193 	MmMessageManagerCallback& iTsyMessageManagerCallback;
       
   194 	MmMessageManagerCallback& iMessageManagerCallback;
       
   195 	CRequestQueueOneShot& iRequestAsyncOneShot;
       
   196 	TDispatcherHolder* iDispatcherHolder;
       
   197 	
       
   198 	// Interfaces in the Licensee LTSY, not owned by this object
       
   199 	
       
   200     MLtsyDispatchSatSmsDeliverReport* iLtsyDispatchSatSmsDeliverReport;
       
   201     MLtsyDispatchSatGetImageInstance* iLtsyDispatchSatGetImageInstance;
       
   202     MLtsyDispatchSatGetIconData* iLtsyDispatchSatGetIconData;
       
   203     MLtsyDispatchSatGetClut* iLtsyDispatchSatGetClut;
       
   204     MLtsyDispatchSatGetDefaultBearerCapability* iLtsyDispatchSatGetDefaultBearerCapability;
       
   205     MLtsyDispatchSatGetSmsPpDownloadSupported* iLtsyDispatchSatGetSmsPpDownloadSupported;
       
   206     MLtsyDispatchSatGetSmsControlActivated* iLtsyDispatchSatGetSmsControlActivated;
       
   207     MLtsyDispatchSatCellBroadcastEnvelope* iLtsyDispatchSatCellBroadcast;
       
   208     MLtsyDispatchSatTimingAdvance* iLtsyDispatchSatTimingAdvance;
       
   209     MLtsyDispatchSatSmControlResponseData* iLtsyDispatchSatSmControlResponseData;
       
   210     MLtsyDispatchSatProvideLocationInfo* iLtsyDispatchSatProvideLocationInfo;
       
   211     MLtsyDispatchSatSetPollingInterval* iLtsyDispatchSatSetPollingInterval;
       
   212     MLtsyDispatchSatSmsPpDownloadEnvelope* iLtsyDispatchSatSmsPpDownloadEnvelope;
       
   213     MLtsyDispatchSatLocalInformationNmr* iLtsyDispatchSatLocalInformationNmr;
       
   214     MLtsyDispatchSatCallAndSmsControlEnvelope* iLtsyDispatchSatSendEnvelope;
       
   215     MLtsyDispatchSatRefreshAllowed* iLtsyDispatchSatRefreshAllowed;
       
   216     MLtsyDispatchSatReady* iLtsyDispatchSatReady;
       
   217     MLtsyDispatchSatPCmdNotification* iLtsyDispatchSatPCmdNotification;
       
   218     MLtsyDispatchSatUssdControlEnvelopeError* iLtsyDispatchSatUssdControlEnvelopeError;
       
   219     MLtsyDispatchSatTimerExpirationEnvelope* iLtsyDispatchSatTimerExpired;
       
   220     MLtsyDispatchSatTerminalRsp* iLtsyDispatchSatTerminalRsp;
       
   221     MLtsyDispatchSatGetAccessTechnology* iLtsyDispatchSatAccTech;
       
   222     MLtsyDispatchSatMenuSelectionEnvelope* iLtsyDispatchSatMenuSelection;
       
   223     MLtsyDispatchSatEventDownloadEnvelope* iLtsyDispatchSatEventDownload;
       
   224     MLtsyDispatchSatGetUssdControlSupported* iLtsyDispatchSatGetUssdControlSupported;
       
   225       
       
   226     //record that a provide local info proactive command is currently operating and that
       
   227     //a request has been sent to the LTSY for the particular info we need, and when it arrives
       
   228     //we can complete the terminal response and proactive command.
       
   229     TBool iLocalInfoOngoing;
       
   230 
       
   231 	}; // class CSatDispatcher
       
   232 
       
   233 #endif // __CSATDISPATCHER_H_
       
   234