author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 14 Sep 2010 20:58:58 +0300 | |
branch | RCL_3 |
changeset 35 | 3321d3e205b6 |
parent 34 | 5456b4e8b3a8 |
permissions | -rw-r--r-- |
34 | 1 |
/* |
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". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: Data class to hold widget info |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
// System includes |
|
19 |
#include <utf.h> |
|
20 |
||
21 |
// User includes |
|
22 |
#include <aifwdefs.h> |
|
23 |
#include "xnappuiadapter.h" |
|
24 |
#include "xncomposer.h" |
|
25 |
#include "xnodtparser.h" |
|
26 |
#include "xnresource.h" |
|
27 |
#include "xnodt.h" |
|
28 |
#include "xnnode.h" |
|
29 |
#include "xnplugindata.h" |
|
30 |
#include "xnviewdata.h" |
|
31 |
#include "xnpublisherdata.h" |
|
32 |
#include "xnviewmanager.h" |
|
33 |
#include "xnoomsyshandler.h" |
|
34 |
#include "xnpanic.h" |
|
35 |
||
36 |
#include "debug.h" |
|
37 |
||
38 |
// Constants |
|
39 |
_LIT8( KLockingStatusLocked, "locked" ); |
|
35
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
40 |
_LIT8( KLockingStatusPermanent, "permanent" ); |
34 | 41 |
|
42 |
// ============================ LOCAL FUNCTIONS ================================ |
|
43 |
||
44 |
// ============================ MEMBER FUNCTIONS =============================== |
|
45 |
// ----------------------------------------------------------------------------- |
|
46 |
// CXnPluginData::NewL() |
|
47 |
// Two-phased constructor. |
|
48 |
// ----------------------------------------------------------------------------- |
|
49 |
// |
|
50 |
CXnPluginData* CXnPluginData::NewL( CXnPluginData& aParent ) |
|
51 |
{ |
|
52 |
CXnPluginData* self = CXnPluginData::NewLC( aParent ); |
|
53 |
CleanupStack::Pop( self ); |
|
54 |
return self; |
|
55 |
} |
|
56 |
||
57 |
// ----------------------------------------------------------------------------- |
|
58 |
// CXnPluginData::NewLC() |
|
59 |
// Two-phased constructor. |
|
60 |
// ----------------------------------------------------------------------------- |
|
61 |
// |
|
62 |
CXnPluginData* CXnPluginData::NewLC( CXnPluginData& aParent ) |
|
63 |
{ |
|
64 |
CXnPluginData* self = new ( ELeave ) CXnPluginData( aParent ); |
|
65 |
CleanupStack::PushL( self ); |
|
66 |
self->ConstructL(); |
|
67 |
return self; |
|
68 |
} |
|
69 |
||
70 |
// ----------------------------------------------------------------------------- |
|
71 |
// CXnPluginData::CXnPluginData() |
|
72 |
// C++ constructor |
|
73 |
// ----------------------------------------------------------------------------- |
|
74 |
// |
|
75 |
CXnPluginData::CXnPluginData( CXnPluginData& aParent ) |
|
76 |
: iParent( &aParent ), iManager( iParent->ViewManager() ) |
|
77 |
{ |
|
78 |
// Plugin data is removable by default |
|
79 |
iFlags.Set( EIsRemovable ); |
|
80 |
} |
|
81 |
||
82 |
// ----------------------------------------------------------------------------- |
|
83 |
// CXnPluginData::CXnPluginData() |
|
84 |
// C++ constructor |
|
85 |
// ----------------------------------------------------------------------------- |
|
86 |
// |
|
87 |
CXnPluginData::CXnPluginData( CXnViewManager& aManager ) |
|
88 |
: iParent( NULL ), iManager( aManager ) |
|
89 |
{ |
|
90 |
// This constructor overload is used by CXnRootData |
|
91 |
} |
|
92 |
||
93 |
// ----------------------------------------------------------------------------- |
|
94 |
// CXnPluginData::~CXnPluginData() |
|
95 |
// C++ default destructor. |
|
96 |
// ----------------------------------------------------------------------------- |
|
97 |
// |
|
98 |
CXnPluginData::~CXnPluginData() |
|
99 |
{ |
|
100 |
Flush(); |
|
101 |
} |
|
102 |
||
103 |
// ----------------------------------------------------------------------------- |
|
104 |
// CXnPluginData::ConstructL() |
|
105 |
// 2nd phase constructor |
|
106 |
// ----------------------------------------------------------------------------- |
|
107 |
// |
|
108 |
void CXnPluginData::ConstructL() |
|
109 |
{ |
|
110 |
} |
|
111 |
||
112 |
// ----------------------------------------------------------------------------- |
|
113 |
// CXnPluginData::Load() |
|
114 |
// |
|
115 |
// ----------------------------------------------------------------------------- |
|
116 |
// |
|
117 |
TInt CXnPluginData::Load() |
|
118 |
{ |
|
119 |
if ( Occupied() ) |
|
120 |
{ |
|
121 |
return KErrInUse; |
|
122 |
} |
|
123 |
||
124 |
if ( !CXnOomSysHandler::HeapAvailable( WIDGET_MIN_MEM ) ) |
|
125 |
{ |
|
126 |
return KErrNoMemory; |
|
127 |
} |
|
128 |
||
129 |
iFlags.Clear( EIsEmpty ); |
|
130 |
||
131 |
TInt err( KErrNone ); |
|
132 |
||
133 |
TRAP( err, err = iManager.Composer().ComposeWidgetL( *this ) ); |
|
134 |
||
135 |
if ( err == KErrNone ) |
|
136 |
{ |
|
137 |
TRAP( err, iManager.Parser().LoadWidgetL( *this ) ); |
|
138 |
} |
|
139 |
||
140 |
if ( err == KErrNone ) |
|
141 |
{ |
|
142 |
// Succesfully composed, try schedule publishers' loading |
|
143 |
LoadPublishers( EAiFwPluginStartup ); |
|
144 |
} |
|
145 |
else if ( err == KXnErrWidgetPluginFailure ) |
|
146 |
{ |
|
147 |
// Widget's configuration is broken, remove it |
|
148 |
TRAP_IGNORE( iManager.UnloadWidgetFromPluginL( *this, ETrue ) ); |
|
149 |
} |
|
150 |
||
151 |
return err; |
|
152 |
} |
|
153 |
||
154 |
// ----------------------------------------------------------------------------- |
|
155 |
// CXnPluginData::Destroy() |
|
156 |
// |
|
157 |
// ----------------------------------------------------------------------------- |
|
158 |
// |
|
159 |
void CXnPluginData::Destroy() |
|
160 |
{ |
|
161 |
if ( Occupied() ) |
|
162 |
{ |
|
163 |
DestroyPublishers( EAiFwPluginShutdown ); |
|
164 |
||
165 |
TRAP_IGNORE( iManager.Parser().DestroyWidgetL( *this ) ); |
|
166 |
} |
|
167 |
||
168 |
Flush(); |
|
169 |
} |
|
170 |
||
171 |
// ----------------------------------------------------------------------------- |
|
172 |
// CXnPluginData::LoadPublishers() |
|
173 |
// |
|
174 |
// ----------------------------------------------------------------------------- |
|
175 |
// |
|
176 |
void CXnPluginData::LoadPublishers( TInt aReason ) |
|
177 |
{ |
|
178 |
__PRINTS( "*** CXnPluginData::LoadPublishers" ); |
|
179 |
||
180 |
if ( !Active() || !Occupied() ) |
|
181 |
{ |
|
182 |
__PRINTS( "*** CXnPluginData::LoadPublishers - done, !Active() || !Occupied()" ); |
|
183 |
||
184 |
return; |
|
185 |
} |
|
186 |
||
187 |
TInt count( iPublishers.Count() ); |
|
188 |
||
189 |
if ( count == 0 ) |
|
190 |
{ |
|
191 |
TRAP_IGNORE( NotifyPublisherReadyL() ); |
|
192 |
} |
|
193 |
else |
|
194 |
{ |
|
195 |
for ( TInt i = 0; i < count; i++ ) |
|
196 |
{ |
|
197 |
iPublishers[i]->Load( aReason ); |
|
198 |
} |
|
199 |
} |
|
200 |
||
201 |
__PRINTS( "*** CXnPluginData::LoadPublishers - done" ); |
|
202 |
} |
|
203 |
||
204 |
// ----------------------------------------------------------------------------- |
|
205 |
// CXnPluginData::NotifyPublisherReadyL() |
|
206 |
// |
|
207 |
// ----------------------------------------------------------------------------- |
|
208 |
// |
|
209 |
void CXnPluginData::NotifyPublisherReadyL() |
|
210 |
{ |
|
211 |
if ( iParent ) |
|
212 |
{ |
|
213 |
// Forward to parent |
|
214 |
iParent->NotifyPublisherReadyL(); |
|
215 |
} |
|
216 |
} |
|
217 |
||
218 |
// ----------------------------------------------------------------------------- |
|
219 |
// CXnPluginData::DestroyPublishers |
|
220 |
// |
|
221 |
// ----------------------------------------------------------------------------- |
|
222 |
// |
|
223 |
void CXnPluginData::DestroyPublishers( TInt aReason ) |
|
224 |
{ |
|
225 |
__PRINTS( "*** CXnPluginData::DestroyPublishers" ); |
|
226 |
||
227 |
if ( !Occupied() ) |
|
228 |
{ |
|
229 |
__PRINTS( "*** CXnPluginData::DestroyPublishers - done, !Occupied()" ); |
|
230 |
||
231 |
return; |
|
232 |
} |
|
233 |
||
234 |
for ( TInt i = 0; i < iPublishers.Count(); i++ ) |
|
235 |
{ |
|
236 |
iPublishers[i]->Destroy( aReason ); |
|
237 |
} |
|
238 |
||
239 |
__PRINTS( "*** CXnPluginData::DestroyPublishers - done" ); |
|
240 |
} |
|
241 |
||
242 |
// ----------------------------------------------------------------------------- |
|
243 |
// CXnPluginData::SetConfigurationIdL() |
|
244 |
// |
|
245 |
// ----------------------------------------------------------------------------- |
|
246 |
// |
|
247 |
void CXnPluginData::SetConfigurationIdL( const TDesC8& aConfigurationId ) |
|
248 |
{ |
|
249 |
delete iConfigurationId; |
|
250 |
iConfigurationId = NULL; |
|
251 |
||
252 |
iConfigurationId = aConfigurationId.AllocL(); |
|
253 |
} |
|
254 |
||
255 |
// ----------------------------------------------------------------------------- |
|
256 |
// CXnPluginData::SetPluginIdL() |
|
257 |
// |
|
258 |
// ----------------------------------------------------------------------------- |
|
259 |
// |
|
260 |
void CXnPluginData::SetPluginIdL( const TDesC8& aPluginId ) |
|
261 |
{ |
|
262 |
delete iPluginId; |
|
263 |
iPluginId = NULL; |
|
264 |
||
265 |
iPluginId = aPluginId.AllocL(); |
|
266 |
} |
|
267 |
||
268 |
// ----------------------------------------------------------------------------- |
|
269 |
// CXnPluginData::SetPluginUidL() |
|
270 |
// |
|
271 |
// ----------------------------------------------------------------------------- |
|
272 |
// |
|
273 |
void CXnPluginData::SetPluginUidL( const TDesC8& aPluginUid ) |
|
274 |
{ |
|
275 |
delete iPluginUid; |
|
276 |
iPluginUid = NULL; |
|
277 |
||
278 |
iPluginUid = aPluginUid.AllocL(); |
|
279 |
} |
|
280 |
||
281 |
// ----------------------------------------------------------------------------- |
|
282 |
// CXnPluginData::SetPluginNameL() |
|
283 |
// |
|
284 |
// ----------------------------------------------------------------------------- |
|
285 |
// |
|
286 |
void CXnPluginData::SetPluginNameL( const TDesC8& aPluginName ) |
|
287 |
{ |
|
288 |
delete iPluginName; |
|
289 |
iPluginName = NULL; |
|
290 |
||
291 |
iPluginName = aPluginName.AllocL(); |
|
292 |
} |
|
293 |
||
294 |
// ----------------------------------------------------------------------------- |
|
295 |
// CXnPluginData::SetPublisherName () |
|
296 |
// Set the publisher name |
|
297 |
// ----------------------------------------------------------------------------- |
|
298 |
// |
|
299 |
void CXnPluginData::SetPublisherNameL( const TDesC8& aPublisherName ) |
|
300 |
{ |
|
301 |
delete iPublisherName; |
|
302 |
iPublisherName = NULL; |
|
303 |
||
304 |
iPublisherName = |
|
305 |
CnvUtfConverter::ConvertToUnicodeFromUtf8L( aPublisherName ); |
|
306 |
} |
|
307 |
||
308 |
// ----------------------------------------------------------------------------- |
|
309 |
// CXnPluginData::SetPublisherName() |
|
310 |
// Set the publisher name |
|
311 |
// ----------------------------------------------------------------------------- |
|
312 |
// |
|
313 |
void CXnPluginData::SetPublisherNameL( const TDesC& aPublisherName ) |
|
314 |
{ |
|
315 |
delete iPublisherName; |
|
316 |
iPublisherName = NULL; |
|
317 |
||
318 |
iPublisherName = aPublisherName.AllocL(); |
|
319 |
} |
|
320 |
||
321 |
// ----------------------------------------------------------------------------- |
|
322 |
// CXnPluginData::SetPluginTypeL() |
|
323 |
// |
|
324 |
// ----------------------------------------------------------------------------- |
|
325 |
// |
|
326 |
void CXnPluginData::SetPluginTypeL( const TDesC8& aPluginType ) |
|
327 |
{ |
|
328 |
delete iPluginType; |
|
329 |
iPluginType = NULL; |
|
330 |
||
331 |
iPluginType = aPluginType.AllocL(); |
|
332 |
} |
|
333 |
||
334 |
// ----------------------------------------------------------------------------- |
|
335 |
// CXnPluginData::SetResources() |
|
336 |
// |
|
337 |
// ----------------------------------------------------------------------------- |
|
338 |
// |
|
339 |
void CXnPluginData::SetResources( CArrayPtrSeg< CXnResource >* aResources ) |
|
340 |
{ |
|
341 |
if ( iResources ) |
|
342 |
{ |
|
343 |
iResources->ResetAndDestroy(); |
|
344 |
||
345 |
delete iResources; |
|
346 |
iResources = NULL; |
|
347 |
} |
|
348 |
||
349 |
iResources = aResources; |
|
350 |
} |
|
351 |
||
352 |
// ----------------------------------------------------------------------------- |
|
353 |
// CXnPluginData::ResourcesL() |
|
354 |
// |
|
355 |
// ----------------------------------------------------------------------------- |
|
356 |
// |
|
357 |
void CXnPluginData::ResourcesL( CArrayPtrSeg< CXnResource >& aList ) const |
|
358 |
{ |
|
359 |
for ( TInt i = 0; iResources && i < iResources->Count(); i++ ) |
|
360 |
{ |
|
361 |
aList.AppendL( iResources->At(i) ); |
|
362 |
} |
|
363 |
} |
|
364 |
||
365 |
// ----------------------------------------------------------------------------- |
|
366 |
// CXnPluginData::SetControlL() |
|
367 |
// |
|
368 |
// ----------------------------------------------------------------------------- |
|
369 |
// |
|
370 |
void CXnPluginData::SetControlL( CXnNode* aNode ) |
|
371 |
{ |
|
372 |
CXnControlAdapter* control( aNode->Control() ); |
|
373 |
||
374 |
if ( control ) |
|
375 |
{ |
|
376 |
User::LeaveIfError( iControls.InsertInAddressOrder( control ) ); |
|
377 |
} |
|
378 |
} |
|
379 |
||
380 |
// ----------------------------------------------------------------------------- |
|
381 |
// CXnPluginData::ControlsL() |
|
382 |
// |
|
383 |
// ----------------------------------------------------------------------------- |
|
384 |
// |
|
385 |
void CXnPluginData::ControlsL( RPointerArray< CXnControlAdapter >& aList ) const |
|
386 |
{ |
|
387 |
for ( TInt i = 0; i < iControls.Count(); i++ ) |
|
388 |
{ |
|
389 |
aList.AppendL( iControls[i] ); |
|
390 |
} |
|
391 |
} |
|
392 |
||
393 |
// ----------------------------------------------------------------------------- |
|
394 |
// CXnPluginData::SetContentSourceNodeL() |
|
395 |
// |
|
396 |
// ----------------------------------------------------------------------------- |
|
397 |
// |
|
398 |
void CXnPluginData::SetContentSourceNodeL( CXnNode* aNode ) |
|
399 |
{ |
|
400 |
if ( !aNode ) |
|
401 |
{ |
|
402 |
return; |
|
403 |
} |
|
404 |
||
405 |
for ( TInt i = 0; i < iPublishers.Count(); i++ ) |
|
406 |
{ |
|
407 |
if ( *iPublishers[i] == *aNode ) |
|
408 |
{ |
|
409 |
// Duplicate entries not allowed |
|
410 |
return; |
|
411 |
} |
|
412 |
} |
|
413 |
||
414 |
CXnPublisherData* publisher = |
|
415 |
CXnPublisherData::NewLC( *this, *aNode ); |
|
416 |
||
417 |
iPublishers.AppendL( publisher ); |
|
418 |
CleanupStack::Pop( publisher ); |
|
419 |
} |
|
420 |
||
421 |
// ----------------------------------------------------------------------------- |
|
422 |
// CXnPluginData::ContentSourceNodesL() |
|
423 |
// |
|
424 |
// ----------------------------------------------------------------------------- |
|
425 |
// |
|
426 |
void CXnPluginData::ContentSourceNodesL( RPointerArray< CXnNode >& aList ) const |
|
427 |
{ |
|
428 |
for ( TInt i = 0; i < iPublishers.Count(); i++ ) |
|
429 |
{ |
|
430 |
aList.AppendL( iPublishers[i]->ContentSource() ); |
|
431 |
} |
|
432 |
} |
|
433 |
||
434 |
// ----------------------------------------------------------------------------- |
|
435 |
// CXnPluginData::Publishers() |
|
436 |
// |
|
437 |
// ----------------------------------------------------------------------------- |
|
438 |
// |
|
439 |
void CXnPluginData::PublishersL( RPointerArray< CXnPublisherData >& aList ) const |
|
440 |
{ |
|
441 |
for ( TInt i = 0; i < iPublishers.Count(); i++ ) |
|
442 |
{ |
|
443 |
aList.AppendL( iPublishers[i] ); |
|
444 |
} |
|
445 |
} |
|
446 |
||
447 |
// ----------------------------------------------------------------------------- |
|
448 |
// CXnPluginData::SetAppearanceNodeL() |
|
449 |
// |
|
450 |
// ----------------------------------------------------------------------------- |
|
451 |
// |
|
452 |
void CXnPluginData::SetAppearanceNodeL( CXnNode* aNode ) |
|
453 |
{ |
|
454 |
User::LeaveIfError( iAppearanceNodes.InsertInAddressOrder( aNode ) ); |
|
455 |
} |
|
456 |
||
457 |
// ----------------------------------------------------------------------------- |
|
458 |
// CXnPluginData::AppearanceNodesL() |
|
459 |
// |
|
460 |
// ----------------------------------------------------------------------------- |
|
461 |
// |
|
462 |
void CXnPluginData::AppearanceNodesL( RPointerArray< CXnNode >& aList ) const |
|
463 |
{ |
|
464 |
for ( TInt i = 0; i < iAppearanceNodes.Count(); i++ ) |
|
465 |
{ |
|
466 |
aList.AppendL( iAppearanceNodes[i] ); |
|
467 |
} |
|
468 |
} |
|
469 |
||
470 |
// ----------------------------------------------------------------------------- |
|
471 |
// CXnPluginData::SetInitialFocusNodeL() |
|
472 |
// |
|
473 |
// ----------------------------------------------------------------------------- |
|
474 |
// |
|
475 |
void CXnPluginData::SetInitialFocusNodeL( CXnNode* aNode ) |
|
476 |
{ |
|
477 |
User::LeaveIfError( iInitialFocusNodes.InsertInAddressOrder( aNode ) ); |
|
478 |
} |
|
479 |
||
480 |
// ----------------------------------------------------------------------------- |
|
481 |
// CXnPluginData::InitialFocusNodesL() |
|
482 |
// |
|
483 |
// ----------------------------------------------------------------------------- |
|
484 |
// |
|
485 |
void CXnPluginData::InitialFocusNodesL( RPointerArray< CXnNode >& aList ) const |
|
486 |
{ |
|
487 |
for ( TInt i = 0; i < iInitialFocusNodes.Count(); i++ ) |
|
488 |
{ |
|
489 |
aList.AppendL( iInitialFocusNodes[i] ); |
|
490 |
} |
|
491 |
} |
|
492 |
||
493 |
// ----------------------------------------------------------------------------- |
|
494 |
// CXnPluginData::Flush() |
|
495 |
// Flushes this plugins data |
|
496 |
// ----------------------------------------------------------------------------- |
|
497 |
// |
|
498 |
void CXnPluginData::Flush() |
|
499 |
{ |
|
500 |
// Don't touch to iOwner, because this plugin might be reused later |
|
35
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
501 |
|
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
502 |
// clear all flags, except editable and removable |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
503 |
TBool removable = iFlags.IsSet( EIsRemovable ); |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
504 |
TBool editable = iFlags.IsSet( EIsEditable ); |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
505 |
|
34 | 506 |
iFlags.ClearAll(); |
507 |
||
35
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
508 |
if( removable ) |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
509 |
{ |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
510 |
iFlags.Set( EIsRemovable ); |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
511 |
} |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
512 |
if( editable ) |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
513 |
{ |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
514 |
iFlags.Set( EIsEditable ); |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
515 |
} |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
516 |
|
34 | 517 |
iNode = NULL; |
518 |
||
519 |
delete iConfigurationId; |
|
520 |
iConfigurationId = NULL; |
|
521 |
||
522 |
delete iPluginId; |
|
523 |
iPluginId = NULL; |
|
524 |
||
525 |
delete iPluginUid; |
|
526 |
iPluginUid = NULL; |
|
527 |
||
528 |
delete iPluginName; |
|
529 |
iPluginName = NULL; |
|
530 |
||
531 |
delete iPluginType; |
|
532 |
iPluginType = NULL; |
|
533 |
||
534 |
delete iPublisherName; |
|
535 |
iPublisherName = NULL; |
|
536 |
||
537 |
if ( iResources ) |
|
538 |
{ |
|
539 |
iResources->ResetAndDestroy(); |
|
540 |
delete iResources; |
|
541 |
iResources = NULL; |
|
542 |
} |
|
543 |
||
544 |
iPublishers.ResetAndDestroy(); |
|
545 |
iControls.Reset(); |
|
546 |
iAppearanceNodes.Reset(); |
|
547 |
iInitialFocusNodes.Reset(); |
|
548 |
iPopupNodes.Reset(); |
|
549 |
iPluginsData.ResetAndDestroy(); |
|
550 |
||
551 |
User::Heap().Compress(); |
|
552 |
} |
|
553 |
||
554 |
// ----------------------------------------------------------------------------- |
|
555 |
// CXnPluginData::Empty() |
|
556 |
// |
|
557 |
// ----------------------------------------------------------------------------- |
|
558 |
// |
|
559 |
TBool CXnPluginData::Empty() const |
|
560 |
{ |
|
561 |
return ( iFlags.IsSet( EIsEmpty ) ? ETrue : EFalse ); |
|
562 |
} |
|
563 |
||
564 |
// ----------------------------------------------------------------------------- |
|
35
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
565 |
// CXnPluginData::SetEmptyL() |
34 | 566 |
// |
567 |
// ----------------------------------------------------------------------------- |
|
568 |
// |
|
569 |
void CXnPluginData::SetEmptyL( const TDesC8& aPluginId ) |
|
570 |
{ |
|
571 |
if ( Occupied() ) |
|
572 |
{ |
|
573 |
User::Leave( KErrInUse ); |
|
574 |
} |
|
575 |
||
576 |
HBufC8* id( aPluginId.AllocL() ); |
|
577 |
||
578 |
Flush(); |
|
579 |
||
580 |
// Takes ownership |
|
581 |
iPluginId = id; |
|
582 |
||
583 |
iFlags.Set( EIsEmpty ); |
|
584 |
} |
|
585 |
||
586 |
// ----------------------------------------------------------------------------- |
|
587 |
// CXnPluginData::SetIsDisplayingPopup() |
|
588 |
// |
|
589 |
// ----------------------------------------------------------------------------- |
|
590 |
// |
|
591 |
void CXnPluginData::SetIsDisplayingPopup ( TBool aVisible, CXnNode* aNode ) |
|
592 |
{ |
|
593 |
if ( aVisible ) |
|
594 |
{ |
|
595 |
iPopupNodes.InsertInAddressOrder( aNode ); |
|
596 |
} |
|
597 |
else |
|
598 |
{ |
|
599 |
TInt index( iPopupNodes.Find( aNode ) ); |
|
600 |
||
601 |
if ( index != KErrNotFound ) |
|
602 |
{ |
|
603 |
iPopupNodes.Remove( index ); |
|
604 |
} |
|
605 |
} |
|
606 |
} |
|
607 |
||
608 |
//------------------------------------------------------------------------------ |
|
609 |
// CXnPluginData::IsDisplayingPopup() |
|
610 |
// |
|
611 |
//------------------------------------------------------------------------------ |
|
612 |
// |
|
613 |
TBool CXnPluginData::IsDisplayingPopup() const |
|
614 |
{ |
|
615 |
return ( iPopupNodes.Count() > 0 ); |
|
616 |
} |
|
617 |
||
618 |
// ----------------------------------------------------------------------------- |
|
619 |
// CXnPluginData::PopupNodesL() |
|
620 |
// |
|
621 |
// ----------------------------------------------------------------------------- |
|
622 |
// |
|
623 |
void CXnPluginData::PopupNodesL( RPointerArray< CXnNode >& aList ) const |
|
624 |
{ |
|
625 |
for ( TInt i = 0; i < iPopupNodes.Count(); i++ ) |
|
626 |
{ |
|
627 |
aList.AppendL( iPopupNodes[i] ); |
|
628 |
} |
|
629 |
} |
|
630 |
||
631 |
// ----------------------------------------------------------------------------- |
|
632 |
// CXnViewData::SetLockingStatus |
|
633 |
// |
|
634 |
// ----------------------------------------------------------------------------- |
|
635 |
// |
|
636 |
void CXnPluginData::SetLockingStatus( const TDesC8& aStatus ) |
|
637 |
{ |
|
35
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
638 |
if( aStatus.CompareF( KLockingStatusPermanent ) == 0 ) |
34 | 639 |
{ |
640 |
iFlags.Clear( EIsRemovable ); |
|
35
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
641 |
iFlags.Clear( EIsEditable ); |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
642 |
} |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
643 |
else if( aStatus.CompareF( KLockingStatusLocked ) == 0 ) |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
644 |
{ |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
645 |
iFlags.Clear( EIsRemovable ); |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
646 |
iFlags.Set( EIsEditable ); |
34 | 647 |
} |
648 |
else |
|
649 |
{ |
|
650 |
iFlags.Set( EIsRemovable ); |
|
35
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
651 |
iFlags.Set( EIsEditable ); |
34 | 652 |
} |
653 |
} |
|
654 |
||
655 |
// End of file |