85
|
1 |
/*
|
98
|
2 |
* Copyright (c) 2008 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".
|
85
|
8 |
*
|
98
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
85
|
17 |
|
|
18 |
#ifndef C_WIDGETSTORAGEHANDLER_H
|
|
19 |
#define C_WIDGETSTORAGEHANDLER_H
|
|
20 |
|
|
21 |
class CCaStorageProxy;
|
|
22 |
class CCaWidgetDescription;
|
98
|
23 |
class CCaWidgetScannerParser;
|
85
|
24 |
|
|
25 |
// INCLUDES
|
|
26 |
#include <e32base.h>
|
94
|
27 |
#include <usif/scr/scr.h>
|
85
|
28 |
#include "cawidgetdescription.h"
|
|
29 |
#include "castorage_global.h"
|
94
|
30 |
|
85
|
31 |
// CONSTANTS
|
|
32 |
|
|
33 |
// FORWARD DECLARATIONS
|
|
34 |
|
|
35 |
/**
|
|
36 |
* Widget Parser
|
|
37 |
*
|
|
38 |
* @since Series Series60 5.x
|
|
39 |
*/
|
|
40 |
class CCaWidgetStorageHandler : public CBase
|
|
41 |
{
|
|
42 |
public:
|
98
|
43 |
CA_STORAGE_TEST_FRIEND_CLASS (T_CaWidgetScanner)
|
85
|
44 |
|
|
45 |
public:
|
|
46 |
// Constructors and destructor
|
|
47 |
|
|
48 |
/**
|
|
49 |
* Two-phased constructor.
|
|
50 |
*/
|
93
|
51 |
static CCaWidgetStorageHandler* NewL( CCaStorageProxy* aStorage,
|
102
|
52 |
Usif::RSoftwareComponentRegistry& aSoftwareRegistry,
|
85
|
53 |
RFs& aFs );
|
93
|
54 |
static CCaWidgetStorageHandler* NewLC( CCaStorageProxy* aStorage,
|
102
|
55 |
Usif::RSoftwareComponentRegistry& aSoftwareRegistry,
|
85
|
56 |
RFs& aFs );
|
|
57 |
|
|
58 |
/**
|
|
59 |
* Destructor.
|
|
60 |
*/
|
|
61 |
virtual ~CCaWidgetStorageHandler();
|
93
|
62 |
|
85
|
63 |
/**
|
98
|
64 |
* SynchronizeL - synchronizes widgets on device with database
|
85
|
65 |
*/
|
98
|
66 |
void SynchronizeL();
|
93
|
67 |
|
85
|
68 |
private:
|
|
69 |
|
|
70 |
/**
|
|
71 |
* Adds widget to storage.
|
93
|
72 |
* @param aWidget widget to be added
|
85
|
73 |
*/
|
93
|
74 |
void AddL( const CCaWidgetDescription* aWidget );
|
85
|
75 |
|
|
76 |
/**
|
|
77 |
* Updates widget in storage.
|
93
|
78 |
* @param aWidget widget to be updated
|
98
|
79 |
* @param aEntryId entry of widget in db
|
85
|
80 |
*/
|
93
|
81 |
void UpdateL( const CCaWidgetDescription* aWidget, TUint aEntryId );
|
|
82 |
|
85
|
83 |
/**
|
|
84 |
* Add/Updates widgets in DB
|
|
85 |
* @param aWidgets widgets to add
|
|
86 |
*/
|
|
87 |
void AddWidgetsL( const RWidgetArray& aWidgets );
|
93
|
88 |
|
85
|
89 |
/**
|
|
90 |
* Removes widgets from DB
|
|
91 |
*/
|
98
|
92 |
void RemoveWidgetsL();
|
93
|
93 |
|
85
|
94 |
/**
|
|
95 |
* Fetch widgets from content storage
|
|
96 |
*/
|
98
|
97 |
void FetchWidgetsL();
|
85
|
98 |
|
|
99 |
/**
|
|
100 |
* Add widget to download collection
|
|
101 |
* @param aEntry entry containing widget information
|
|
102 |
*/
|
|
103 |
void AddWidgetToDownloadCollectionL( const CCaInnerEntry* aEntry );
|
93
|
104 |
|
85
|
105 |
/**
|
93
|
106 |
* Set missing flag for an entry.
|
|
107 |
* @param aWidget widget.
|
85
|
108 |
*/
|
93
|
109 |
void SetMissingFlagL( const CCaWidgetDescription * aWidget );
|
|
110 |
|
|
111 |
/**
|
|
112 |
* Clear missing flag for an entry.
|
|
113 |
* @param aWidget widget.
|
|
114 |
*/
|
|
115 |
void ClearVisibleFlagL( const CCaWidgetDescription* aWidget );
|
98
|
116 |
|
96
|
117 |
/**
|
98
|
118 |
* Set localizations for widget in db
|
|
119 |
* @param aWidget widget.
|
|
120 |
* @param aEntryId of widget.
|
|
121 |
*/
|
|
122 |
void SetLocalizationsL( const CCaWidgetDescription* aWidget, TInt aEntryId );
|
85
|
123 |
|
|
124 |
private:
|
|
125 |
|
|
126 |
/**
|
|
127 |
* C++ default constructor.
|
|
128 |
*/
|
102
|
129 |
CCaWidgetStorageHandler( CCaStorageProxy* aStorage,
|
|
130 |
Usif::RSoftwareComponentRegistry& aSoftwareRegistry, RFs& aFs );
|
85
|
131 |
|
|
132 |
/**
|
|
133 |
* By default Symbian 2nd phase constructor is private.
|
|
134 |
*/
|
98
|
135 |
void ConstructL();
|
85
|
136 |
|
93
|
137 |
/**
|
|
138 |
* Check if mass storage is not in use.
|
|
139 |
* @return true if mass storage is not in use.
|
|
140 |
*/
|
|
141 |
TBool MassStorageNotInUse();
|
|
142 |
|
94
|
143 |
/**
|
|
144 |
* Adds or updates component id attribute in entry based on SCR provided data
|
106
|
145 |
* and removable flag - get info from src.
|
94
|
146 |
* @param aPackageUid uid of the package which the widget represented by aEntry
|
106
|
147 |
* is delivered with.
|
94
|
148 |
* @param aEntry widget entry being updated with component id attribute.
|
|
149 |
*/
|
106
|
150 |
void UpdateCompIdAndRemovableFlagL( const TDesC& aManifestFilePathName,
|
98
|
151 |
CCaInnerEntry& aEntry ) const;
|
94
|
152 |
|
125
|
153 |
/**
|
|
154 |
* Make not empty collections with not hidden items visible.
|
|
155 |
*/
|
|
156 |
void MakeNotEmptyCollectionsVisibleL();
|
|
157 |
|
|
158 |
/**
|
|
159 |
* Make collection visible if it has visible entry.
|
|
160 |
* @param aEntry a collection entry.
|
|
161 |
*/
|
|
162 |
void MakeCollectionVisibleIfHasVisibleEntryL(
|
|
163 |
CCaInnerEntry* aEntry );
|
|
164 |
|
85
|
165 |
private:
|
93
|
166 |
// Data
|
85
|
167 |
|
|
168 |
/*
|
|
169 |
* Content Storage. Not Own
|
|
170 |
*/
|
|
171 |
CCaStorageProxy* iStorage;
|
93
|
172 |
|
85
|
173 |
/*
|
|
174 |
* File server. Not own
|
|
175 |
*/
|
|
176 |
RFs iFs;
|
93
|
177 |
|
85
|
178 |
/*
|
107
|
179 |
* DB cache for widgets. Own.
|
85
|
180 |
*/
|
107
|
181 |
RWidgetArray iWidgetDBCache;
|
93
|
182 |
|
98
|
183 |
/**
|
|
184 |
* Pointer to a parser object. Own
|
85
|
185 |
*/
|
98
|
186 |
CCaWidgetScannerParser* iParser;
|
93
|
187 |
|
102
|
188 |
/*
|
|
189 |
* Software Component Registry. Not own
|
|
190 |
*/
|
|
191 |
Usif::RSoftwareComponentRegistry& iSoftwareRegistry;
|
85
|
192 |
};
|
|
193 |
|
|
194 |
#endif // C_WIDGETSTORAGEHANDLER_H
|
|
195 |
// End of File
|