author | William Roberts <williamr@symbian.org> |
Wed, 31 Mar 2010 12:33:34 +0100 | |
branch | Symbian3 |
changeset 4 | 837f303aceeb |
parent 3 | e1b950c65cb4 |
permissions | -rw-r--r-- |
williamr@2 | 1 |
// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). |
williamr@2 | 2 |
// All rights reserved. |
williamr@2 | 3 |
// This component and the accompanying materials are made available |
williamr@4 | 4 |
// under the terms of "Eclipse Public License v1.0" |
williamr@2 | 5 |
// which accompanies this distribution, and is available |
williamr@4 | 6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
williamr@2 | 7 |
// |
williamr@2 | 8 |
// Initial Contributors: |
williamr@2 | 9 |
// Nokia Corporation - initial contribution. |
williamr@2 | 10 |
// |
williamr@2 | 11 |
// Contributors: |
williamr@2 | 12 |
// |
williamr@2 | 13 |
// Description: |
williamr@2 | 14 |
// |
williamr@2 | 15 |
|
williamr@2 | 16 |
#if !defined __MTUDREG_H__ |
williamr@2 | 17 |
#define __MTUDREG_H__ |
williamr@2 | 18 |
|
williamr@2 | 19 |
#if !defined (__MTCLREG_H__) |
williamr@2 | 20 |
#include <mtclreg.h> |
williamr@2 | 21 |
#endif |
williamr@2 | 22 |
|
williamr@2 | 23 |
class CBaseMtmUiData; |
williamr@2 | 24 |
|
williamr@2 | 25 |
/** UI Data MTM factory function. |
williamr@2 | 26 |
|
williamr@2 | 27 |
A concrete UI Data MTM must implement an exported factory function of this |
williamr@2 | 28 |
type. It should return an instance of the CBaseMtmUiData-derived class that |
williamr@2 | 29 |
provides the implementation. The factory function is called by the UI Data |
williamr@2 | 30 |
MTM registry when a client requests this UI Data MTM. |
williamr@2 | 31 |
|
williamr@2 | 32 |
A CBaseMtmUiData-derived class typically provides a NewL() function, which |
williamr@2 | 33 |
the factory function calls. |
williamr@2 | 34 |
|
williamr@2 | 35 |
The factory function is called by ordinal. The ordinal of the function must |
williamr@2 | 36 |
match that recorded in the MTM's registry information. |
williamr@2 | 37 |
|
williamr@2 | 38 |
The CRegisteredMtmDll& argument passes the registration data for the MTM DLL. |
williamr@2 | 39 |
|
williamr@2 | 40 |
The return value is a newly-created instance of the CBaseMtmUi-derived class |
williamr@2 | 41 |
for the User Interface MTM. |
williamr@2 | 42 |
|
williamr@2 | 43 |
The factory function should leave if it cannot create the object. |
williamr@2 | 44 |
|
williamr@2 | 45 |
For example, a UI Data MTM whose concrete class was CEgMtmUiData could define |
williamr@2 | 46 |
a suitable factory function as: |
williamr@2 | 47 |
|
williamr@2 | 48 |
@code |
williamr@2 | 49 |
EXPORT_C CBaseMtmUiData* NewEgMtmL(CRegisteredMtmDll& aRegisteredMtmDll) |
williamr@2 | 50 |
{ |
williamr@2 | 51 |
return CEgMtmUiData::NewL(aRegisteredMtmDll); |
williamr@2 | 52 |
} |
williamr@2 | 53 |
@endcode */ |
williamr@2 | 54 |
typedef CBaseMtmUiData* MtmUiDataFactoryFunctionL(CRegisteredMtmDll&); |
williamr@2 | 55 |
|
williamr@2 | 56 |
// Client side MTM UI data registry |
williamr@2 | 57 |
|
williamr@2 | 58 |
class CMtmUiDataRegistry : public CObserverRegistry |
williamr@2 | 59 |
/** Accesses the UI Data MTM registry. |
williamr@2 | 60 |
|
williamr@2 | 61 |
This registry holds details of the all the |
williamr@2 | 62 |
UI Data MTMs currently available on the system. Message client applications |
williamr@2 | 63 |
use this class to get a CBaseMtmUiData-derived object by which to access UI |
williamr@2 | 64 |
Data MTM functionality. |
williamr@2 | 65 |
|
williamr@2 | 66 |
Note that the base class CMtmDllRegistry provides functions for discovering |
williamr@2 | 67 |
what MTMs are present in the registry. |
williamr@2 | 68 |
@publishedAll |
williamr@2 | 69 |
@released |
williamr@2 | 70 |
*/ |
williamr@2 | 71 |
{ |
williamr@2 | 72 |
public: |
williamr@2 | 73 |
IMPORT_C static CMtmUiDataRegistry* NewL(CMsvSession& aMsvSession, |
williamr@2 | 74 |
TTimeIntervalMicroSeconds32 aTimeoutMicroSeconds32=TTimeIntervalMicroSeconds32(30000000)); |
williamr@2 | 75 |
virtual ~CMtmUiDataRegistry(); |
williamr@2 | 76 |
IMPORT_C CBaseMtmUiData* NewMtmUiDataLayerL(const TUid& aMtmTypeUid); |
williamr@2 | 77 |
// |
williamr@2 | 78 |
protected: |
williamr@2 | 79 |
CMtmUiDataRegistry(CMsvSession& aMsvSession, TTimeIntervalMicroSeconds32 aTimeoutMicroSeconds32); |
williamr@2 | 80 |
// |
williamr@2 | 81 |
private: |
williamr@2 | 82 |
CBaseMtmUiData* NewMtmL(const RLibrary& aLib, CRegisteredMtmDll& aReg) const; |
williamr@2 | 83 |
}; |
williamr@2 | 84 |
|
williamr@2 | 85 |
|
williamr@2 | 86 |
|
williamr@2 | 87 |
#endif // __MTUDREG_H__ |