messagingfw/msgsrvnstore/mtmbase/inc/MTUDREG.H
changeset 0 8e480a14352b
equal deleted inserted replaced
-1:000000000000 0:8e480a14352b
       
     1 // Copyright (c) 1998-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 #if !defined __MTUDREG_H__
       
    17 #define __MTUDREG_H__
       
    18 
       
    19 #if !defined (__MTCLREG_H__)
       
    20 #include <mtclreg.h>
       
    21 #endif
       
    22 
       
    23 class CBaseMtmUiData;
       
    24 
       
    25 /** UI Data MTM factory function.
       
    26 
       
    27 A concrete UI Data MTM must implement an exported factory function of this 
       
    28 type. It should return an instance of the CBaseMtmUiData-derived class that 
       
    29 provides the implementation. The factory function is called by the UI Data 
       
    30 MTM registry when a client requests this UI Data MTM. 
       
    31 
       
    32 A CBaseMtmUiData-derived class typically provides a NewL() function, which 
       
    33 the factory function calls. 
       
    34 
       
    35 The factory function is called by ordinal. The ordinal of the function must 
       
    36 match that recorded in the MTM's registry information. 
       
    37 
       
    38 The CRegisteredMtmDll& argument passes the registration data for the MTM DLL.
       
    39 
       
    40 The return value is a newly-created instance of the CBaseMtmUi-derived class 
       
    41 for the User Interface MTM.
       
    42 
       
    43 The factory function should leave if it cannot create the object. 
       
    44 
       
    45 For example, a UI Data MTM whose concrete class was CEgMtmUiData could define 
       
    46 a suitable factory function as: 
       
    47 
       
    48 @code
       
    49 EXPORT_C CBaseMtmUiData* NewEgMtmL(CRegisteredMtmDll& aRegisteredMtmDll)
       
    50 	{
       
    51 	return CEgMtmUiData::NewL(aRegisteredMtmDll);
       
    52 	}
       
    53 @endcode */
       
    54 typedef CBaseMtmUiData* MtmUiDataFactoryFunctionL(CRegisteredMtmDll&);
       
    55 
       
    56 // Client side MTM UI data registry
       
    57 
       
    58 class CMtmUiDataRegistry : public CObserverRegistry
       
    59 /** Accesses the UI Data MTM registry. 
       
    60 
       
    61 This registry holds details of the all the 
       
    62 UI Data MTMs currently available on the system. Message client applications 
       
    63 use this class to get a CBaseMtmUiData-derived object by which to access UI 
       
    64 Data MTM functionality.
       
    65 
       
    66 Note that the base class CMtmDllRegistry provides functions for discovering 
       
    67 what MTMs are present in the registry. 
       
    68 @publishedAll
       
    69 @released
       
    70 */
       
    71 	{
       
    72 public:
       
    73 	IMPORT_C static CMtmUiDataRegistry* NewL(CMsvSession& aMsvSession,
       
    74 		TTimeIntervalMicroSeconds32 aTimeoutMicroSeconds32=TTimeIntervalMicroSeconds32(30000000));
       
    75 	virtual ~CMtmUiDataRegistry();
       
    76 	IMPORT_C CBaseMtmUiData* NewMtmUiDataLayerL(const TUid& aMtmTypeUid);
       
    77 	//
       
    78 protected:
       
    79 	CMtmUiDataRegistry(CMsvSession& aMsvSession, TTimeIntervalMicroSeconds32 aTimeoutMicroSeconds32);
       
    80 	//
       
    81 private:
       
    82 	CBaseMtmUiData* NewMtmL(const RLibrary& aLib, CRegisteredMtmDll& aReg) const;
       
    83 	};
       
    84 
       
    85 
       
    86 
       
    87 #endif // __MTUDREG_H__