|
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 |
|
17 #if !defined __MTCLREG_H__ |
|
18 #define __MTCLREG_H__ |
|
19 |
|
20 #include <e32base.h> // CActive, TFileName etc. |
|
21 #include <msvreg.h> |
|
22 #include <msvapi.h> // MMsvSessionObserver |
|
23 |
|
24 // CObserverRegistry mixes in session notification API |
|
25 // this allows run-time update of the registries on the client-side. |
|
26 // the server registry should inherit from CMtmDllRegistry |
|
27 class CObserverRegistry : public CMtmDllRegistry, public MMsvSessionObserver |
|
28 /** Base class for client, UI and UI data MTM registries. |
|
29 |
|
30 It implements the session observer interface to update the registry information |
|
31 when MTM groups are installed or uninstalled. |
|
32 @publishedAll |
|
33 @released |
|
34 */ |
|
35 { |
|
36 public: |
|
37 IMPORT_C virtual void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3); |
|
38 IMPORT_C ~CObserverRegistry(); |
|
39 |
|
40 protected: |
|
41 IMPORT_C CObserverRegistry(CMsvSession& aMsvSession,TUid aDllTypeUid,TTimeIntervalMicroSeconds32 aTimeoutMicroSeconds32); |
|
42 IMPORT_C void ConstructL(); |
|
43 |
|
44 protected: |
|
45 CMsvSession& iMsvSession; |
|
46 TBool iIsAdded; |
|
47 }; |
|
48 |
|
49 // Client side MTM registry |
|
50 class CClientMtmRegistry : public CObserverRegistry |
|
51 /** Accesses the Client-side MTM registry. |
|
52 |
|
53 This registry holds details of the all the Client-side MTMs currently available |
|
54 on the system. Message client applications use this class to get a CBaseMtm-derived |
|
55 object by which to access Client-side MTM functionality. |
|
56 |
|
57 Note that the base class CMtmDllRegistry provides functions for discovering |
|
58 what MTMs are present in the registry. |
|
59 |
|
60 @publishedAll |
|
61 @released |
|
62 */ |
|
63 { |
|
64 public: |
|
65 IMPORT_C static CClientMtmRegistry* NewL(CMsvSession& aMsvSession, TTimeIntervalMicroSeconds32 aTimeoutMicroSeconds32=TTimeIntervalMicroSeconds32(30000000)); |
|
66 IMPORT_C ~CClientMtmRegistry(); |
|
67 IMPORT_C CBaseMtm* NewMtmL(TUid aMtmTypeUid); |
|
68 // |
|
69 protected: |
|
70 CClientMtmRegistry(CMsvSession& aMsvSession,TTimeIntervalMicroSeconds32 aTimeoutMicroSeconds32); |
|
71 void ConstructL(); |
|
72 // |
|
73 private: |
|
74 CBaseMtm* DoNewMtmL(const RLibrary& aLib, CRegisteredMtmDll& aReg) const; |
|
75 }; |
|
76 |
|
77 #endif // __MTCLREG_H__ |