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