|
57
|
1 |
/*
|
|
|
2 |
* Copyright (c) 2005-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: Metadata engine client session implementation*
|
|
|
15 |
*/
|
|
|
16 |
|
|
|
17 |
|
|
|
18 |
#ifndef __MDESESSIONIMPL_H__
|
|
|
19 |
#define __MDESESSIONIMPL_H__
|
|
|
20 |
|
|
|
21 |
#include "mdesession.h"
|
|
|
22 |
|
|
|
23 |
|
|
|
24 |
// forward declarations
|
|
|
25 |
class CMdENotifierAO;
|
|
|
26 |
class CMdEDataBuffer;
|
|
|
27 |
class CMdCSerializationBuffer;
|
|
|
28 |
class CMdESessionStartupAO;
|
|
|
29 |
class CMdeSessionStartTimer;
|
|
|
30 |
|
|
|
31 |
class RMdESessionAsyncRequest
|
|
|
32 |
{
|
|
|
33 |
friend class CMdeSessionStartTimer;
|
|
|
34 |
private:
|
|
|
35 |
enum TRequestType
|
|
|
36 |
{
|
|
|
37 |
EAddRequest,
|
|
|
38 |
EUpdateRequest,
|
|
|
39 |
ERemoveRequest
|
|
|
40 |
};
|
|
|
41 |
|
|
|
42 |
RMdESessionAsyncRequest(TRequestType aRequestType,
|
|
|
43 |
CMdCSerializationBuffer* aBuffer,
|
|
|
44 |
CMdCSerializationBuffer& aResultBuffer,
|
|
|
45 |
TRequestStatus& aRequestStatus);
|
|
|
46 |
|
|
|
47 |
void Close();
|
|
|
48 |
|
|
|
49 |
private:
|
|
|
50 |
TRequestType iRequestType;
|
|
|
51 |
CMdCSerializationBuffer* iBuffer;
|
|
|
52 |
CMdCSerializationBuffer* iResultBuffer;
|
|
|
53 |
TRequestStatus* iRequestStatus;
|
|
|
54 |
};
|
|
|
55 |
|
|
|
56 |
NONSHARABLE_CLASS(CMdeSessionStartTimer) : public CTimer
|
|
|
57 |
{
|
|
|
58 |
public:
|
|
|
59 |
|
|
|
60 |
static CMdeSessionStartTimer* NewL(MMdESessionObserver& aObserver);
|
|
|
61 |
|
|
|
62 |
~CMdeSessionStartTimer();
|
|
|
63 |
|
|
|
64 |
private:
|
|
|
65 |
|
|
|
66 |
void RunL();
|
|
|
67 |
|
|
|
68 |
void ConstructL();
|
|
|
69 |
|
|
|
70 |
CMdeSessionStartTimer(MMdESessionObserver& aObserver);
|
|
|
71 |
|
|
|
72 |
private:
|
|
|
73 |
RArray<RMdESessionAsyncRequest> iRequests;
|
|
|
74 |
MMdESessionObserver& iObserver;
|
|
|
75 |
};
|
|
|
76 |
|
|
|
77 |
/**
|
|
|
78 |
* Metadata engine session implementation.
|
|
|
79 |
*/
|
|
|
80 |
NONSHARABLE_CLASS(CMdESessionImpl) : public CMdESession
|
|
|
81 |
{
|
|
|
82 |
friend class CMdESessionStartupAO;
|
|
|
83 |
|
|
|
84 |
public: // Constructors and destructor.
|
|
|
85 |
|
|
|
86 |
/**
|
|
|
87 |
* Constructor.
|
|
|
88 |
*
|
|
|
89 |
* @param aObserver observer to notify when opening the session has
|
|
|
90 |
* been completed
|
|
|
91 |
*/
|
|
|
92 |
CMdESessionImpl( MMdESessionObserver& aObserver );
|
|
|
93 |
|
|
|
94 |
/**
|
|
|
95 |
* Second-phase constructor.
|
|
|
96 |
*/
|
|
|
97 |
void ConstructL();
|
|
|
98 |
|
|
|
99 |
/**
|
|
|
100 |
* Destructor.
|
|
|
101 |
*/
|
|
|
102 |
virtual ~CMdESessionImpl();
|
|
|
103 |
|
|
|
104 |
/** From MdESession */
|
|
|
105 |
TInt NamespaceDefCount() const;
|
|
|
106 |
|
|
|
107 |
/** From MdESession */
|
|
|
108 |
CMdENamespaceDef& NamespaceDefL(TInt aIndex);
|
|
|
109 |
|
|
|
110 |
/** From MdESession */
|
|
|
111 |
CMdENamespaceDef& GetNamespaceDefL(const TDesC& aName);
|
|
|
112 |
|
|
|
113 |
CMdENamespaceDef& GetNamespaceDefL(TDefId aId);
|
|
|
114 |
|
|
|
115 |
/** From MdESession */
|
|
|
116 |
CMdENamespaceDef& GetDefaultNamespaceDefL();
|
|
|
117 |
|
|
|
118 |
/** From MdESession */
|
|
|
119 |
CMdEObject* NewObjectL( CMdEObjectDef& aDef, const TDesC& aUri,
|
|
|
120 |
TUint32 aMediaId = 0 );
|
|
|
121 |
|
|
|
122 |
/** From MdESession */
|
|
|
123 |
CMdEObject* NewObjectLC( CMdEObjectDef& aDef, const TDesC& aUri,
|
|
|
124 |
TUint32 aMediaId = 0 );
|
|
|
125 |
|
|
|
126 |
/** From MdESession */
|
|
|
127 |
TInt AddObjectsL(RPointerArray<CMdEObject>& aObjects);
|
|
|
128 |
|
|
|
129 |
/** From MdESession */
|
|
|
130 |
void CommitObjectL(CMdEObject& aObject);
|
|
|
131 |
|
|
|
132 |
/** From MdESession */
|
|
|
133 |
void CommitObjectsL(RPointerArray<CMdEObject>& aObjects);
|
|
|
134 |
|
|
|
135 |
/** From MdESession */
|
|
|
136 |
TItemId CancelObjectL(CMdEObject& aObject);
|
|
|
137 |
|
|
|
138 |
/** From MdESession */
|
|
|
139 |
CMdERelation* NewRelationLC(CMdERelationDef& aDef,
|
|
|
140 |
TItemId aLeftObjectId, TItemId aRightObjectId,
|
|
|
141 |
TInt32 aParameter);
|
|
|
142 |
|
|
|
143 |
/** From MdESession */
|
|
|
144 |
CMdERelation* NewRelationL(CMdERelationDef& aDef,
|
|
|
145 |
TItemId aLeftObjectId, TItemId aRightObjectId,
|
|
|
146 |
TInt32 aParameter);
|
|
|
147 |
|
|
|
148 |
/** From MdESession */
|
|
|
149 |
CMdEEvent* NewEventLC(CMdEEventDef& aDef, TItemId aObjectId,
|
|
|
150 |
TTime aTime, const TDesC* aSource, const TDesC* aParticipant);
|
|
|
151 |
|
|
|
152 |
/** From MdESession */
|
|
|
153 |
CMdEEvent* NewEventL(CMdEEventDef& aDef, TItemId aObjectId,
|
|
|
154 |
TTime aTime, const TDesC* aSource, const TDesC* aParticipant);
|
|
|
155 |
|
|
|
156 |
/** From MdESession */
|
|
|
157 |
void AddSchemaObserverL(MMdESchemaObserver& aObserver);
|
|
|
158 |
|
|
|
159 |
/** From MdESession */
|
|
|
160 |
void RemoveSchemaObserverL(MMdESchemaObserver& aObserver);
|
|
|
161 |
|
|
|
162 |
/** From MdESession */
|
|
|
163 |
void AddRelationDefL(const CMdENamespaceDef &aNamespaceDef,
|
|
|
164 |
const TDesC &aName);
|
|
|
165 |
|
|
|
166 |
/** From MdESession */
|
|
|
167 |
void AddEventDefL(const CMdENamespaceDef &aNamespaceDef,
|
|
|
168 |
const TDesC &aName);
|
|
|
169 |
|
|
|
170 |
/* From MdESession */
|
|
|
171 |
TItemId AddObjectL(CMdEObject& aObject);
|
|
|
172 |
|
|
|
173 |
/* From MdESession */
|
|
|
174 |
TInt DeserializeIdsL( RMdEDataBuffer& aSerializedItemIds,
|
|
|
175 |
RArray<TItemId>* aResultObjects = NULL,
|
|
|
176 |
RArray<TItemId>* aResultEvents = NULL,
|
|
|
177 |
RArray<TItemId>* aResultRelations = NULL );
|
|
|
178 |
|
|
|
179 |
/* From MdESession */
|
|
|
180 |
TInt DeserializeItemsL( RMdEDataBuffer& aSerializedItems,
|
|
|
181 |
RPointerArray<CMdEInstanceItem>& aItems );
|
|
|
182 |
|
|
|
183 |
/* From MdESession */
|
|
|
184 |
TItemId RemoveObjectL( TItemId aId, CMdENamespaceDef* aNamespaceDef );
|
|
|
185 |
|
|
|
186 |
/* From MdESession */
|
|
|
187 |
TItemId RemoveObjectL( const TDesC& aUri,
|
|
|
188 |
CMdENamespaceDef* aNamespaceDef );
|
|
|
189 |
|
|
|
190 |
/* From MdESession */
|
|
|
191 |
TInt RemoveObjectsL( const RArray<TItemId>& aId,
|
|
|
192 |
RArray<TItemId>& aResult, CMdENamespaceDef* aNamespaceDef );
|
|
|
193 |
|
|
|
194 |
/* From MdESession */
|
|
|
195 |
TInt RemoveObjectsL( const RPointerArray<TDesC>& aUri,
|
|
|
196 |
RArray<TItemId>& aResult, CMdENamespaceDef* aNamespaceDef );
|
|
|
197 |
|
|
|
198 |
/* From MdESession */
|
|
|
199 |
void RemoveObjectsAsyncL(
|
|
|
200 |
const RArray<TItemId>& aId, TRequestStatus& aStatus,
|
|
|
201 |
RMdEDataBuffer& aSerializedObjectIds,
|
|
|
202 |
CMdENamespaceDef* aNamespaceDef );
|
|
|
203 |
|
|
|
204 |
/* From MdESession */
|
|
|
205 |
void RemoveObjectsAsyncL(
|
|
|
206 |
const RPointerArray<TDesC>& aUri, TRequestStatus& aStatus,
|
|
|
207 |
RMdEDataBuffer& aSerializedObjectIds,
|
|
|
208 |
CMdENamespaceDef* aNamespaceDef );
|
|
|
209 |
|
|
|
210 |
/* From MdESession */
|
|
|
211 |
CMdEObject* GetObjectL( const TItemId aId,
|
|
|
212 |
CMdEObjectDef& aObjectDef );
|
|
|
213 |
|
|
|
214 |
/* From MdESession */
|
|
|
215 |
CMdEObject* OpenObjectL( const TItemId aId,
|
|
|
216 |
CMdEObjectDef& aObjectDef );
|
|
|
217 |
|
|
|
218 |
/* From MdESession */
|
|
|
219 |
CMdEObject* GetObjectL(
|
|
|
220 |
const TInt64 aGuidHigh, const TInt64 aGuidLow,
|
|
|
221 |
CMdEObjectDef& aObjectDef );
|
|
|
222 |
|
|
|
223 |
/* From MdESession */
|
|
|
224 |
CMdEObject* OpenObjectL(
|
|
|
225 |
const TInt64 aGuidHigh, const TInt64 aGuidLow,
|
|
|
226 |
CMdEObjectDef& aObjectDef );
|
|
|
227 |
|
|
|
228 |
/* From MdESession. */
|
|
|
229 |
CMdEObject* GetObjectL( const TDesC& aUri,
|
|
|
230 |
CMdEObjectDef& aObjectDef );
|
|
|
231 |
|
|
|
232 |
/* From MdESession. */
|
|
|
233 |
CMdEObject* OpenObjectL( const TDesC& aUri,
|
|
|
234 |
CMdEObjectDef& aObjectDef );
|
|
|
235 |
|
|
|
236 |
/* From MdESession */
|
|
|
237 |
CMdEObject* GetObjectL( const TItemId aId,
|
|
|
238 |
CMdENamespaceDef* aNamespaceDef );
|
|
|
239 |
|
|
|
240 |
/* From MdESession */
|
|
|
241 |
CMdEObject* OpenObjectL( const TItemId aId,
|
|
|
242 |
CMdENamespaceDef* aNamespaceDef );
|
|
|
243 |
|
|
|
244 |
/* From MdESession */
|
|
|
245 |
CMdEObject* GetObjectL(
|
|
|
246 |
const TInt64 aGuidHigh, const TInt64 aGuidLow,
|
|
|
247 |
CMdENamespaceDef* aNamespaceDef );
|
|
|
248 |
|
|
|
249 |
/* From MdESession */
|
|
|
250 |
CMdEObject* OpenObjectL(
|
|
|
251 |
const TInt64 aGuidHigh, const TInt64 aGuidLow,
|
|
|
252 |
CMdENamespaceDef* aNamespaceDef );
|
|
|
253 |
|
|
|
254 |
/* From MdESession. */
|
|
|
255 |
CMdEObject* GetObjectL( const TDesC& aUri,
|
|
|
256 |
CMdENamespaceDef* aNamespaceDef );
|
|
|
257 |
|
|
|
258 |
/* From MdESession. */
|
|
|
259 |
CMdEObject* OpenObjectL( const TDesC& aUri,
|
|
|
260 |
CMdENamespaceDef* aNamespaceDef );
|
|
|
261 |
|
|
|
262 |
/* From MdESession */
|
|
|
263 |
CMdEObject* GetFullObjectL( const TItemId aId,
|
|
|
264 |
CMdENamespaceDef* aNamespaceDef );
|
|
|
265 |
|
|
|
266 |
/* From MdESession */
|
|
|
267 |
CMdEObject* OpenFullObjectL( const TItemId aId,
|
|
|
268 |
CMdENamespaceDef* aNamespaceDef );
|
|
|
269 |
|
|
|
270 |
/* From MdESession */
|
|
|
271 |
CMdEObject* GetFullObjectL(
|
|
|
272 |
const TInt64 aGuidHigh, const TInt64 aGuidLow,
|
|
|
273 |
CMdENamespaceDef* aNamespaceDef );
|
|
|
274 |
|
|
|
275 |
/* From MdESession */
|
|
|
276 |
CMdEObject* OpenFullObjectL(
|
|
|
277 |
const TInt64 aGuidHigh, const TInt64 aGuidLow,
|
|
|
278 |
CMdENamespaceDef* aNamespaceDef );
|
|
|
279 |
|
|
|
280 |
/* From MdESession. */
|
|
|
281 |
CMdEObject* GetFullObjectL( const TDesC& aUri,
|
|
|
282 |
CMdENamespaceDef* aNamespaceDef );
|
|
|
283 |
|
|
|
284 |
/* From MdESession. */
|
|
|
285 |
CMdEObject* OpenFullObjectL( const TDesC& aUri,
|
|
|
286 |
CMdENamespaceDef* aNamespaceDef );
|
|
|
287 |
|
|
|
288 |
void CheckObjectL( TMdEObject& aObject, const TDesC& aUri,
|
|
|
289 |
CMdENamespaceDef* aNamespaceDef );
|
|
|
290 |
|
|
|
291 |
void CheckObjectL( TMdEObject& aObject, TItemId aId,
|
|
|
292 |
CMdENamespaceDef* aNamespaceDef );
|
|
|
293 |
|
|
|
294 |
void CheckObjectL( RArray<TMdEObject>& aObjects,
|
|
|
295 |
const RArray<TItemId>& aIds,
|
|
|
296 |
CMdENamespaceDef* aNamespaceDef );
|
|
|
297 |
|
|
|
298 |
/* From MdESession. */
|
|
|
299 |
TItemId AddRelationL( CMdERelation& aRelation );
|
|
|
300 |
|
|
|
301 |
/* From MdESession. */
|
|
|
302 |
TItemId UpdateRelationL( CMdERelation& aRelation );
|
|
|
303 |
|
|
|
304 |
/* From MdESession. */
|
|
|
305 |
TInt AddItemsL( RPointerArray<CMdEInstanceItem>& aItems );
|
|
|
306 |
|
|
|
307 |
/* From MdESession. */
|
|
|
308 |
TInt UpdateItemsL( RPointerArray<CMdEInstanceItem>& aItems );
|
|
|
309 |
|
|
|
310 |
/* From MdESession. */
|
|
|
311 |
void AddItemsAsyncL(
|
|
|
312 |
RPointerArray<CMdEInstanceItem>& aItems,
|
|
|
313 |
TRequestStatus& aStatus,
|
|
|
314 |
RMdEDataBuffer& aSerializedItemIds );
|
|
|
315 |
|
|
|
316 |
/* From MdESession. */
|
|
|
317 |
void UpdateItemsAsyncL(
|
|
|
318 |
RPointerArray<CMdEInstanceItem>& aItems,
|
|
|
319 |
TRequestStatus& aStatus,
|
|
|
320 |
RMdEDataBuffer& aSerializedItemIds );
|
|
|
321 |
|
|
|
322 |
/* From MdESession. */
|
|
|
323 |
CMdERelation* GetRelationL(TItemId aId,
|
|
|
324 |
CMdENamespaceDef* aNamespaceDef);
|
|
|
325 |
|
|
|
326 |
/* From MdESession. */
|
|
|
327 |
TItemId RemoveRelationL(TItemId aId,
|
|
|
328 |
CMdENamespaceDef* aNamespaceDef);
|
|
|
329 |
|
|
|
330 |
/* From MdESession. */
|
|
|
331 |
TInt RemoveRelationsL(const RArray<TItemId>& aId,
|
|
|
332 |
RArray<TItemId>& aSuccessful, CMdENamespaceDef* aNamespaceDef);
|
|
|
333 |
|
|
|
334 |
/* From MdESession. */
|
|
|
335 |
void RemoveRelationsAsyncL(
|
|
|
336 |
const RArray<TItemId>& aId, TRequestStatus& aStatus,
|
|
|
337 |
RMdEDataBuffer& aSerializedRelationIds,
|
|
|
338 |
CMdENamespaceDef* aNamespaceDef );
|
|
|
339 |
|
|
|
340 |
/* From MdESession. */
|
|
|
341 |
CMdEObjectQuery* NewObjectQueryL(CMdENamespaceDef& aNamespaceDef,
|
|
|
342 |
CMdEObjectDef& aObjectDef, MMdEQueryObserver* aObserver);
|
|
|
343 |
|
|
|
344 |
/* From MdESession. */
|
|
|
345 |
CMdEObjectQuery* NewObjectQueryL(CMdEObjectDef& aObjectDef,
|
|
|
346 |
RPointerArray<CMdEObjectDef>* aObjectDefs,
|
|
|
347 |
MMdEQueryObserver* aObserver);
|
|
|
348 |
|
|
|
349 |
/* From MdESession. */
|
|
|
350 |
CMdEEvent* GetEventL(TItemId aId, CMdENamespaceDef* aNamespaceDef);
|
|
|
351 |
|
|
|
352 |
/* From MdESession. */
|
|
|
353 |
TItemId AddEventL( CMdEEvent& aEvent );
|
|
|
354 |
|
|
|
355 |
/* From MdESession. */
|
|
|
356 |
TItemId RemoveEventL( TItemId aId, CMdENamespaceDef* aNamespaceDef );
|
|
|
357 |
|
|
|
358 |
/* From MdESession. */
|
|
|
359 |
TInt RemoveEventsL( const RArray<TItemId>& aId,
|
|
|
360 |
RArray<TItemId>& aSuccessful,
|
|
|
361 |
CMdENamespaceDef* aNamespaceDef );
|
|
|
362 |
|
|
|
363 |
/* From MdESession. */
|
|
|
364 |
void RemoveEventsAsyncL(
|
|
|
365 |
const RArray<TItemId>& aId, TRequestStatus& aStatus,
|
|
|
366 |
RMdEDataBuffer& aSerializedEventIds,
|
|
|
367 |
CMdENamespaceDef* aNamespaceDef );
|
|
|
368 |
|
|
|
369 |
/* From MdESession. */
|
|
|
370 |
CMdERelationQuery* NewRelationQueryL(CMdENamespaceDef& aNamespaceDef,
|
|
|
371 |
MMdEQueryObserver* aObserver);
|
|
|
372 |
|
|
|
373 |
/* From MdESession. */
|
|
|
374 |
CMdEEventQuery* NewEventQueryL(CMdENamespaceDef& aNamespaceDef,
|
|
|
375 |
MMdEQueryObserver* aObserver);
|
|
|
376 |
|
|
|
377 |
/* From MdESession. */
|
|
|
378 |
void AddObjectObserverL(MMdEObjectObserver& aObserver,
|
|
|
379 |
CMdELogicCondition* aCondition,
|
|
|
380 |
TUint32 aNotificationType,
|
|
|
381 |
CMdENamespaceDef* aNamespaceDef);
|
|
|
382 |
|
|
|
383 |
/* From MdESession. */
|
|
|
384 |
void RemoveObjectObserverL(MMdEObjectObserver& aObserver,
|
|
|
385 |
CMdENamespaceDef* aNamespaceDef);
|
|
|
386 |
|
|
|
387 |
/* From MdESession. */
|
|
|
388 |
void AddObjectPresentObserverL(
|
|
|
389 |
MMdEObjectPresentObserver& aObserver);
|
|
|
390 |
|
|
|
391 |
/* From MdESession. */
|
|
|
392 |
void RemoveObjectPresentObserverL(
|
|
|
393 |
MMdEObjectPresentObserver& aObserver);
|
|
|
394 |
|
|
|
395 |
/* From MdESession. */
|
|
|
396 |
void AddRelationObserverL(MMdERelationObserver& aObserver,
|
|
|
397 |
CMdECondition* aCondition,
|
|
|
398 |
TUint32 aNotificationType,
|
|
|
399 |
CMdENamespaceDef* aNamespaceDef);
|
|
|
400 |
|
|
|
401 |
/* From MdESession. */
|
|
|
402 |
void RemoveRelationObserverL(MMdERelationObserver& aObserver,
|
|
|
403 |
CMdENamespaceDef* aNamespaceDef);
|
|
|
404 |
|
|
|
405 |
/* From MdESession. */
|
|
|
406 |
void AddRelationItemObserverL(MMdERelationItemObserver& aObserver,
|
|
|
407 |
CMdECondition* aCondition,
|
|
|
408 |
TUint32 aNotificationType,
|
|
|
409 |
CMdENamespaceDef* aNamespaceDef);
|
|
|
410 |
|
|
|
411 |
/* From MdESession. */
|
|
|
412 |
void RemoveRelationItemObserverL(MMdERelationItemObserver& aObserver,
|
|
|
413 |
CMdENamespaceDef* aNamespaceDef);
|
|
|
414 |
|
|
|
415 |
/* From MdESession. */
|
|
|
416 |
void AddRelationPresentObserverL(
|
|
|
417 |
MMdERelationPresentObserver& aObserver);
|
|
|
418 |
|
|
|
419 |
/* From MdESession. */
|
|
|
420 |
void RemoveRelationPresentObserverL(
|
|
|
421 |
MMdERelationPresentObserver& aObserver);
|
|
|
422 |
|
|
|
423 |
/* From MdESession. */
|
|
|
424 |
void AddEventObserverL(MMdEEventObserver& aObserver,
|
|
|
425 |
CMdECondition* aCondition,
|
|
|
426 |
TUint32 aNotificationType,
|
|
|
427 |
CMdENamespaceDef* aNamespaceDef);
|
|
|
428 |
|
|
|
429 |
/* From MdESession. */
|
|
|
430 |
void RemoveEventObserverL(MMdEEventObserver& aObserver,
|
|
|
431 |
CMdENamespaceDef* aNamespaceDef);
|
|
|
432 |
|
|
|
433 |
/** Finds an existing observer notifier */
|
|
|
434 |
TInt FindNotifier( TUint32 aNotifyType, TAny* aObserver,
|
|
|
435 |
CMdENamespaceDef& aNamespaceDef );
|
|
|
436 |
|
|
|
437 |
/** With this call Notifier announces it is in error state */
|
|
|
438 |
void NotifierInError( CMdENotifierAO* aNotifier );
|
|
|
439 |
|
|
|
440 |
/* From MdESession. */
|
|
|
441 |
void ImportSchemaL( const TDesC& aFileName );
|
|
|
442 |
|
|
|
443 |
/* From MdESession. */
|
|
|
444 |
TInt ImportMetadataL(const TDesC& aFileName );
|
|
|
445 |
|
|
|
446 |
/* From MdESession. */
|
|
|
447 |
void ImportMetadata( const TDesC& aFileName, TPckgBuf<TInt>& aResult,
|
|
|
448 |
TRequestStatus& aStatus );
|
|
|
449 |
|
|
|
450 |
/* From MdESession. */
|
|
|
451 |
void ExportMetadataL( const TDesC& aFileName,
|
|
|
452 |
const CMdENamespaceDef* aNamespaceDef = NULL,
|
|
|
453 |
const RPointerArray<CMdEObjectDef>* aObjectDefs = NULL,
|
|
|
454 |
const RPointerArray<CMdERelationDef>* aRelationDefs = NULL,
|
|
|
455 |
const RPointerArray<CMdEEventDef>* aEventDefs = NULL );
|
|
|
456 |
|
|
|
457 |
/* From MdESession. */
|
|
|
458 |
void ExportMetadataL( const TDesC& aFileName, TRequestStatus& aStatus,
|
|
|
459 |
RMdEDataBuffer& aBuffer,
|
|
|
460 |
const CMdENamespaceDef* aNamespaceDef = NULL,
|
|
|
461 |
const RPointerArray<CMdEObjectDef>* aObjectDefs = NULL,
|
|
|
462 |
const RPointerArray<CMdERelationDef>* aRelationDefs = NULL,
|
|
|
463 |
const RPointerArray<CMdEEventDef>* aEventDefs = NULL );
|
|
|
464 |
|
|
|
465 |
void LoadSchemaL();
|
|
|
466 |
|
|
|
467 |
/* From MdESession. */
|
|
|
468 |
void GetSchemaVersionL(TInt& aMajorVersion, TInt& aMinorVersion);
|
|
|
469 |
|
|
|
470 |
/* From MdESession. */
|
|
|
471 |
void SetObjectToPresentByGuidL(
|
|
|
472 |
const TInt64& aGuidHigh, const TInt64& aGuidLow );
|
|
|
473 |
|
|
|
474 |
void GetCountL( CMdCSerializationBuffer* aBuffer, TUint32& aResult );
|
|
|
475 |
|
|
|
476 |
void GetItemIdL( CMdCSerializationBuffer* aBuffer,
|
|
|
477 |
RArray<TItemId>& aIdArray );
|
|
|
478 |
|
|
|
479 |
void GetDistinctValuesL( CMdCSerializationBuffer& aBuffer,
|
|
|
480 |
CDesCArray& aResults );
|
|
|
481 |
|
|
|
482 |
/**
|
|
|
483 |
* Should be called to notify the base class about errors, which are
|
|
|
484 |
* not a direct consequence of the operations initiated by the client
|
|
|
485 |
* but caused by some external source (e.g., other clients). Attempts
|
|
|
486 |
* to recover from the error have failed. All on-going operations
|
|
|
487 |
* initiated by the client should be aborted before calling this
|
|
|
488 |
* method. After calling this method any attempts to use the session
|
|
|
489 |
* will cause a panic.
|
|
|
490 |
*
|
|
|
491 |
* @param aError one of the system-wide error codes
|
|
|
492 |
*/
|
|
|
493 |
void NotifyError(TInt aError);
|
|
|
494 |
|
|
|
495 |
/* From MdESession. */
|
|
|
496 |
void AddObjectObserverWithUriL( MMdEObjectObserverWithUri& aObserver,
|
|
|
497 |
CMdELogicCondition* aCondition,
|
|
|
498 |
TUint32 aNotificationType,
|
|
|
499 |
CMdENamespaceDef* aNamespaceDef );
|
|
|
500 |
|
|
|
501 |
/* From MdESession. */
|
|
|
502 |
void RemoveObjectObserverWithUriL( MMdEObjectObserverWithUri& aObserver,
|
|
|
503 |
CMdENamespaceDef* aNamespaceDef );
|
|
|
504 |
protected:
|
|
|
505 |
|
|
|
506 |
/*
|
|
|
507 |
* Loads the schema
|
|
|
508 |
*/
|
|
|
509 |
void DoLoadSchemaL();
|
|
|
510 |
|
|
|
511 |
void Close();
|
|
|
512 |
|
|
|
513 |
/* Methods to notify the base class about different events. */
|
|
|
514 |
|
|
|
515 |
/**
|
|
|
516 |
* Should be called to notify the base class that opening the session
|
|
|
517 |
* has been completed and, if the opening succeeded, the session is
|
|
|
518 |
* ready for use.
|
|
|
519 |
*
|
|
|
520 |
* @param aError <code>KErrNone</code>, if opening the session
|
|
|
521 |
* succeeded; or one of the system-wide error codes,
|
|
|
522 |
* if opening the session failed
|
|
|
523 |
*/
|
|
|
524 |
void NotifySessionOpened(TInt aError);
|
|
|
525 |
|
|
|
526 |
/* Utility methods for concrete session implementations. */
|
|
|
527 |
|
|
|
528 |
/**
|
|
|
529 |
* Panics if the session has not been succesfully opened.
|
|
|
530 |
*/
|
|
|
531 |
void CheckOpened() const;
|
|
|
532 |
|
|
|
533 |
public:
|
|
|
534 |
|
|
|
535 |
void DeserializeQueryResultL( CMdCSerializationBuffer& aBuffer,
|
|
|
536 |
RPointerArray<CMdEInstanceItem>& aItems );
|
|
|
537 |
|
|
|
538 |
protected:
|
|
|
539 |
CMdCSerializationBuffer* SerializeItemsL(
|
|
|
540 |
RPointerArray<CMdEInstanceItem>& aItems );
|
|
|
541 |
|
|
|
542 |
TItemId AddItemL( CMdEInstanceItem& aItem );
|
|
|
543 |
|
|
|
544 |
void DeserializeAddingResultsL(
|
|
|
545 |
RPointerArray<CMdEInstanceItem>& aItems,
|
|
|
546 |
CMdCSerializationBuffer& aResultBuffer );
|
|
|
547 |
|
|
|
548 |
/**
|
|
|
549 |
* Creates a serialized buffer with id marked to be removed
|
|
|
550 |
*
|
|
|
551 |
* @param aNamespaceDef namespace where items should be removed
|
|
|
552 |
* @param aObjects objects id to remove (could be NULL)
|
|
|
553 |
* @param aEvents events id to remove (could be NULL)
|
|
|
554 |
* @param aRelations relation id to remove (could be NULL)
|
|
|
555 |
* @return serialized buffer
|
|
|
556 |
*/
|
|
|
557 |
CMdCSerializationBuffer* RemoveCommonL(
|
|
|
558 |
CMdENamespaceDef& aNamespaceDef,
|
|
|
559 |
const RPointerArray<TDesC16>* aObjects,
|
|
|
560 |
const RArray<TItemId>* aEvents,
|
|
|
561 |
const RArray<TItemId>* aRelations );
|
|
|
562 |
|
|
|
563 |
/**
|
|
|
564 |
* Creates a serialized buffer with id marked to be removed
|
|
|
565 |
*
|
|
|
566 |
* @param aNamespaceDef namespace where items should be removed
|
|
|
567 |
* @param aObjects objects uri to remove (could be NULL)
|
|
|
568 |
* @param aEvents events id to remove (could be NULL)
|
|
|
569 |
* @param aRelations relation id to remove (could be NULL)
|
|
|
570 |
* @return serialized buffer
|
|
|
571 |
*/
|
|
|
572 |
CMdCSerializationBuffer* RemoveCommonL(
|
|
|
573 |
CMdENamespaceDef& aNamespaceDef,
|
|
|
574 |
const RArray<TItemId>* aObjects,
|
|
|
575 |
const RArray<TItemId>* aEvents,
|
|
|
576 |
const RArray<TItemId>* aRelations );
|
|
|
577 |
|
|
|
578 |
/**
|
|
|
579 |
* Creates a serialized buffer with defs id items to be exported
|
|
|
580 |
*
|
|
|
581 |
* @param aNamespaceDef namespace from where items should be removed
|
|
|
582 |
* (NULL means from every)
|
|
|
583 |
* @param aObjectDefs objectDefs to export
|
|
|
584 |
* @param aRelationDefs
|
|
|
585 |
* @param aEventDefs
|
|
|
586 |
* @return serialized items ids
|
|
|
587 |
*/
|
|
|
588 |
CMdCSerializationBuffer* ExportCommonL(
|
|
|
589 |
const CMdENamespaceDef* aNamespaceDef,
|
|
|
590 |
const RPointerArray<CMdEObjectDef>* aObjectDefs,
|
|
|
591 |
const RPointerArray<CMdERelationDef>* aRelationDefs,
|
|
|
592 |
const RPointerArray<CMdEEventDef>* aEventDefs );
|
|
|
593 |
|
|
|
594 |
private:
|
|
|
595 |
/**
|
|
|
596 |
* If aId is KNoId it isn't used. If aUri is KNullDesC, it isn't used.
|
|
|
597 |
*/
|
|
|
598 |
// CMdEObject* GetObjectL( CMdEObjectDef& aObjectDef, const TItemId aId,
|
|
|
599 |
// const TInt64 aGuidHigh, const TInt64 aGuidLow,
|
|
|
600 |
// const TDesC& aUri, TMdCQueryLockType aLocktype,
|
|
|
601 |
// TBool aIncludeFreetexts );
|
|
|
602 |
|
|
|
603 |
/**
|
|
|
604 |
* Return namespace definition or default namespace definition
|
|
|
605 |
*
|
|
|
606 |
* @param aNamespaceDef namespace definition or NULL
|
|
|
607 |
* @return default namespace definition if parameter was NULL,
|
|
|
608 |
* othrewise namespace definition which was given as parameter
|
|
|
609 |
*/
|
|
|
610 |
CMdENamespaceDef* GetNamespaceDefL( CMdENamespaceDef* aNamespaceDef );
|
|
|
611 |
|
|
|
612 |
private: // data members
|
|
|
613 |
|
|
|
614 |
/**
|
|
|
615 |
*
|
|
|
616 |
*/
|
|
|
617 |
CMdESessionStartupAO* iSessionStartupAO;
|
|
|
618 |
|
|
|
619 |
/**
|
|
|
620 |
* array of observer notifier active objects
|
|
|
621 |
*/
|
|
|
622 |
RPointerArray<CMdENotifierAO> iNotifiers;
|
|
|
623 |
|
|
|
624 |
/** Open observer. */
|
|
|
625 |
MMdESessionObserver* iSessionObserver;
|
|
|
626 |
|
|
|
627 |
RChunk iSchemaChunk;
|
|
|
628 |
|
|
|
629 |
CMdCSerializationBuffer* iSchemaBuffer;
|
|
|
630 |
|
|
|
631 |
RPointerArray<CMdENamespaceDef> iNamespaceDefs;
|
|
|
632 |
|
|
|
633 |
// CMdeSessionStartTimer* iAsyncHandler;
|
|
|
634 |
|
|
|
635 |
TUint32 iNextQueryId;
|
|
|
636 |
|
|
|
637 |
protected:
|
|
|
638 |
|
|
|
639 |
enum TSessionState
|
|
|
640 |
{
|
|
|
641 |
EMdESessionClosed = 0,
|
|
|
642 |
EMdESessionOpen,
|
|
|
643 |
EMdESessionError,
|
|
|
644 |
};
|
|
|
645 |
TSessionState iSessionState;
|
|
|
646 |
|
|
|
647 |
CMdeSessionStartTimer* iTimer;
|
|
|
648 |
};
|
|
|
649 |
|
|
|
650 |
#endif // __MDESESSIONIMPL_H__
|