telephonyserverplugins/ctsydispatchlayer/inc/csmsdispatcher.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 __CSMSDISPATCHER_H_
       
    22 #define __CSMSDISPATCHER_H_
       
    23 
       
    24 // INCLUDES
       
    25 #include <e32std.h>
       
    26 #include <e32base.h>
       
    27 #include <e32def.h>
       
    28 #include <etelmm.h>
       
    29 
       
    30 #include <ctsy/ltsy/mltsydispatchfactory.h>
       
    31 
       
    32 #include <ctsy/ltsy/mltsydispatchsmsinterface.h>
       
    33 
       
    34 #include "requestqueueoneshot.h"
       
    35 #include <ctsy/ltsy/ltsylogger.h>
       
    36 #include "mdispatchercallback.h"
       
    37 
       
    38 // FORWARD DECLARATIONS
       
    39 class CMmDataPackage;
       
    40 class MmMessageManagerCallback;
       
    41 class TDispatcherHolder;
       
    42 
       
    43 class MLtsyDispatchSmsSendSatSms;
       
    44 class MLtsyDispatchSmsGetSmsStoreInfo;
       
    45 class MLtsyDispatchSmsGetSmspList;
       
    46 class MLtsyDispatchSmsNackSmsStored;
       
    47 class MLtsyDispatchSmsAckSmsStored;
       
    48 class MLtsyDispatchSmsResumeSmsReception;
       
    49 class MLtsyDispatchSmsSendSmsMessage;
       
    50 class MLtsyDispatchSmsSendSmsMessageNoFdnCheck;
       
    51 class MLtsyDispatchSmsSetMoSmsBearer;
       
    52 class MLtsyDispatchSmsStoreSmspList;
       
    53 class MLtsyDispatchSmsStoreSmspListEntry;
       
    54 
       
    55 
       
    56 // CLASS DECLARATION
       
    57 
       
    58 /**
       
    59  * This class is responsible for packing and unpacking data belonging
       
    60  * to Sms related requests to the Licensee LTSY.
       
    61  */
       
    62 class CSmsDispatcher : public CBase, public MDispatcherCallback
       
    63 	{
       
    64 public:
       
    65 
       
    66 	virtual ~CSmsDispatcher();
       
    67 	
       
    68 	static CSmsDispatcher* NewL(
       
    69 			MLtsyDispatchFactoryV1& aLtsyFactory,
       
    70 			MmMessageManagerCallback& aMessageManagerCallback,
       
    71 			CRequestQueueOneShot& aRequestAsyncOneShot);
       
    72 	
       
    73 	static CSmsDispatcher* NewLC(
       
    74 			MLtsyDispatchFactoryV1& aLtsyFactory,
       
    75 			MmMessageManagerCallback& aMessageManagerCallback,
       
    76 			CRequestQueueOneShot& aRequestAsyncOneShot);
       
    77 	
       
    78 	// Dispatcher functions for dispatching requests DOWN to the Licensee LTSY
       
    79 	
       
    80 	TInt DispatchActivateSmsRoutingL();
       
    81 	TInt DispatchSendSatSmsL(const CMmDataPackage* aDataPackage);
       
    82 	TInt DispatchGetSmsStoreInfoL();
       
    83 	TInt DispatchGetSmspListL();
       
    84 	TInt DispatchNackSmsStoredL(const CMmDataPackage* aDataPackage);
       
    85 	TInt DispatchAckSmsStoredL(const CMmDataPackage* aDataPackage);
       
    86 	TInt DispatchResumeSmsReceptionL();
       
    87 	TInt DispatchSendSmsMessageL(const CMmDataPackage* aDataPackage);
       
    88 	TInt DispatchSendSmsMessageNoFdnCheckL(const CMmDataPackage* aDataPackage);
       
    89 	TInt DispatchSetMoSmsBearerL(const CMmDataPackage* aDataPackage);
       
    90 	TInt DispatchStoreSmspListEntryL(const CMmDataPackage* aDataPackage);
       
    91 	
       
    92 	
       
    93 	// Complete functions for receiving completions UP from the Licensee LTSY
       
    94 	// via the CCtsyDispatcherCallback object.
       
    95 	
       
    96 	void CallbackNotifyReceiveSmsMessage(TInt aError, TBool aInd, const TSmsMsg& aSmsMessage);
       
    97 	void CallbackSendSatSms(TInt aError);
       
    98 	void CallbackGetSmsStoreInfo(TInt aError, TInt aTotalEntries, TInt aUsedEntries);
       
    99 	void CallbackGetSmspList(TInt aError, const TDesC& aServiceCenterAddress, const TDesC& aDestinationAddress,
       
   100 	           const TDesC& aAlphaTagData, const DispatcherSim::TSmsParameters& aSmsParameters, TBool aMoreToCome);
       
   101 	void CallbackNackSmsStored(TInt aError);
       
   102 	void CallbackAckSmsStored(TInt aError);
       
   103 	void CallbackResumeSmsReception(TInt aError);
       
   104 	void CallbackSendSmsMessage(TInt aError, TInt aMsgRef, const TDesC8& aSmsSubmitReport);
       
   105 	void CallbackSendSmsMessageNoFdnCheck(TInt aError, TInt aMsgRef, const TDesC8& aSmsSubmitReport);
       
   106 	void CallbackSetMoSmsBearer(TInt aError);
       
   107 	void CallbackStoreSmspListEntry(TInt aError);
       
   108 	//internal callbacks
       
   109 	void CallbackActivateSmsRouting(CRequestQueueOneShot::TIpcDataPackage* aDataPackage);
       
   110 	
       
   111 	// From MDispatcherCallback
       
   112 	void CallbackSync(CRequestQueueOneShot::TIpcDataPackage& aIpcDataPackage);
       
   113 
       
   114 	// Other public functions
       
   115 	void SetDispatcherHolder(TDispatcherHolder& aDispatcherHolder);
       
   116 	
       
   117 private:
       
   118 
       
   119 	CSmsDispatcher(MLtsyDispatchFactoryV1& aLtsyFactory,
       
   120 	   			  	 MmMessageManagerCallback& aMessageManagerCallback,
       
   121 	   			  	 CRequestQueueOneShot& aRequestAsyncOneShot);		
       
   122 	
       
   123 	void ConstructL();
       
   124 	
       
   125 private:	// Not owned
       
   126 
       
   127 	MLtsyDispatchFactoryV1& iLtsyFactoryV1;
       
   128 	MmMessageManagerCallback& iMessageManagerCallback;
       
   129 	CRequestQueueOneShot& iRequestAsyncOneShot;
       
   130 	TDispatcherHolder* iDispatcherHolder;
       
   131 	
       
   132 	// Interfaces in the Licensee LTSY, not owned by this object
       
   133 	
       
   134     MLtsyDispatchSmsSendSatSms* iLtsyDispatchSmsSendSatSms;
       
   135     MLtsyDispatchSmsGetSmsStoreInfo* iLtsyDispatchSmsGetSmsStoreInfo;
       
   136     MLtsyDispatchSmsGetSmspList* iLtsyDispatchSmsGetSmspList;
       
   137     MLtsyDispatchSmsNackSmsStored* iLtsyDispatchSmsNackSmsStored;
       
   138     MLtsyDispatchSmsAckSmsStored* iLtsyDispatchSmsAckSmsStored;
       
   139     MLtsyDispatchSmsResumeSmsReception* iLtsyDispatchSmsResumeSmsReception;
       
   140     MLtsyDispatchSmsSendSmsMessage* iLtsyDispatchSmsSendSmsMessage;
       
   141     MLtsyDispatchSmsSendSmsMessageNoFdnCheck* iLtsyDispatchSmsSendSmsMessageNoFdnCheck;
       
   142     MLtsyDispatchSmsSetMoSmsBearer* iLtsyDispatchSmsSetMoSmsBearer;
       
   143     MLtsyDispatchSmsStoreSmspListEntry* iLtsyDispatchSmsStoreSmspListEntry;
       
   144     
       
   145     CArrayPtrFlat< TSmsParameters >* iLtsyDataList;   
       
   146 
       
   147 	}; // class CSmsDispatcher
       
   148 
       
   149 #endif // __CSMSDISPATCHER_H_
       
   150