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@2: // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
williamr@2: // which accompanies this distribution, and is available
williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.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: // MTM client-side MTMUI registry class 
williamr@2: // 
williamr@2: //
williamr@2: 
williamr@2: #if !defined __MTUIREG_H__
williamr@2: #define __MTUIREG_H__
williamr@2: 
williamr@2: 
williamr@2: #if !defined (__E32BASE_H__)
williamr@2: #include <e32base.h>		// CActive, TFileName etc.
williamr@2: #endif
williamr@2: 
williamr@2: #if !defined (__MTCLREG_H__)
williamr@2: #include <mtclreg.h>
williamr@2: #endif
williamr@2: 
williamr@2: class CBaseMtmUi;
williamr@2: 
williamr@2: /** UI MTM factory function.
williamr@2: 
williamr@2: A concrete User Interface MTM must implement an exported factory function of 
williamr@2: this type. It should return an instance of the CBaseMtmUi-derived class that 
williamr@2: provides the implementation. The factory function is called by the User Interface 
williamr@2: MTM registry when a client requests this User Interface MTM.
williamr@2: 
williamr@2: A CBaseMtmUi-derived class typically provides a NewL() function, which the 
williamr@2: 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: For example, a User Interface MTM whose concrete class was CEgMtmUi could 
williamr@2: define a suitable factory function as:
williamr@2: 
williamr@2: @code
williamr@2: EXPORT_C CBaseMtmUi* NewEgMtmUiL(CBaseMtm& aMtm, CRegisteredMtmDll& aRegisteredDll)
williamr@2: 	{
williamr@2: 	return CEgMtmUi::NewL(aMtm, aRegisteredDll);
williamr@2: 	}@endcode
williamr@2: 
williamr@2: @param aBaseMtm The CBaseMtm requesting the object.
williamr@2: @param aRegisteredMtmDll Registration data for the MTM DLL.
williamr@2: @return A newly-created instance of the CBaseMtmUi-derived class 
williamr@2: for the User Interface MTM.
williamr@2: @leave Any The factory function should leave if it cannot create the object. */
williamr@2: typedef CBaseMtmUi* MtmUiFactoryFunctionL(CBaseMtm&, CRegisteredMtmDll&);
williamr@2: 
williamr@2: // Client side MTM registry
williamr@2: 
williamr@2: class CMtmUiRegistry : public CObserverRegistry
williamr@2: /** Accesses the User Interface MTM registry. 
williamr@2: 
williamr@2: This registry holds details of the 
williamr@2: all the User Interface MTMs currently available on the system. Message client 
williamr@2: applications use this class to get a CBaseMtmUi-derived object by which to 
williamr@2: access User Interface 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 CMtmUiRegistry* NewL(CMsvSession& aMsvSession,
williamr@2: 		TTimeIntervalMicroSeconds32 aTimeoutMicroSeconds32=TTimeIntervalMicroSeconds32(30000000));
williamr@2: 	virtual ~CMtmUiRegistry();
williamr@2: 	IMPORT_C CBaseMtmUi* NewMtmUiL(CBaseMtm& aMtm);
williamr@2: 	//
williamr@2: protected:
williamr@2: 	CMtmUiRegistry(CMsvSession& aMsvSession, TTimeIntervalMicroSeconds32 aTimeoutMicroSeconds32);
williamr@2: 	//
williamr@2: private:
williamr@2: 	CBaseMtmUi* NewMtmL(const RLibrary& aLib, CBaseMtm& aMtm, CRegisteredMtmDll& aReg) const;
williamr@2: 	};
williamr@2: 
williamr@2: 
williamr@2: 
williamr@2: #endif // __MTUIREG_H__