williamr@2: // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@4: // under the terms of "Eclipse Public License v1.0" williamr@2: // which accompanies this distribution, and is available williamr@4: // at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // williamr@2: williamr@2: #if !defined __MTUDREG_H__ williamr@2: #define __MTUDREG_H__ williamr@2: williamr@2: #if !defined (__MTCLREG_H__) williamr@2: #include williamr@2: #endif williamr@2: williamr@2: class CBaseMtmUiData; williamr@2: williamr@2: /** UI Data MTM factory function. williamr@2: williamr@2: A concrete UI Data MTM must implement an exported factory function of this williamr@2: type. It should return an instance of the CBaseMtmUiData-derived class that williamr@2: provides the implementation. The factory function is called by the UI Data williamr@2: MTM registry when a client requests this UI Data MTM. williamr@2: williamr@2: A CBaseMtmUiData-derived class typically provides a NewL() function, which williamr@2: the factory function calls. williamr@2: williamr@2: The factory function is called by ordinal. The ordinal of the function must williamr@2: match that recorded in the MTM's registry information. williamr@2: williamr@2: The CRegisteredMtmDll& argument passes the registration data for the MTM DLL. williamr@2: williamr@2: The return value is a newly-created instance of the CBaseMtmUi-derived class williamr@2: for the User Interface MTM. williamr@2: williamr@2: The factory function should leave if it cannot create the object. williamr@2: williamr@2: For example, a UI Data MTM whose concrete class was CEgMtmUiData could define williamr@2: a suitable factory function as: williamr@2: williamr@2: @code williamr@2: EXPORT_C CBaseMtmUiData* NewEgMtmL(CRegisteredMtmDll& aRegisteredMtmDll) williamr@2: { williamr@2: return CEgMtmUiData::NewL(aRegisteredMtmDll); williamr@2: } williamr@2: @endcode */ williamr@2: typedef CBaseMtmUiData* MtmUiDataFactoryFunctionL(CRegisteredMtmDll&); williamr@2: williamr@2: // Client side MTM UI data registry williamr@2: williamr@2: class CMtmUiDataRegistry : public CObserverRegistry williamr@2: /** Accesses the UI Data MTM registry. williamr@2: williamr@2: This registry holds details of the all the williamr@2: UI Data MTMs currently available on the system. Message client applications williamr@2: use this class to get a CBaseMtmUiData-derived object by which to access UI williamr@2: Data MTM functionality. williamr@2: williamr@2: Note that the base class CMtmDllRegistry provides functions for discovering williamr@2: what MTMs are present in the registry. williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: { williamr@2: public: williamr@2: IMPORT_C static CMtmUiDataRegistry* NewL(CMsvSession& aMsvSession, williamr@2: TTimeIntervalMicroSeconds32 aTimeoutMicroSeconds32=TTimeIntervalMicroSeconds32(30000000)); williamr@2: virtual ~CMtmUiDataRegistry(); williamr@2: IMPORT_C CBaseMtmUiData* NewMtmUiDataLayerL(const TUid& aMtmTypeUid); williamr@2: // williamr@2: protected: williamr@2: CMtmUiDataRegistry(CMsvSession& aMsvSession, TTimeIntervalMicroSeconds32 aTimeoutMicroSeconds32); williamr@2: // williamr@2: private: williamr@2: CBaseMtmUiData* NewMtmL(const RLibrary& aLib, CRegisteredMtmDll& aReg) const; williamr@2: }; williamr@2: williamr@2: williamr@2: williamr@2: #endif // __MTUDREG_H__