telephonyserverplugins/ctsydispatchlayer/inc/cmessagerouter.h
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
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 __CMESSAGEROUTER_H_
       
    22 #define __CMESSAGEROUTER_H_
       
    23 
       
    24 //#include "mmockmesshandlerbase.h"
       
    25 #include <ctsy/pluginapi/mmessagerouter.h>
       
    26 #include <ctsy/pluginapi/mmmessagemanagercallback.h>
       
    27 
       
    28 
       
    29 // Forward declarations
       
    30 class MLtsyDispatchFactoryV1;
       
    31 
       
    32 class CCtsyDispatcherCallback;
       
    33 
       
    34 class CCallControlDispatcher;
       
    35 class CPhoneDispatcher;
       
    36 class CSecurityDispatcher;
       
    37 class CPhonebookEnDispatcher;
       
    38 class CCellBroadcastDispatcher;
       
    39 class CPhonebookOnDispatcher;
       
    40 class CPhonebookDispatcher;
       
    41 class CSimDispatcher;
       
    42 class CSmsDispatcher;
       
    43 class CCallControlMultipartyDispatcher;
       
    44 class CSupplementaryServicesDispatcher;
       
    45 class CPacketServicesDispatcher;
       
    46 class CSatDispatcher;
       
    47 
       
    48 class CMmDataPackage;
       
    49 class CRequestQueueOneShot;
       
    50 class TDispatcherHolder;
       
    51 
       
    52 class MStkTsyCallOrigin;
       
    53 
       
    54 /**
       
    55  * Interface to handle the boot sequence.  For each callback that triggers the next stage of
       
    56  *  the boot sequence a callback is used that is handled by message router.
       
    57  */
       
    58 class MBootSequenceCallbacks
       
    59 	{
       
    60 public:
       
    61 	virtual void HandleNotifyModemReadyReceivedL() = 0;
       
    62 	}; // class MBootSequenceCallbacks
       
    63 
       
    64 /**
       
    65  * Proxy class to mimic the MmMessageManagerCallback that is used by all the
       
    66  * dispatcher objects. It is used to allow a single place to put break points
       
    67  * when debugging the complete calls
       
    68  */
       
    69 class TMessageManagerCallbackProxy : public MmMessageManagerCallback
       
    70 	{
       
    71 public:
       
    72 	TMessageManagerCallbackProxy(MmMessageManagerCallback& aCtsyMessageManagerCallback);
       
    73 	TMessageManagerCallbackProxy();
       
    74 
       
    75 	void SetMessageManagerCallbackProxy(MmMessageManagerCallback& aCtsyMessageManagerCallback);
       
    76 
       
    77 public: //from MmMessageManagerCallback
       
    78 	virtual void Complete( TInt aIpc, TInt aResult );
       
    79 	virtual void Complete( TInt aIpc, CMmDataPackage* aData, TInt aResult );
       
    80 
       
    81 private:
       
    82 	MmMessageManagerCallback* iCtsyMessageManagerCallback;
       
    83 
       
    84 	}; // class TMessageManagerCallbackProxy
       
    85 
       
    86 
       
    87 /**
       
    88  * Routes messages arriving from the Common TSY to the Licensee LTSY.
       
    89  */
       
    90 class CMessageRouter : public CBase, public MMessageRouter, public MBootSequenceCallbacks
       
    91     {
       
    92 public:
       
    93     static CMessageRouter* NewL(MmMessageManagerCallback& aMessageManagerCallback);
       
    94     virtual ~CMessageRouter();
       
    95 
       
    96     void SetSatMessageManager(MmMessageManagerCallback& aMessageManagerCallback);
       
    97     
       
    98     void SetSatCallOriginInterface(MStkTsyCallOrigin& aSatCallOrigin);
       
    99     
       
   100 public: // From MMessageRouter
       
   101 
       
   102 	virtual TInt ExtFuncL(TInt aIpc, const CMmDataPackage* aDataPackage);
       
   103 
       
   104 public: //from MBootSequenceCallbacks
       
   105 	virtual void HandleNotifyModemReadyReceivedL();
       
   106 
       
   107 private:
       
   108 
       
   109 	CMessageRouter(MmMessageManagerCallback& aMessageManagerCallback);
       
   110     void ConstructL();
       
   111     void QuerySupporterCallbackIndicators();
       
   112     void RetrieveNetworkInfoL();
       
   113 
       
   114 private:
       
   115 
       
   116     void StartBootSequenceL();
       
   117 
       
   118 private:    // Owned
       
   119 
       
   120 	/**
       
   121 	 * An object to handle completions of requests from the Licensee LTSY.
       
   122 	 *
       
   123 	 * The Licensee LTSY keeps a pointer to this object.  When the Licensee LTSY wants
       
   124 	 * to notify the CTSY Dispatcher of a completion of an IPC, it calls the relevant
       
   125 	 * callback function in this object passing the completion data.
       
   126 	 */
       
   127 	CCtsyDispatcherCallback* iCtsyDispatcherCallback;
       
   128 
       
   129 	TMessageManagerCallbackProxy iMessageManagerCallbackProxy;
       
   130 
       
   131 	TMessageManagerCallbackProxy iSatMessageManagerCallbackProxy;
       
   132 
       
   133 	/**
       
   134 	 * An object to hold a queue of requests along with their completion data
       
   135 	 * which are serviced by the Licensee LTSY synchronously.  The Common TSY
       
   136 	 * expects completion of these in the same way as asynchronous requests,
       
   137 	 * hence an async one shot object is required to send the completion back
       
   138 	 * to the Common TSY.
       
   139 	 */
       
   140 	CRequestQueueOneShot* iRequestQueueOneShot;
       
   141 
       
   142 	TDispatcherHolder* iDispatcherHolder;
       
   143 
       
   144 	// Dispatchers
       
   145 	// Dispatchers do the actual unpacking and packing of data
       
   146 	// between the Common TSY and the Licensee LTSY.
       
   147 	CCallControlDispatcher* iCtsyDispatcherCallControlDispatcher;
       
   148 	CPhoneDispatcher* iCtsyDispatcherPhoneDispatcher;
       
   149 	CSecurityDispatcher* iCtsyDispatcherSecurityDispatcher;
       
   150 	CPhonebookEnDispatcher* iCtsyDispatcherPhonebookEnDispatcher;
       
   151 	CCellBroadcastDispatcher* iCtsyDispatcherCellBroadcastDispatcher;
       
   152 	CPhonebookOnDispatcher* iCtsyDispatcherPhonebookOnDispatcher;
       
   153 	CPhonebookDispatcher* iCtsyDispatcherPhonebookDispatcher;
       
   154 	CSimDispatcher* iCtsyDispatcherSimDispatcher;
       
   155 	CSmsDispatcher* iCtsyDispatcherSmsDispatcher;
       
   156 	CCallControlMultipartyDispatcher* iCtsyDispatcherCallControlMultipartyDispatcher;
       
   157 	CSupplementaryServicesDispatcher* iCtsyDispatcherSupplementaryServicesDispatcher;
       
   158 	CPacketServicesDispatcher* iCtsyDispatcherPacketServicesDispatcher;
       
   159 	CSatDispatcher* iCtsyDispatcherSatDispatcher;
       
   160 	RLibrary 		iLoadedLib;
       
   161 //private: // Not owned
       
   162 public:
       
   163 	MLtsyDispatchFactoryV1* iLtsyFactoryV1;
       
   164 
       
   165     }; // class CMessageRouter
       
   166 
       
   167 
       
   168 
       
   169 #endif // __CMESSAGEROUTER_H_
       
   170