adaptationlayer/tsy/nokiatsy_dll/internal/test/nokiatsy_test_tool/core/inc/cmmmessagerouterbase.h
changeset 4 510c70acdbf6
parent 3 1972d8c2e329
child 5 8ccc39f9d787
equal deleted inserted replaced
3:1972d8c2e329 4:510c70acdbf6
     1 /*
       
     2 * Copyright (c) 2002-2004 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 the License "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:   Routes between Tsy objects and Message Handler objects
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CMMMESSAGEROUTERBASE_H
       
    21 #define CMMMESSAGEROUTERBASE_H
       
    22 
       
    23 
       
    24 //  INCLUDES
       
    25 #include <e32base.h>
       
    26 #include "cmmmessagemanagerbase.h"
       
    27 
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class MMmMessHandlerBase;
       
    31 class CMmDataPackage;
       
    32 class CMmMessageManager;
       
    33 class CCore;
       
    34 
       
    35 // CLASS DECLARATION
       
    36 class CMmMessageRouterBase
       
    37         : public CBase
       
    38     {
       
    39 
       
    40     // public methods
       
    41     public:
       
    42 
       
    43         /**
       
    44         * Creates a new CMmMessageRouterBase object
       
    45         * @return reference to created CMmMessageRouterBase type of object
       
    46         */
       
    47         static CMmMessageRouterBase* NewL( CMmMessageManager* /*aMessageManager*/ )
       
    48 			{
       
    49 			// dummy implementation
       
    50 			return new ( ELeave ) CMmMessageRouterBase();
       
    51 			}
       
    52 
       
    53         /**
       
    54         * Destructor
       
    55         */
       
    56         IMPORT_C virtual ~CMmMessageRouterBase();
       
    57 
       
    58         /**
       
    59         * Returns pointer to the message handler for this 
       
    60 		* request, based on IPC number
       
    61         */
       
    62         IMPORT_C virtual MMmMessHandlerBase* RouteRequest( TInt /*aIpc*/ );
       
    63 
       
    64         /**
       
    65         * Completes a request or notification via the specific Tsy object,
       
    66 		* based on IPC number and data package
       
    67         */
       
    68         IMPORT_C virtual void RouteCompletion( TInt aIpc, 
       
    69             CMmDataPackage* aDataPackage, TInt aResult );
       
    70 
       
    71         /**
       
    72         * Sets the pointer to PhoneTsy (Common TSY)
       
    73         **/
       
    74         IMPORT_C void SetCore( CCore* aCore );
       
    75 
       
    76 
       
    77         /**
       
    78         * Registers a Tsy object for request and notification completions
       
    79         */
       
    80         void RegisterTsyObject( 
       
    81 			CMmMessageManagerBase::TTsyObjects aTsyObjectType, CBase* aTsyObject );
       
    82 
       
    83 
       
    84         /**
       
    85         * Deregisters a Tsy object for request and notification completions
       
    86         */
       
    87         void DeregisterTsyObject( CBase* aTsyObject );
       
    88         
       
    89    // protected methods
       
    90     protected:
       
    91       //None
       
    92     // private methods
       
    93     private:
       
    94 
       
    95 		/**
       
    96 		* Returns the type of Tsy object needed for completion, based 
       
    97 		* on the IPC number
       
    98 		*/
       
    99 		CMmMessageManagerBase::TTsyObjects GetTsyObjectFromIpc( const TInt aIpc ) const;
       
   100 
       
   101 		/**
       
   102 		* Returns the pointer to the Tsy object needed for completion, based 
       
   103 		* on the IPC number and the data package
       
   104 		*/
       
   105         CBase* GetObjectForCompletion(
       
   106                 const TInt aIpc,
       
   107                 CMmDataPackage* callPackage
       
   108                 );
       
   109 
       
   110 
       
   111     // public attributes
       
   112     public:
       
   113 
       
   114     // protected attributes
       
   115     protected:
       
   116 
       
   117 		// pointer to Core
       
   118 		CCore* iCore;
       
   119 
       
   120     // private attributes
       
   121     private:
       
   122 
       
   123     };
       
   124 
       
   125 
       
   126 #endif // CMmMessageRouterBase_H
       
   127 
       
   128 //  End of file