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 CCaMmcWatcher;
|
|
32 |
class TPluginParams;
|
|
33 |
|
|
34 |
namespace Usif
|
|
35 |
{
|
|
36 |
class CComponentEntry;
|
|
37 |
}
|
85
|
38 |
|
|
39 |
using namespace Usif;
|
|
40 |
|
|
41 |
/*
|
|
42 |
An implementation of the CCaSrvPlugin interface for the Reference Installer.
|
|
43 |
|
92
|
44 |
The CaSrvManager loads and uses this plug-in when the MIME type of a package
|
|
45 |
is 'binary/sif-refpkg'.
|
85
|
46 |
*/
|
92
|
47 |
NONSHARABLE_CLASS(CCaUsifScanner): public CCaSrvPlugin,
|
|
48 |
public MCaInstallListener, public MMmcWatcherCallback
|
85
|
49 |
{
|
|
50 |
public:
|
92
|
51 |
|
|
52 |
/**
|
|
53 |
* Two-phased constructor.
|
102
|
54 |
* @param aPLuginParam plugin param consist of storage, storage utils and scr.
|
92
|
55 |
* @retval New object.
|
|
56 |
*/
|
85
|
57 |
static CCaUsifScanner* NewL( TPluginParams* aPluginParams );
|
92
|
58 |
|
|
59 |
/**
|
|
60 |
* Destructor.
|
|
61 |
*/
|
85
|
62 |
~CCaUsifScanner();
|
|
63 |
|
92
|
64 |
public:
|
94
|
65 |
// From MCaInstallListener.
|
92
|
66 |
|
|
67 |
/**
|
|
68 |
* Handle Install/Uninstall Event.
|
|
69 |
* @since S60 v5.0
|
|
70 |
* @param aUid installed uid.
|
|
71 |
*/
|
119
|
72 |
void HandleInstallNotifyL();
|
92
|
73 |
|
94
|
74 |
public:
|
|
75 |
// From MMmcWatcherCallback.
|
|
76 |
|
92
|
77 |
/**
|
|
78 |
* MmcChangeL is called when the MMC is removed or inserted.
|
|
79 |
*/
|
|
80 |
void MmcChangeL();
|
85
|
81 |
|
|
82 |
private:
|
92
|
83 |
|
|
84 |
/**
|
|
85 |
* Constructor
|
|
86 |
* @param aStorageProxy Storage handler.
|
102
|
87 |
* @param aSoftwareRegistry software component registry.
|
92
|
88 |
*/
|
102
|
89 |
CCaUsifScanner( CCaStorageProxy& aStorageProxy,
|
|
90 |
RSoftwareComponentRegistry& aSoftwareRegistry );
|
92
|
91 |
|
|
92 |
/**
|
|
93 |
* Second phased constructor.
|
|
94 |
*/
|
85
|
95 |
void ConstructL();
|
92
|
96 |
|
|
97 |
/**
|
|
98 |
* Creates AppLib's entry from Usif's entry
|
|
99 |
* @param aEntry Usif entry obtained from Sif database.
|
|
100 |
* @param aCaEntry AppLib entry to be filled from Usif entry.
|
|
101 |
*/
|
85
|
102 |
void CreateCaEntryFromEntryL( const CComponentEntry* aEntry,
|
|
103 |
CCaInnerEntry* aCaEntry );
|
|
104 |
|
92
|
105 |
/**
|
|
106 |
* Adds package to database. Scans Sif db and adds entries to AppLib db.
|
|
107 |
*/
|
|
108 |
void AddPackageL();
|
|
109 |
|
|
110 |
/**
|
|
111 |
* Updates package in the database.
|
|
112 |
*/
|
|
113 |
void UpdatePackagesL();
|
|
114 |
|
|
115 |
/**
|
|
116 |
* Gets entries from AppLib story.
|
|
117 |
* @param aArray Array of entries to be obtained from db.
|
|
118 |
*/
|
|
119 |
void GetCaPackageEntriesL( RPointerArray<CCaInnerEntry>& aArray );
|
|
120 |
|
|
121 |
/**
|
|
122 |
* Gets entries from Usif story.
|
|
123 |
* @param aArray Array of entries to be obtained from db.
|
|
124 |
*/
|
|
125 |
void GetUsifPackageEntriesL( RPointerArray<CComponentEntry>& aArray );
|
85
|
126 |
|
92
|
127 |
/**
|
|
128 |
* Checks if entry exists in AppLib db.
|
|
129 |
* @param aArray Array of entries from AppLib db.
|
|
130 |
* @param aEntry Entry data to be checked if exists.
|
|
131 |
* @retval Returns array index if exists, otherwise KErrNotFound.
|
|
132 |
*/
|
94
|
133 |
TInt PackageExists( RPointerArray<CCaInnerEntry>& aArray,
|
92
|
134 |
const CComponentEntry* aEntry );
|
85
|
135 |
|
92
|
136 |
/**
|
|
137 |
* Finds deleted entries from Usif. Updates aCaArray.
|
|
138 |
* @param aCaArray Entries from AppLib db.
|
|
139 |
* @param aUsifArray Entries from Usif db.
|
|
140 |
*/
|
|
141 |
void FindDeletedEntriesL( RPointerArray<CCaInnerEntry>& aCaArray,
|
|
142 |
const RPointerArray<CComponentEntry>& aUsifArray );
|
|
143 |
|
|
144 |
/**
|
|
145 |
* Removes entries from db.
|
|
146 |
* @param aCaArray Entries to be removed.
|
|
147 |
*/
|
|
148 |
void RemoveEntriesFromDbL( RPointerArray<CCaInnerEntry>& aCaArray );
|
|
149 |
|
|
150 |
/**
|
|
151 |
* Update usif list.
|
|
152 |
*/
|
|
153 |
void UpdateUsifListL();
|
85
|
154 |
|
|
155 |
private:
|
92
|
156 |
/**
|
85
|
157 |
* not own
|
92
|
158 |
* Storage proxy.
|
85
|
159 |
*/
|
|
160 |
CCaStorageProxy& iStorageProxy;
|
|
161 |
|
92
|
162 |
/**
|
|
163 |
* Install notifier. Own.
|
|
164 |
*/
|
119
|
165 |
CCaInstallNotifier *iInstallNotifier;
|
92
|
166 |
|
|
167 |
/**
|
|
168 |
* File session. Own
|
|
169 |
*/
|
|
170 |
RFs iFs;
|
|
171 |
|
|
172 |
/**
|
|
173 |
* Mmc watcher. Own.
|
|
174 |
*/
|
|
175 |
CCaMmcWatcher* iMmcWatcher;
|
|
176 |
|
|
177 |
/**
|
102
|
178 |
* Software component registry. Not own.
|
92
|
179 |
*/
|
102
|
180 |
RSoftwareComponentRegistry& iSoftwareRegistry;
|
92
|
181 |
|
85
|
182 |
};
|
|
183 |
|
|
184 |
#endif // CAUSIFSCANNER_H
|