1 /* |
1 /* |
2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
20 #include <ecom/implementationproxy.h> |
20 #include <ecom/implementationproxy.h> |
21 #include <sacls.h> |
21 #include <sacls.h> |
22 |
22 |
23 #include "cawidgetscannerplugin.h" |
23 #include "cawidgetscannerplugin.h" |
24 #include "cawidgetstoragehandler.h" |
24 #include "cawidgetstoragehandler.h" |
25 #include "cawidgetscannerinstallnotifier.h" |
|
26 |
25 |
27 // Function used to return an instance of the proxy table. |
26 // Function used to return an instance of the proxy table. |
28 const TImplementationProxy ImplementationTable[] = |
27 const TImplementationProxy ImplementationTable[] = |
29 { |
28 { |
30 IMPLEMENTATION_PROXY_ENTRY(0x20028707, CCaWidgetScannerPlugin::NewL) |
29 IMPLEMENTATION_PROXY_ENTRY(0x20028707, CCaWidgetScannerPlugin::NewL) |
32 |
31 |
33 #ifdef COVERAGE_MEASUREMENT |
32 #ifdef COVERAGE_MEASUREMENT |
34 #pragma CTC SKIP |
33 #pragma CTC SKIP |
35 #endif //COVERAGE_MEASUREMENT (proxy for instantiation) |
34 #endif //COVERAGE_MEASUREMENT (proxy for instantiation) |
36 // ---------------------------------------------------------------------------- |
35 // ---------------------------------------------------------------------------- |
37 // |
36 // |
38 // ---------------------------------------------------------------------------- |
37 // ---------------------------------------------------------------------------- |
39 // |
38 // |
40 EXPORT_C const TImplementationProxy* |
39 EXPORT_C const TImplementationProxy* ImplementationGroupProxy( |
41 ImplementationGroupProxy( TInt& aTableCount ) |
40 TInt& aTableCount ) |
42 { |
41 { |
43 aTableCount = sizeof( ImplementationTable ) / sizeof(TImplementationProxy); |
42 aTableCount = sizeof( ImplementationTable ) / sizeof(TImplementationProxy); |
44 return ImplementationTable; |
43 return ImplementationTable; |
45 } |
44 } |
46 #ifdef COVERAGE_MEASUREMENT |
45 #ifdef COVERAGE_MEASUREMENT |
48 #endif //COVERAGE_MEASUREMENT |
47 #endif //COVERAGE_MEASUREMENT |
49 |
48 |
50 // ============================ MEMBER FUNCTIONS =============================== |
49 // ============================ MEMBER FUNCTIONS =============================== |
51 |
50 |
52 // ---------------------------------------------------------------------------- |
51 // ---------------------------------------------------------------------------- |
53 // |
52 // |
54 // ---------------------------------------------------------------------------- |
53 // ---------------------------------------------------------------------------- |
55 // |
54 // |
56 CCaWidgetScannerPlugin::CCaWidgetScannerPlugin() |
55 CCaWidgetScannerPlugin::CCaWidgetScannerPlugin() |
57 { |
56 { |
58 } |
57 } |
59 |
58 |
60 // ---------------------------------------------------------------------------- |
59 // ---------------------------------------------------------------------------- |
61 // |
60 // |
62 // ---------------------------------------------------------------------------- |
61 // ---------------------------------------------------------------------------- |
63 // |
62 // |
64 void CCaWidgetScannerPlugin::ConstructL( TPluginParams* aPluginParams ) |
63 void CCaWidgetScannerPlugin::ConstructL( TPluginParams* aPluginParams ) |
65 { |
64 { |
66 User::LeaveIfError( iFs.Connect() ); |
65 User::LeaveIfError( iFs.Connect() ); |
67 iMmcWatcher = CCaMmcWatcher::NewL( iFs, this ); |
66 iMmcWatcher = CCaMmcWatcher::NewL( iFs, this ); |
68 iInstallNotifier = CCaWidgetScannerInstallNotifier::NewL( this, |
67 iInstallNotifier = CCaInstallNotifier::NewL( *this, |
69 KUidSystemCategory, KSAUidSoftwareInstallKeyValue ); |
68 CCaInstallNotifier::ESisInstallNotification ); |
70 iStorageHandler = CCaWidgetStorageHandler::NewL( |
69 iStorageHandler = CCaWidgetStorageHandler::NewL( |
71 aPluginParams->storageProxy, |
70 aPluginParams->storageProxy, |
72 *aPluginParams->softwareRegistry, iFs ); |
71 *aPluginParams->softwareRegistry, iFs ); |
73 SynchronizeL(); |
72 SynchronizeL(); |
74 } |
73 } |
75 |
74 |
76 // ---------------------------------------------------------------------------- |
75 // ---------------------------------------------------------------------------- |
77 // |
76 // |
78 // ---------------------------------------------------------------------------- |
77 // ---------------------------------------------------------------------------- |
79 // |
78 // |
80 CCaWidgetScannerPlugin * CCaWidgetScannerPlugin::NewL( |
79 CCaWidgetScannerPlugin * CCaWidgetScannerPlugin::NewL( |
81 TPluginParams* aPluginParams ) |
80 TPluginParams* aPluginParams ) |
82 { |
81 { |
84 CleanupStack::Pop( self ); |
83 CleanupStack::Pop( self ); |
85 return self; |
84 return self; |
86 } |
85 } |
87 |
86 |
88 // ---------------------------------------------------------------------------- |
87 // ---------------------------------------------------------------------------- |
89 // |
88 // |
90 // ---------------------------------------------------------------------------- |
89 // ---------------------------------------------------------------------------- |
91 // |
90 // |
92 CCaWidgetScannerPlugin * CCaWidgetScannerPlugin::NewLC( |
91 CCaWidgetScannerPlugin * CCaWidgetScannerPlugin::NewLC( |
93 TPluginParams* aPluginParams ) |
92 TPluginParams* aPluginParams ) |
94 { |
93 { |
97 self->ConstructL( aPluginParams ); |
96 self->ConstructL( aPluginParams ); |
98 return self; |
97 return self; |
99 } |
98 } |
100 |
99 |
101 // ---------------------------------------------------------------------------- |
100 // ---------------------------------------------------------------------------- |
102 // |
101 // |
103 // ---------------------------------------------------------------------------- |
102 // ---------------------------------------------------------------------------- |
104 // |
103 // |
105 CCaWidgetScannerPlugin::~CCaWidgetScannerPlugin() |
104 CCaWidgetScannerPlugin::~CCaWidgetScannerPlugin() |
106 { |
105 { |
|
106 delete iStorageHandler; |
|
107 delete iInstallNotifier; |
107 delete iMmcWatcher; |
108 delete iMmcWatcher; |
108 delete iInstallNotifier; |
|
109 delete iStorageHandler; |
|
110 iFs.Close(); |
109 iFs.Close(); |
111 } |
110 } |
112 |
111 |
113 // ---------------------------------------------------------------------------- |
112 // ---------------------------------------------------------------------------- |
114 // |
113 // |
117 void CCaWidgetScannerPlugin::SynchronizeL() |
116 void CCaWidgetScannerPlugin::SynchronizeL() |
118 { |
117 { |
119 iStorageHandler->SynchronizeL(); |
118 iStorageHandler->SynchronizeL(); |
120 } |
119 } |
121 |
120 |
|
121 |
|
122 // ---------------------------------------------------------------------------- |
|
123 // |
|
124 // ---------------------------------------------------------------------------- |
|
125 // |
|
126 void CCaWidgetScannerPlugin::HandleInstallNotifyL() |
|
127 { |
|
128 SynchronizeL(); |
|
129 } |
122 // ---------------------------------------------------------------------------- |
130 // ---------------------------------------------------------------------------- |
123 // |
131 // |
124 // ---------------------------------------------------------------------------- |
132 // ---------------------------------------------------------------------------- |
125 // |
133 // |
126 void CCaWidgetScannerPlugin::MmcChangeL() |
134 void CCaWidgetScannerPlugin::MmcChangeL() |