|
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 // MTM client-side MTMUI registry class |
|
15 // |
|
16 // |
|
17 |
|
18 #if !defined __MTUIREG_H__ |
|
19 #define __MTUIREG_H__ |
|
20 |
|
21 |
|
22 #if !defined (__E32BASE_H__) |
|
23 #include <e32base.h> // CActive, TFileName etc. |
|
24 #endif |
|
25 |
|
26 #if !defined (__MTCLREG_H__) |
|
27 #include <mtclreg.h> |
|
28 #endif |
|
29 |
|
30 class CBaseMtmUi; |
|
31 |
|
32 /** UI MTM factory function. |
|
33 |
|
34 A concrete User Interface MTM must implement an exported factory function of |
|
35 this type. It should return an instance of the CBaseMtmUi-derived class that |
|
36 provides the implementation. The factory function is called by the User Interface |
|
37 MTM registry when a client requests this User Interface MTM. |
|
38 |
|
39 A CBaseMtmUi-derived class typically provides a NewL() function, which the |
|
40 factory function calls. |
|
41 |
|
42 The factory function is called by ordinal. The ordinal of the function must |
|
43 match that recorded in the MTM's registry information. |
|
44 |
|
45 For example, a User Interface MTM whose concrete class was CEgMtmUi could |
|
46 define a suitable factory function as: |
|
47 |
|
48 @code |
|
49 EXPORT_C CBaseMtmUi* NewEgMtmUiL(CBaseMtm& aMtm, CRegisteredMtmDll& aRegisteredDll) |
|
50 { |
|
51 return CEgMtmUi::NewL(aMtm, aRegisteredDll); |
|
52 }@endcode |
|
53 |
|
54 @param aBaseMtm The CBaseMtm requesting the object. |
|
55 @param aRegisteredMtmDll Registration data for the MTM DLL. |
|
56 @return A newly-created instance of the CBaseMtmUi-derived class |
|
57 for the User Interface MTM. |
|
58 @leave Any The factory function should leave if it cannot create the object. */ |
|
59 typedef CBaseMtmUi* MtmUiFactoryFunctionL(CBaseMtm&, CRegisteredMtmDll&); |
|
60 |
|
61 // Client side MTM registry |
|
62 |
|
63 class CMtmUiRegistry : public CObserverRegistry |
|
64 /** Accesses the User Interface MTM registry. |
|
65 |
|
66 This registry holds details of the |
|
67 all the User Interface MTMs currently available on the system. Message client |
|
68 applications use this class to get a CBaseMtmUi-derived object by which to |
|
69 access User Interface MTM functionality. |
|
70 |
|
71 Note that the base class CMtmDllRegistry provides functions for discovering |
|
72 what MTMs are present in the registry. |
|
73 @publishedAll |
|
74 @released |
|
75 */ |
|
76 { |
|
77 public: |
|
78 IMPORT_C static CMtmUiRegistry* NewL(CMsvSession& aMsvSession, |
|
79 TTimeIntervalMicroSeconds32 aTimeoutMicroSeconds32=TTimeIntervalMicroSeconds32(30000000)); |
|
80 virtual ~CMtmUiRegistry(); |
|
81 IMPORT_C CBaseMtmUi* NewMtmUiL(CBaseMtm& aMtm); |
|
82 // |
|
83 protected: |
|
84 CMtmUiRegistry(CMsvSession& aMsvSession, TTimeIntervalMicroSeconds32 aTimeoutMicroSeconds32); |
|
85 // |
|
86 private: |
|
87 CBaseMtmUi* NewMtmL(const RLibrary& aLib, CBaseMtm& aMtm, CRegisteredMtmDll& aReg) const; |
|
88 }; |
|
89 |
|
90 |
|
91 |
|
92 #endif // __MTUIREG_H__ |