85
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: causifscanner.h
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef CAUSIFSCANNER_H
|
|
19 |
#define CAUSIFSCANNER_H
|
|
20 |
|
|
21 |
#include <e32base.h>
|
|
22 |
#include <usif/sif/sifcommon.h>
|
|
23 |
#include <usif/scr/scr.h>
|
|
24 |
|
|
25 |
#include "casrvplugin.h"
|
92
|
26 |
#include "cainstallnotifier.h"
|
|
27 |
#include "cammcwatcher.h"
|
85
|
28 |
|
|
29 |
class CCaStorageProxy;
|
|
30 |
class CCaInnerEntry;
|
94
|
31 |
class CCaInstallNotifier;
|
|
32 |
class CCaMmcWatcher;
|
|
33 |
class TPluginParams;
|
|
34 |
|
|
35 |
namespace Usif
|
|
36 |
{
|
|
37 |
class CComponentEntry;
|
|
38 |
}
|
85
|
39 |
|
|
40 |
using namespace Usif;
|
|
41 |
|
|
42 |
/*
|
|
43 |
An implementation of the CCaSrvPlugin interface for the Reference Installer.
|
|
44 |
|
92
|
45 |
The CaSrvManager loads and uses this plug-in when the MIME type of a package
|
|
46 |
is 'binary/sif-refpkg'.
|
85
|
47 |
*/
|
92
|
48 |
NONSHARABLE_CLASS(CCaUsifScanner): public CCaSrvPlugin,
|
|
49 |
public MCaInstallListener, public MMmcWatcherCallback
|
85
|
50 |
{
|
|
51 |
public:
|
92
|
52 |
|
|
53 |
/**
|
|
54 |
* Two-phased constructor.
|
|
55 |
* @param aPLuginParam plugin param consist of storage, storage utils.
|
|
56 |
* @retval New object.
|
|
57 |
*/
|
85
|
58 |
static CCaUsifScanner* NewL( TPluginParams* aPluginParams );
|
92
|
59 |
|
|
60 |
/**
|
|
61 |
* Destructor.
|
|
62 |
*/
|
85
|
63 |
~CCaUsifScanner();
|
|
64 |
|
92
|
65 |
public:
|
94
|
66 |
// From MCaInstallListener.
|
92
|
67 |
|
|
68 |
/**
|
|
69 |
* Handle Install/Uninstall Event.
|
|
70 |
* @since S60 v5.0
|
|
71 |
* @param aUid installed uid.
|
|
72 |
*/
|
|
73 |
void HandleInstallNotifyL( TInt aUid );
|
|
74 |
|
94
|
75 |
public:
|
|
76 |
// From MMmcWatcherCallback.
|
|
77 |
|
92
|
78 |
/**
|
|
79 |
* MmcChangeL is called when the MMC is removed or inserted.
|
|
80 |
*/
|
|
81 |
void MmcChangeL();
|
85
|
82 |
|
|
83 |
private:
|
92
|
84 |
|
|
85 |
/**
|
|
86 |
* Constructor
|
|
87 |
* @param aStorageProxy Storage handler.
|
|
88 |
*/
|
85
|
89 |
CCaUsifScanner( CCaStorageProxy& aStorageProxy );
|
92
|
90 |
|
|
91 |
/**
|
|
92 |
* Second phased constructor.
|
|
93 |
*/
|
85
|
94 |
void ConstructL();
|
92
|
95 |
|
|
96 |
/**
|
|
97 |
* Creates AppLib's entry from Usif's entry
|
|
98 |
* @param aEntry Usif entry obtained from Sif database.
|
|
99 |
* @param aCaEntry AppLib entry to be filled from Usif entry.
|
|
100 |
*/
|
85
|
101 |
void CreateCaEntryFromEntryL( const CComponentEntry* aEntry,
|
|
102 |
CCaInnerEntry* aCaEntry );
|
|
103 |
|
92
|
104 |
/**
|
|
105 |
* Adds package to database. Scans Sif db and adds entries to AppLib db.
|
|
106 |
*/
|
|
107 |
void AddPackageL();
|
|
108 |
|
|
109 |
/**
|
|
110 |
* Updates package in the database.
|
|
111 |
*/
|
|
112 |
void UpdatePackagesL();
|
|
113 |
|
|
114 |
/**
|
|
115 |
* Gets entries from AppLib story.
|
|
116 |
* @param aArray Array of entries to be obtained from db.
|
|
117 |
*/
|
|
118 |
void GetCaPackageEntriesL( RPointerArray<CCaInnerEntry>& aArray );
|
|
119 |
|
|
120 |
/**
|
|
121 |
* Gets entries from Usif story.
|
|
122 |
* @param aArray Array of entries to be obtained from db.
|
|
123 |
*/
|
|
124 |
void GetUsifPackageEntriesL( RPointerArray<CComponentEntry>& aArray );
|
85
|
125 |
|
92
|
126 |
/**
|
|
127 |
* Checks if entry exists in AppLib db.
|
|
128 |
* @param aArray Array of entries from AppLib db.
|
|
129 |
* @param aEntry Entry data to be checked if exists.
|
|
130 |
* @retval Returns array index if exists, otherwise KErrNotFound.
|
|
131 |
*/
|
94
|
132 |
TInt PackageExists( RPointerArray<CCaInnerEntry>& aArray,
|
92
|
133 |
const CComponentEntry* aEntry );
|
85
|
134 |
|
92
|
135 |
/**
|
|
136 |
* Finds deleted entries from Usif. Updates aCaArray.
|
|
137 |
* @param aCaArray Entries from AppLib db.
|
|
138 |
* @param aUsifArray Entries from Usif db.
|
|
139 |
*/
|
|
140 |
void FindDeletedEntriesL( RPointerArray<CCaInnerEntry>& aCaArray,
|
|
141 |
const RPointerArray<CComponentEntry>& aUsifArray );
|
|
142 |
|
|
143 |
/**
|
|
144 |
* Removes entries from db.
|
|
145 |
* @param aCaArray Entries to be removed.
|
|
146 |
*/
|
|
147 |
void RemoveEntriesFromDbL( RPointerArray<CCaInnerEntry>& aCaArray );
|
|
148 |
|
|
149 |
/**
|
|
150 |
* Update usif list.
|
|
151 |
*/
|
|
152 |
void UpdateUsifListL();
|
85
|
153 |
|
|
154 |
private:
|
92
|
155 |
/**
|
85
|
156 |
* not own
|
92
|
157 |
* Storage proxy.
|
85
|
158 |
*/
|
|
159 |
CCaStorageProxy& iStorageProxy;
|
|
160 |
|
92
|
161 |
/**
|
|
162 |
* Install notifier. Own.
|
|
163 |
*/
|
|
164 |
CCaInstallNotifier *iSystemInstallNotifier;
|
|
165 |
|
|
166 |
/**
|
|
167 |
* Uninstall notifier. Own.
|
|
168 |
*/
|
|
169 |
CCaInstallNotifier *iUsifUninstallNotifier;
|
|
170 |
|
|
171 |
/**
|
|
172 |
* Install and uninstall notifier. Own.
|
85
|
173 |
*/
|
92
|
174 |
CCaInstallNotifier *iJavaInstallNotifier;
|
|
175 |
|
|
176 |
/**
|
|
177 |
* File session. Own
|
|
178 |
*/
|
|
179 |
RFs iFs;
|
|
180 |
|
|
181 |
/**
|
|
182 |
* Mmc watcher. Own.
|
|
183 |
*/
|
|
184 |
CCaMmcWatcher* iMmcWatcher;
|
|
185 |
|
|
186 |
/**
|
|
187 |
* Software component registry. Own.
|
|
188 |
*/
|
|
189 |
RSoftwareComponentRegistry iSoftwareRegistry;
|
|
190 |
|
85
|
191 |
};
|
|
192 |
|
|
193 |
#endif // CAUSIFSCANNER_H
|