|
1 /* |
|
2 * Copyright (c) 2004-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: Defines public item data classes (extension). |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 |
|
21 #include <AknsItemData.h> |
|
22 |
|
23 #include "AknsRlCommand.h" |
|
24 #include "AknsAlDataAccess.h" |
|
25 |
|
26 #include "AknsDebug.h" |
|
27 |
|
28 // CONSTANTS |
|
29 static const TInt KDefaultAnimationMinimumInterval = 10; // Milliseconds |
|
30 |
|
31 // INTERNAL CLASSES |
|
32 |
|
33 NONSHARABLE_CLASS(CAknsEffectParameter) : public CBase |
|
34 { |
|
35 public: // Construction and destruction |
|
36 CAknsEffectParameter() |
|
37 { |
|
38 } |
|
39 |
|
40 virtual ~CAknsEffectParameter() |
|
41 { |
|
42 delete iName; |
|
43 delete iBuffer; |
|
44 } |
|
45 |
|
46 public: // Setters and getters |
|
47 void SetDataL( const TAknsRlParameterData& aData ) |
|
48 { |
|
49 HBufC* temp = aData.iName->AllocL(); |
|
50 delete iName; |
|
51 iName = temp; |
|
52 temp = NULL; |
|
53 |
|
54 delete iBuffer; |
|
55 iBuffer = NULL; |
|
56 |
|
57 iType = aData.iType; |
|
58 |
|
59 switch( aData.iType ) |
|
60 { |
|
61 case EAknsRlParameterTypeNumber: |
|
62 iNumber = aData.iNumber; |
|
63 break; |
|
64 case EAknsRlParameterTypeString: |
|
65 iBuffer = aData.iString->AllocL(); |
|
66 break; |
|
67 case EAknsRlParameterTypeGraphics: |
|
68 iBuffer = aData.iGfx->iFilename->AllocL(); |
|
69 iGfx.iFilename = iBuffer; |
|
70 iGfx.iIndex = aData.iGfx->iIndex; |
|
71 iGfx.iMaskIndex = aData.iGfx->iMaskIndex; |
|
72 break; |
|
73 } |
|
74 } |
|
75 |
|
76 void GetData( TAknsRlParameterData& aData ) |
|
77 { |
|
78 aData.iName = iName; |
|
79 aData.iType = iType; |
|
80 |
|
81 switch( iType ) |
|
82 { |
|
83 case EAknsRlParameterTypeNumber: |
|
84 aData.iNumber = iNumber; |
|
85 break; |
|
86 case EAknsRlParameterTypeString: |
|
87 aData.iString = iBuffer; |
|
88 break; |
|
89 case EAknsRlParameterTypeGraphics: |
|
90 aData.iGfx = &iGfx; |
|
91 break; |
|
92 } |
|
93 } |
|
94 |
|
95 private: // Data |
|
96 HBufC* iName; |
|
97 TAknsRlParameterType iType; |
|
98 HBufC* iBuffer; |
|
99 TInt iNumber; |
|
100 TAknsRlGraphicsParam iGfx; |
|
101 }; |
|
102 |
|
103 NONSHARABLE_CLASS(CAknsParameterIterator) : public CBase, |
|
104 public MAknsRlParameterIterator |
|
105 { |
|
106 public: // Construction and destruction |
|
107 CAknsParameterIterator( RPointerArray<CAknsEffectParameter>* aArray ) |
|
108 : iNextIndex(0), iArray( aArray ) |
|
109 { |
|
110 } |
|
111 virtual ~CAknsParameterIterator() |
|
112 { |
|
113 } |
|
114 public: // Methods |
|
115 TBool HasNext() |
|
116 { |
|
117 if( !iArray ) return EFalse; |
|
118 if( iNextIndex>=iArray->Count() ) return EFalse; |
|
119 return ETrue; |
|
120 } |
|
121 const TAknsRlParameterData* NextL() |
|
122 { |
|
123 if( !HasNext() ) User::Leave( KErrArgument ); |
|
124 (*iArray)[iNextIndex++]->GetData( iCurData ); |
|
125 return &iCurData; |
|
126 } |
|
127 private: // Data |
|
128 TAknsRlParameterData iCurData; |
|
129 TInt iNextIndex; |
|
130 RPointerArray<CAknsEffectParameter>* iArray; |
|
131 }; |
|
132 |
|
133 NONSHARABLE_CLASS(CAknsCommandIterator) : public CBase, |
|
134 public MAknsRlCommandIterator |
|
135 { |
|
136 public: // Construction and destruction |
|
137 CAknsCommandIterator( const RPointerArray<CAknsEffectCommand>* aArray ) |
|
138 : iNextIndex(0), iArray( aArray ) |
|
139 { |
|
140 iCurData.iParamIterator = NULL; |
|
141 } |
|
142 virtual ~CAknsCommandIterator() |
|
143 { |
|
144 delete iCurData.iParamIterator; |
|
145 } |
|
146 public: // Methods |
|
147 TBool HasNext() |
|
148 { |
|
149 if( !iArray ) return EFalse; |
|
150 if( iNextIndex>=iArray->Count() ) return EFalse; |
|
151 return ETrue; |
|
152 } |
|
153 const TAknsRlCommandData* NextL() |
|
154 { |
|
155 if( !HasNext() ) User::Leave( KErrArgument ); |
|
156 |
|
157 delete iCurData.iParamIterator; |
|
158 iCurData.iParamIterator = NULL; |
|
159 |
|
160 iCurData.iEffectUid = (*iArray)[iNextIndex]->EffectUid(); |
|
161 iCurData.iLayerConf = (*iArray)[iNextIndex]->LayerConf(); |
|
162 iCurData.iParamIterator = |
|
163 (*iArray)[iNextIndex++]->CreateParameterIteratorL(); |
|
164 |
|
165 return &iCurData; |
|
166 } |
|
167 private: // Data |
|
168 TAknsRlCommandData iCurData; |
|
169 TInt iNextIndex; |
|
170 const RPointerArray<CAknsEffectCommand>* iArray; |
|
171 }; |
|
172 |
|
173 // ============================ MEMBER FUNCTIONS =============================== |
|
174 |
|
175 // ----------------------------------------------------------------------------- |
|
176 // C++ constructor can NOT contain any code, that might leave. |
|
177 // ----------------------------------------------------------------------------- |
|
178 // |
|
179 CAknsEffectCommand::CAknsEffectCommand() |
|
180 // CBase initializes: iUid(0) |
|
181 { |
|
182 } |
|
183 |
|
184 // ----------------------------------------------------------------------------- |
|
185 // Two-phased constructor. |
|
186 // ----------------------------------------------------------------------------- |
|
187 // |
|
188 EXPORT_C CAknsEffectCommand* CAknsEffectCommand::NewL() |
|
189 { |
|
190 return new (ELeave) CAknsEffectCommand(); |
|
191 } |
|
192 |
|
193 // ----------------------------------------------------------------------------- |
|
194 // Destructor. |
|
195 // ----------------------------------------------------------------------------- |
|
196 // |
|
197 CAknsEffectCommand::~CAknsEffectCommand() |
|
198 { |
|
199 iParameters.ResetAndDestroy(); |
|
200 } |
|
201 |
|
202 // ----------------------------------------------------------------------------- |
|
203 // CAknsEffectCommand::SetEffectUid |
|
204 // ----------------------------------------------------------------------------- |
|
205 // |
|
206 EXPORT_C void CAknsEffectCommand::SetEffectUid( const TUid aValue ) |
|
207 { |
|
208 iUid = aValue; |
|
209 } |
|
210 |
|
211 // ----------------------------------------------------------------------------- |
|
212 // CAknsEffectCommand::EffectUid |
|
213 // ----------------------------------------------------------------------------- |
|
214 // |
|
215 EXPORT_C TUid CAknsEffectCommand::EffectUid() const |
|
216 { |
|
217 return iUid; |
|
218 } |
|
219 |
|
220 // ----------------------------------------------------------------------------- |
|
221 // CAknsEffectCommand::SetLayerConf |
|
222 // ----------------------------------------------------------------------------- |
|
223 // |
|
224 EXPORT_C void CAknsEffectCommand::SetLayerConf( |
|
225 const TAknsRlRenderOpParam aValue ) |
|
226 { |
|
227 iLayerConf = aValue; |
|
228 } |
|
229 |
|
230 // ----------------------------------------------------------------------------- |
|
231 // CAknsEffectCommand::LayerConf |
|
232 // ----------------------------------------------------------------------------- |
|
233 // |
|
234 EXPORT_C TAknsRlRenderOpParam CAknsEffectCommand::LayerConf() const |
|
235 { |
|
236 return iLayerConf; |
|
237 } |
|
238 |
|
239 // ----------------------------------------------------------------------------- |
|
240 // CAknsEffectCommand::AppendParameterL |
|
241 // ----------------------------------------------------------------------------- |
|
242 // |
|
243 EXPORT_C void CAknsEffectCommand::AppendParameterL( |
|
244 const TAknsRlParameterData& aParameter ) |
|
245 { |
|
246 CAknsEffectParameter* newParam = new (ELeave) CAknsEffectParameter(); |
|
247 CleanupStack::PushL( newParam ); |
|
248 newParam->SetDataL( aParameter ); |
|
249 User::LeaveIfError( iParameters.Append( newParam ) ); |
|
250 CleanupStack::Pop( newParam ); |
|
251 } |
|
252 |
|
253 // ----------------------------------------------------------------------------- |
|
254 // CAknsEffectCommand::CreateParameterIteratorL |
|
255 // ----------------------------------------------------------------------------- |
|
256 // |
|
257 EXPORT_C MAknsRlParameterIterator* CAknsEffectCommand::CreateParameterIteratorL() |
|
258 { |
|
259 return new (ELeave) CAknsParameterIterator( &iParameters ); |
|
260 } |
|
261 |
|
262 // ============================ MEMBER FUNCTIONS =============================== |
|
263 |
|
264 // ----------------------------------------------------------------------------- |
|
265 // C++ constructor can NOT contain any code, that might leave. |
|
266 // ----------------------------------------------------------------------------- |
|
267 // |
|
268 CAknsEffectQueueItemData::CAknsEffectQueueItemData( const TAknsItemType aType ) |
|
269 : CAknsItemData( aType ), iInputLayer(-1), iOutputLayer(-1) |
|
270 { |
|
271 } |
|
272 |
|
273 // ----------------------------------------------------------------------------- |
|
274 // Two-phased constructor. |
|
275 // ----------------------------------------------------------------------------- |
|
276 // |
|
277 EXPORT_C CAknsEffectQueueItemData* CAknsEffectQueueItemData::NewL() |
|
278 { |
|
279 return new (ELeave) CAknsEffectQueueItemData( EAknsITEffectQueue ); |
|
280 } |
|
281 |
|
282 // ----------------------------------------------------------------------------- |
|
283 // Destructor. |
|
284 // ----------------------------------------------------------------------------- |
|
285 // |
|
286 CAknsEffectQueueItemData::~CAknsEffectQueueItemData() |
|
287 { |
|
288 iCommands.ResetAndDestroy(); |
|
289 } |
|
290 |
|
291 // ----------------------------------------------------------------------------- |
|
292 // CAknsEffectQueueItemData::SetRefItem |
|
293 // ----------------------------------------------------------------------------- |
|
294 // |
|
295 EXPORT_C void CAknsEffectQueueItemData::SetRefItem( const TAknsItemID aValue ) |
|
296 { |
|
297 iRefId = aValue; |
|
298 } |
|
299 |
|
300 // ----------------------------------------------------------------------------- |
|
301 // CAknsEffectQueueItemData::RefItem |
|
302 // ----------------------------------------------------------------------------- |
|
303 // |
|
304 EXPORT_C TAknsItemID CAknsEffectQueueItemData::RefItem() const |
|
305 { |
|
306 return iRefId; |
|
307 } |
|
308 |
|
309 // ----------------------------------------------------------------------------- |
|
310 // CAknsEffectQueueItemData::SetInputLayer |
|
311 // ----------------------------------------------------------------------------- |
|
312 // |
|
313 EXPORT_C void CAknsEffectQueueItemData::SetInputLayer( const TInt aValue ) |
|
314 { |
|
315 iInputLayer = aValue; |
|
316 } |
|
317 |
|
318 // ----------------------------------------------------------------------------- |
|
319 // CAknsEffectQueueItemData::InputLayer |
|
320 // ----------------------------------------------------------------------------- |
|
321 // |
|
322 EXPORT_C TInt CAknsEffectQueueItemData::InputLayer() const |
|
323 { |
|
324 return iInputLayer; |
|
325 } |
|
326 |
|
327 // ----------------------------------------------------------------------------- |
|
328 // CAknsEffectQueueItemData::SetInputLayerMode |
|
329 // ----------------------------------------------------------------------------- |
|
330 // |
|
331 EXPORT_C void CAknsEffectQueueItemData::SetInputLayerMode( const TInt aValue ) |
|
332 { |
|
333 iInputLayerMode = aValue; |
|
334 } |
|
335 |
|
336 // ----------------------------------------------------------------------------- |
|
337 // CAknsEffectQueueItemData::InputLayerMode |
|
338 // ----------------------------------------------------------------------------- |
|
339 // |
|
340 EXPORT_C TInt CAknsEffectQueueItemData::InputLayerMode() const |
|
341 { |
|
342 return iInputLayerMode; |
|
343 } |
|
344 |
|
345 // ----------------------------------------------------------------------------- |
|
346 // CAknsEffectQueueItemData::SetOutputLayer |
|
347 // ----------------------------------------------------------------------------- |
|
348 // |
|
349 EXPORT_C void CAknsEffectQueueItemData::SetOutputLayer( const TInt aValue ) |
|
350 { |
|
351 iOutputLayer = aValue; |
|
352 } |
|
353 |
|
354 // ----------------------------------------------------------------------------- |
|
355 // CAknsEffectQueueItemData::OutputLayer |
|
356 // ----------------------------------------------------------------------------- |
|
357 // |
|
358 EXPORT_C TInt CAknsEffectQueueItemData::OutputLayer() const |
|
359 { |
|
360 return iOutputLayer; |
|
361 } |
|
362 |
|
363 // ----------------------------------------------------------------------------- |
|
364 // CAknsEffectQueueItemData::SetOutputLayerMode |
|
365 // ----------------------------------------------------------------------------- |
|
366 // |
|
367 EXPORT_C void CAknsEffectQueueItemData::SetOutputLayerMode( const TInt aValue ) |
|
368 { |
|
369 iOutputLayerMode = aValue; |
|
370 } |
|
371 |
|
372 // ----------------------------------------------------------------------------- |
|
373 // CAknsEffectQueueItemData::OutputLayerMode |
|
374 // ----------------------------------------------------------------------------- |
|
375 // |
|
376 EXPORT_C TInt CAknsEffectQueueItemData::OutputLayerMode() const |
|
377 { |
|
378 return iOutputLayerMode; |
|
379 } |
|
380 |
|
381 // ----------------------------------------------------------------------------- |
|
382 // CAknsEffectQueueItemData::AppendCommandL |
|
383 // ----------------------------------------------------------------------------- |
|
384 // |
|
385 EXPORT_C void CAknsEffectQueueItemData::AppendCommandL( |
|
386 const CAknsEffectCommand* aCommand ) |
|
387 { |
|
388 User::LeaveIfError( iCommands.Append( aCommand ) ); |
|
389 } |
|
390 |
|
391 // ----------------------------------------------------------------------------- |
|
392 // CAknsEffectQueueItemData::CreateCommandIteratorL |
|
393 // ----------------------------------------------------------------------------- |
|
394 // |
|
395 EXPORT_C MAknsRlCommandIterator* CAknsEffectQueueItemData::CreateCommandIteratorL() |
|
396 { |
|
397 return new (ELeave) CAknsCommandIterator( &iCommands ); |
|
398 } |
|
399 |
|
400 // ============================ MEMBER FUNCTIONS =============================== |
|
401 |
|
402 template < class TOut, class TIn > |
|
403 class CAknsAlIterator: public CBase, public MAknsAlIterator |
|
404 { |
|
405 public: // Construction and destruction |
|
406 |
|
407 CAknsAlIterator( const RPointerArray<TIn>* aArray ) |
|
408 : iNextIndex(0), iArray( aArray ) |
|
409 { |
|
410 TIn::InitializeOut( iCurData ); |
|
411 } |
|
412 |
|
413 virtual ~CAknsAlIterator() |
|
414 { |
|
415 TIn::ReleaseOut( iCurData ); |
|
416 } |
|
417 |
|
418 public: // Methods |
|
419 |
|
420 TBool HasNext() |
|
421 { |
|
422 if( !iArray ) return EFalse; |
|
423 if( iNextIndex>=iArray->Count() ) return EFalse; |
|
424 return ETrue; |
|
425 } |
|
426 |
|
427 const TAny* NextL() |
|
428 { |
|
429 if( !HasNext() ) User::Leave( KErrArgument ); |
|
430 |
|
431 (*iArray)[iNextIndex++]->AssignOutL( iCurData ); |
|
432 |
|
433 return &iCurData; |
|
434 } |
|
435 |
|
436 private: // Data |
|
437 TOut iCurData; |
|
438 TInt iNextIndex; |
|
439 const RPointerArray<TIn>* iArray; |
|
440 }; |
|
441 |
|
442 // Some convenient type definitions |
|
443 typedef CAknsAlIterator< TAknsAlAnimationCommandData, CAknsAnimationCommand > CAknsCommandIter; |
|
444 typedef CAknsAlIterator< TAknsAlTimingModelData, CAknsTimingModel > CAknsTimingModelIter; |
|
445 typedef CAknsAlIterator< TAknsAlAnimationValueData, CAknsAnimationValue > CAknsValueIter; |
|
446 |
|
447 // ============================ MEMBER FUNCTIONS =============================== |
|
448 |
|
449 // ----------------------------------------------------------------------------- |
|
450 // Symbian two-phase constructor. |
|
451 // ----------------------------------------------------------------------------- |
|
452 // |
|
453 CAknsTimingModel* CAknsTimingModel::NewL() |
|
454 { |
|
455 return new (ELeave) CAknsTimingModel(); |
|
456 } |
|
457 |
|
458 // ----------------------------------------------------------------------------- |
|
459 // Destructor. |
|
460 // ----------------------------------------------------------------------------- |
|
461 // |
|
462 CAknsTimingModel::~CAknsTimingModel() |
|
463 { |
|
464 iParameters.ResetAndDestroy(); // Deletes the referenced parameters |
|
465 } |
|
466 |
|
467 // ----------------------------------------------------------------------------- |
|
468 // C++ default constructor. |
|
469 // ----------------------------------------------------------------------------- |
|
470 // |
|
471 CAknsTimingModel::CAknsTimingModel() |
|
472 { |
|
473 } |
|
474 |
|
475 // ----------------------------------------------------------------------------- |
|
476 // CAknsEffectQueueItemData::SetTimingModelUid |
|
477 // ----------------------------------------------------------------------------- |
|
478 // |
|
479 void CAknsTimingModel::SetTimingModelUid( const TUid aValue ) |
|
480 { |
|
481 iTimingModelUid = aValue; |
|
482 } |
|
483 |
|
484 // ----------------------------------------------------------------------------- |
|
485 // CAknsEffectQueueItemData::TimingModelUid |
|
486 // ----------------------------------------------------------------------------- |
|
487 // |
|
488 TUid CAknsTimingModel::TimingModelUid() const |
|
489 { |
|
490 return iTimingModelUid; |
|
491 } |
|
492 |
|
493 // ----------------------------------------------------------------------------- |
|
494 // CAknsEffectQueueItemData::AppendParameterL |
|
495 // ----------------------------------------------------------------------------- |
|
496 // |
|
497 void CAknsTimingModel::AppendParameterL( const TAknsRlParameterData& aParameter ) |
|
498 { |
|
499 CAknsEffectParameter* newParam = new (ELeave) CAknsEffectParameter(); |
|
500 CleanupStack::PushL( newParam ); |
|
501 newParam->SetDataL( aParameter ); |
|
502 User::LeaveIfError( iParameters.Append( newParam ) ); |
|
503 CleanupStack::Pop( newParam ); |
|
504 } |
|
505 |
|
506 // ----------------------------------------------------------------------------- |
|
507 // CAknsEffectQueueItemData::CreateParameterIteratorL |
|
508 // ----------------------------------------------------------------------------- |
|
509 // |
|
510 MAknsRlParameterIterator* CAknsTimingModel::CreateParameterIteratorL() |
|
511 { |
|
512 return new (ELeave) CAknsParameterIterator( &iParameters ); |
|
513 } |
|
514 |
|
515 // ----------------------------------------------------------------------------- |
|
516 // CAknsEffectQueueItemData::AssignOutL |
|
517 // ----------------------------------------------------------------------------- |
|
518 // |
|
519 void CAknsTimingModel::AssignOutL( TAknsAlTimingModelData& aData ) |
|
520 { |
|
521 delete aData.iParamIterator; |
|
522 aData.iParamIterator = NULL; |
|
523 |
|
524 aData.iTimingModelUid = iTimingModelUid; |
|
525 aData.iParamIterator = CreateParameterIteratorL(); |
|
526 } |
|
527 |
|
528 // ----------------------------------------------------------------------------- |
|
529 // CAknsEffectQueueItemData::InitializeOut |
|
530 // ----------------------------------------------------------------------------- |
|
531 // |
|
532 void CAknsTimingModel::InitializeOut( TAknsAlTimingModelData& aData ) |
|
533 { |
|
534 aData.iParamIterator = NULL; |
|
535 } |
|
536 |
|
537 // ----------------------------------------------------------------------------- |
|
538 // CAknsEffectQueueItemData::ReleaseOut |
|
539 // ----------------------------------------------------------------------------- |
|
540 // |
|
541 void CAknsTimingModel::ReleaseOut( TAknsAlTimingModelData& aData ) |
|
542 { |
|
543 delete aData.iParamIterator; |
|
544 } |
|
545 |
|
546 // ============================ MEMBER FUNCTIONS =============================== |
|
547 |
|
548 // ----------------------------------------------------------------------------- |
|
549 // Symbian two-phase constructor. |
|
550 // ----------------------------------------------------------------------------- |
|
551 // |
|
552 CAknsAnimationValue* CAknsAnimationValue::NewL() |
|
553 { |
|
554 return new (ELeave) CAknsAnimationValue(); |
|
555 } |
|
556 |
|
557 // ----------------------------------------------------------------------------- |
|
558 // Destructor. |
|
559 // ----------------------------------------------------------------------------- |
|
560 // |
|
561 CAknsAnimationValue::~CAknsAnimationValue() |
|
562 { |
|
563 iParameters.ResetAndDestroy(); // Deletes the referenced parameters |
|
564 } |
|
565 |
|
566 // ----------------------------------------------------------------------------- |
|
567 // C++ constructor. |
|
568 // ----------------------------------------------------------------------------- |
|
569 // |
|
570 CAknsAnimationValue::CAknsAnimationValue() |
|
571 { |
|
572 } |
|
573 |
|
574 // ----------------------------------------------------------------------------- |
|
575 // CAknsAnimationValue::SetAnimationValueUid |
|
576 // ----------------------------------------------------------------------------- |
|
577 // |
|
578 void CAknsAnimationValue::SetAnimationValueUid( const TUid aValue ) |
|
579 { |
|
580 iAnimationValueUid = aValue; |
|
581 } |
|
582 |
|
583 // ----------------------------------------------------------------------------- |
|
584 // CAknsAnimationValue::AnimationValueUid |
|
585 // ----------------------------------------------------------------------------- |
|
586 // |
|
587 TUid CAknsAnimationValue::AnimationValueUid() const |
|
588 { |
|
589 return iAnimationValueUid; |
|
590 } |
|
591 |
|
592 // ----------------------------------------------------------------------------- |
|
593 // CAknsAnimationValue::SetTimingModelId |
|
594 // ----------------------------------------------------------------------------- |
|
595 // |
|
596 void CAknsAnimationValue::SetTimingModelId( const TInt aValue ) |
|
597 { |
|
598 iTimingModelId = aValue; |
|
599 } |
|
600 |
|
601 // ----------------------------------------------------------------------------- |
|
602 // CAknsAnimationValue::TimingModelId |
|
603 // ----------------------------------------------------------------------------- |
|
604 // |
|
605 TInt CAknsAnimationValue::TimingModelId() const |
|
606 { |
|
607 return iTimingModelId; |
|
608 } |
|
609 |
|
610 // ----------------------------------------------------------------------------- |
|
611 // CAknsAnimationValue::AppendParameterL |
|
612 // ----------------------------------------------------------------------------- |
|
613 // |
|
614 void CAknsAnimationValue::AppendParameterL( const TAknsRlParameterData& aParameter ) |
|
615 { |
|
616 CAknsEffectParameter* newParam = new (ELeave) CAknsEffectParameter(); |
|
617 CleanupStack::PushL( newParam ); |
|
618 newParam->SetDataL( aParameter ); |
|
619 User::LeaveIfError( iParameters.Append( newParam ) ); |
|
620 CleanupStack::Pop( newParam ); |
|
621 } |
|
622 |
|
623 // ----------------------------------------------------------------------------- |
|
624 // CAknsAnimationValue::CreateParameterIteratorL |
|
625 // ----------------------------------------------------------------------------- |
|
626 // |
|
627 MAknsRlParameterIterator* CAknsAnimationValue::CreateParameterIteratorL() |
|
628 { |
|
629 return new (ELeave) CAknsParameterIterator( &iParameters ); |
|
630 } |
|
631 |
|
632 // ----------------------------------------------------------------------------- |
|
633 // CAknsAnimationValue::AssignOutL |
|
634 // ----------------------------------------------------------------------------- |
|
635 // |
|
636 void CAknsAnimationValue::AssignOutL( TAknsAlAnimationValueData& aData ) |
|
637 { |
|
638 delete aData.iParamIterator; |
|
639 aData.iParamIterator = NULL; |
|
640 |
|
641 aData.iTimingModelId = iTimingModelId; |
|
642 aData.iAnimationValueUid = iAnimationValueUid; |
|
643 aData.iParamIterator = CreateParameterIteratorL(); |
|
644 } |
|
645 |
|
646 // ----------------------------------------------------------------------------- |
|
647 // CAknsAnimationValue::InitializeOut |
|
648 // ----------------------------------------------------------------------------- |
|
649 // |
|
650 void CAknsAnimationValue::InitializeOut( TAknsAlAnimationValueData& aData ) |
|
651 { |
|
652 aData.iParamIterator = NULL; |
|
653 } |
|
654 |
|
655 // ----------------------------------------------------------------------------- |
|
656 // CAknsAnimationValue::ReleaseOut |
|
657 // ----------------------------------------------------------------------------- |
|
658 // |
|
659 void CAknsAnimationValue::ReleaseOut( TAknsAlAnimationValueData& aData ) |
|
660 { |
|
661 delete aData.iParamIterator; |
|
662 } |
|
663 |
|
664 // ============================ MEMBER FUNCTIONS =============================== |
|
665 |
|
666 NONSHARABLE_CLASS(CAknsNamedReference) : public CBase |
|
667 { |
|
668 public: // Construction and destruction |
|
669 CAknsNamedReference() |
|
670 { |
|
671 // Derived from CBase -> members zeroed |
|
672 } |
|
673 |
|
674 virtual ~CAknsNamedReference() |
|
675 { |
|
676 delete iName; |
|
677 } |
|
678 |
|
679 public: // Setters and getters |
|
680 void SetDataL( const TAknsAlNamedReferenceData& aData ) |
|
681 { |
|
682 HBufC* temp = aData.iName->AllocL(); |
|
683 delete iName; |
|
684 iName = temp; |
|
685 temp = NULL; |
|
686 |
|
687 iAnimationValueId = aData.iAnimationValueId; |
|
688 } |
|
689 |
|
690 void AssignOutL( TAknsAlNamedReferenceData& aData ) |
|
691 { |
|
692 aData.iName = iName; |
|
693 aData.iAnimationValueId = iAnimationValueId; |
|
694 } |
|
695 |
|
696 static void InitializeOut( TAknsAlNamedReferenceData& ) |
|
697 { |
|
698 } |
|
699 |
|
700 static void ReleaseOut( TAknsAlNamedReferenceData& ) |
|
701 { |
|
702 } |
|
703 |
|
704 private: // Data |
|
705 HBufC* iName; |
|
706 TInt iAnimationValueId; |
|
707 }; |
|
708 |
|
709 typedef CAknsAlIterator< TAknsAlNamedReferenceData, CAknsNamedReference > CAknsNamedReferenceIter; |
|
710 |
|
711 // ============================ MEMBER FUNCTIONS =============================== |
|
712 |
|
713 NONSHARABLE_CLASS(CAknsSizeBoundParameter) : public CBase |
|
714 { |
|
715 public: // Construction and destruction |
|
716 CAknsSizeBoundParameter() |
|
717 { |
|
718 // Derived from CBase -> members zeroed |
|
719 } |
|
720 |
|
721 virtual ~CAknsSizeBoundParameter() |
|
722 { |
|
723 delete iName; |
|
724 } |
|
725 |
|
726 public: // Setters and getters |
|
727 void SetDataL( const TAknsAlSizeBoundParameterData& aData ) |
|
728 { |
|
729 HBufC* temp = aData.iName->AllocL(); |
|
730 delete iName; |
|
731 iName = temp; |
|
732 temp = NULL; |
|
733 |
|
734 iAnimationValueId = aData.iAnimationValueId; |
|
735 iParamFlags = aData.iParamFlags; |
|
736 } |
|
737 |
|
738 void AssignOutL( TAknsAlSizeBoundParameterData& aData ) |
|
739 { |
|
740 aData.iName = iName; |
|
741 aData.iAnimationValueId = iAnimationValueId; |
|
742 aData.iParamFlags = iParamFlags; |
|
743 } |
|
744 |
|
745 static void InitializeOut( TAknsAlSizeBoundParameterData& ) |
|
746 { |
|
747 } |
|
748 |
|
749 static void ReleaseOut( TAknsAlSizeBoundParameterData& ) |
|
750 { |
|
751 } |
|
752 |
|
753 private: // Data |
|
754 HBufC* iName; |
|
755 TInt iAnimationValueId; |
|
756 TInt iParamFlags; |
|
757 }; |
|
758 |
|
759 typedef CAknsAlIterator< TAknsAlSizeBoundParameterData, CAknsSizeBoundParameter > CAknsSizeBoundParameterIter; |
|
760 |
|
761 // ============================ MEMBER FUNCTIONS =============================== |
|
762 |
|
763 // ----------------------------------------------------------------------------- |
|
764 // Two-phase constructor. |
|
765 // ----------------------------------------------------------------------------- |
|
766 // |
|
767 CAknsAnimationCommand* CAknsAnimationCommand::NewL() |
|
768 { |
|
769 return new (ELeave) CAknsAnimationCommand(); |
|
770 } |
|
771 |
|
772 // ----------------------------------------------------------------------------- |
|
773 // Destructor. |
|
774 // ----------------------------------------------------------------------------- |
|
775 // |
|
776 CAknsAnimationCommand::~CAknsAnimationCommand() |
|
777 { |
|
778 iNamedReferences.ResetAndDestroy(); |
|
779 } |
|
780 |
|
781 // ----------------------------------------------------------------------------- |
|
782 // C++ constructor. |
|
783 // ----------------------------------------------------------------------------- |
|
784 // |
|
785 CAknsAnimationCommand::CAknsAnimationCommand() |
|
786 { |
|
787 } |
|
788 |
|
789 // ----------------------------------------------------------------------------- |
|
790 // CAknsAnimationCommand::AppendNamedReferenceL |
|
791 // ----------------------------------------------------------------------------- |
|
792 // |
|
793 void CAknsAnimationCommand::AppendNamedReferenceL( |
|
794 const TAknsAlNamedReferenceData& aData ) |
|
795 { |
|
796 CAknsNamedReference* ref = new (ELeave) CAknsNamedReference(); |
|
797 CleanupStack::PushL( ref ); |
|
798 ref->SetDataL( aData ); |
|
799 User::LeaveIfError( iNamedReferences.Append( ref ) ); |
|
800 CleanupStack::Pop( ref ); |
|
801 } |
|
802 |
|
803 // ----------------------------------------------------------------------------- |
|
804 // CAknsAnimationCommand::CreateNamedReferenceIteratorL |
|
805 // ----------------------------------------------------------------------------- |
|
806 // |
|
807 MAknsAlIterator* CAknsAnimationCommand::CreateNamedReferenceIteratorL() |
|
808 { |
|
809 return new (ELeave) CAknsNamedReferenceIter( &iNamedReferences ); |
|
810 } |
|
811 |
|
812 // ----------------------------------------------------------------------------- |
|
813 // CAknsAnimationCommand::AssignOutL |
|
814 // ----------------------------------------------------------------------------- |
|
815 // |
|
816 void CAknsAnimationCommand::AssignOutL( TAknsAlAnimationCommandData& aData ) |
|
817 { |
|
818 delete aData.iParamIterator; |
|
819 aData.iParamIterator = NULL; |
|
820 |
|
821 delete aData.iNamedReferenceIterator; |
|
822 aData.iNamedReferenceIterator = NULL; |
|
823 |
|
824 aData.iLayerConf = iLayerConf; |
|
825 aData.iEffectUid = iUid; |
|
826 aData.iParamIterator = CreateParameterIteratorL(); |
|
827 aData.iNamedReferenceIterator = CreateNamedReferenceIteratorL(); |
|
828 } |
|
829 |
|
830 // ----------------------------------------------------------------------------- |
|
831 // CAknsAnimationCommand::InitializeOut |
|
832 // ----------------------------------------------------------------------------- |
|
833 // |
|
834 void CAknsAnimationCommand::InitializeOut( TAknsAlAnimationCommandData& aData ) |
|
835 { |
|
836 aData.iParamIterator = NULL; |
|
837 aData.iNamedReferenceIterator = NULL; |
|
838 } |
|
839 |
|
840 // ----------------------------------------------------------------------------- |
|
841 // CAknsAnimationCommand::ReleaseOut |
|
842 // ----------------------------------------------------------------------------- |
|
843 // |
|
844 void CAknsAnimationCommand::ReleaseOut( TAknsAlAnimationCommandData& aData ) |
|
845 { |
|
846 delete aData.iParamIterator; |
|
847 delete aData.iNamedReferenceIterator; |
|
848 } |
|
849 |
|
850 // ============================ MEMBER FUNCTIONS =============================== |
|
851 |
|
852 // ----------------------------------------------------------------------------- |
|
853 // Symbian two-phase constructor. |
|
854 // ----------------------------------------------------------------------------- |
|
855 // |
|
856 CAknsAnimationItemData* CAknsAnimationItemData::NewL() |
|
857 { |
|
858 return new (ELeave) CAknsAnimationItemData(); |
|
859 } |
|
860 |
|
861 // ----------------------------------------------------------------------------- |
|
862 // Destructor. |
|
863 // ----------------------------------------------------------------------------- |
|
864 // |
|
865 CAknsAnimationItemData::~CAknsAnimationItemData() |
|
866 { |
|
867 iPreprocessCommands.ResetAndDestroy(); |
|
868 iAnimationCommands.ResetAndDestroy(); |
|
869 iAnimationValues.ResetAndDestroy(); |
|
870 iTimingModels.ResetAndDestroy(); |
|
871 iSizeBoundParams.ResetAndDestroy(); |
|
872 } |
|
873 |
|
874 // ----------------------------------------------------------------------------- |
|
875 // C++ constructor. |
|
876 // ----------------------------------------------------------------------------- |
|
877 // |
|
878 CAknsAnimationItemData::CAknsAnimationItemData(): |
|
879 CAknsItemData( EAknsITAnimation ), |
|
880 iMinInterval( KDefaultAnimationMinimumInterval ) |
|
881 { |
|
882 } |
|
883 |
|
884 // ----------------------------------------------------------------------------- |
|
885 // CAknsAnimationItemData::SetMinInterval |
|
886 // ----------------------------------------------------------------------------- |
|
887 // |
|
888 void CAknsAnimationItemData::SetMinInterval( TInt aMin ) |
|
889 { |
|
890 iMinInterval = aMin; |
|
891 } |
|
892 |
|
893 // ----------------------------------------------------------------------------- |
|
894 // CAknsAnimationItemData::MinInterval |
|
895 // ----------------------------------------------------------------------------- |
|
896 // |
|
897 TInt CAknsAnimationItemData::MinInterval() const |
|
898 { |
|
899 return iMinInterval; |
|
900 } |
|
901 |
|
902 // ----------------------------------------------------------------------------- |
|
903 // CAknsAnimationItemData::SetMorphing |
|
904 // ----------------------------------------------------------------------------- |
|
905 // |
|
906 void CAknsAnimationItemData::SetMorphing( TBool aMorphing ) |
|
907 { |
|
908 iMorphing = aMorphing; |
|
909 } |
|
910 |
|
911 // ----------------------------------------------------------------------------- |
|
912 // CAknsAnimationItemData::Morphing |
|
913 // ----------------------------------------------------------------------------- |
|
914 // |
|
915 TBool CAknsAnimationItemData::Morphing() const |
|
916 { |
|
917 return iMorphing; |
|
918 } |
|
919 |
|
920 // ----------------------------------------------------------------------------- |
|
921 // CAknsAnimationItemData::SetInputLayer |
|
922 // ----------------------------------------------------------------------------- |
|
923 // |
|
924 void CAknsAnimationItemData::SetInputLayer( const TInt aValue ) |
|
925 { |
|
926 iInputLayer = aValue; |
|
927 } |
|
928 |
|
929 // ----------------------------------------------------------------------------- |
|
930 // CAknsAnimationItemData::InputLayer |
|
931 // ----------------------------------------------------------------------------- |
|
932 // |
|
933 TInt CAknsAnimationItemData::InputLayer() const |
|
934 { |
|
935 return iInputLayer; |
|
936 } |
|
937 |
|
938 // ----------------------------------------------------------------------------- |
|
939 // CAknsAnimationItemData::SetInputLayerMode |
|
940 // ----------------------------------------------------------------------------- |
|
941 // |
|
942 void CAknsAnimationItemData::SetInputLayerMode( const TInt aValue ) |
|
943 { |
|
944 iInputLayerMode = aValue; |
|
945 } |
|
946 |
|
947 // ----------------------------------------------------------------------------- |
|
948 // CAknsAnimationItemData::InputLayerMode |
|
949 // ----------------------------------------------------------------------------- |
|
950 // |
|
951 TInt CAknsAnimationItemData::InputLayerMode() const |
|
952 { |
|
953 return iInputLayerMode; |
|
954 } |
|
955 |
|
956 // ----------------------------------------------------------------------------- |
|
957 // CAknsAnimationItemData::SetOutputLayer |
|
958 // ----------------------------------------------------------------------------- |
|
959 // |
|
960 void CAknsAnimationItemData::SetOutputLayer( const TInt aValue ) |
|
961 { |
|
962 iOutputLayer = aValue; |
|
963 } |
|
964 |
|
965 // ----------------------------------------------------------------------------- |
|
966 // CAknsAnimationItemData::OutputLayer |
|
967 // ----------------------------------------------------------------------------- |
|
968 // |
|
969 TInt CAknsAnimationItemData::OutputLayer() const |
|
970 { |
|
971 return iOutputLayer; |
|
972 } |
|
973 |
|
974 // ----------------------------------------------------------------------------- |
|
975 // CAknsAnimationItemData::SetOutputLayerMode |
|
976 // ----------------------------------------------------------------------------- |
|
977 // |
|
978 void CAknsAnimationItemData::SetOutputLayerMode( const TInt aValue ) |
|
979 { |
|
980 iOutputLayerMode = aValue; |
|
981 } |
|
982 |
|
983 // ----------------------------------------------------------------------------- |
|
984 // CAknsAnimationItemData::OutputLayerMode |
|
985 // ----------------------------------------------------------------------------- |
|
986 // |
|
987 TInt CAknsAnimationItemData::OutputLayerMode() const |
|
988 { |
|
989 return iOutputLayerMode; |
|
990 } |
|
991 |
|
992 // ----------------------------------------------------------------------------- |
|
993 // CAknsAnimationItemData::AppendPreprocessCommandL |
|
994 // ----------------------------------------------------------------------------- |
|
995 // |
|
996 void CAknsAnimationItemData::AppendPreprocessCommandL( |
|
997 CAknsEffectCommand* aCommand ) |
|
998 { |
|
999 User::LeaveIfError( iPreprocessCommands.Append( aCommand ) ); |
|
1000 } |
|
1001 |
|
1002 // ----------------------------------------------------------------------------- |
|
1003 // CAknsAnimationItemData::PreprocessCommandIteratorL |
|
1004 // ----------------------------------------------------------------------------- |
|
1005 // |
|
1006 MAknsRlCommandIterator* CAknsAnimationItemData::PreprocessCommandIteratorL() const |
|
1007 { |
|
1008 return new (ELeave) CAknsCommandIterator( &iPreprocessCommands ); |
|
1009 } |
|
1010 |
|
1011 // ----------------------------------------------------------------------------- |
|
1012 // CAknsAnimationItemData::AppendCommandL |
|
1013 // ----------------------------------------------------------------------------- |
|
1014 // |
|
1015 void CAknsAnimationItemData::AppendCommandL( CAknsAnimationCommand* aCommand ) |
|
1016 { |
|
1017 User::LeaveIfError( iAnimationCommands.Append( aCommand ) ); |
|
1018 } |
|
1019 |
|
1020 // ----------------------------------------------------------------------------- |
|
1021 // CAknsAnimationItemData::CommandIteratorL |
|
1022 // ----------------------------------------------------------------------------- |
|
1023 // |
|
1024 MAknsAlIterator* CAknsAnimationItemData::CommandIteratorL() const |
|
1025 { |
|
1026 return new (ELeave) CAknsCommandIter( &iAnimationCommands ); |
|
1027 } |
|
1028 |
|
1029 // ----------------------------------------------------------------------------- |
|
1030 // CAknsAnimationItemData::AppendAnimationValueL |
|
1031 // ----------------------------------------------------------------------------- |
|
1032 // |
|
1033 void CAknsAnimationItemData::AppendAnimationValueL( CAknsAnimationValue* aData ) |
|
1034 { |
|
1035 User::LeaveIfError( iAnimationValues.Append( aData ) ); |
|
1036 } |
|
1037 |
|
1038 // ----------------------------------------------------------------------------- |
|
1039 // CAknsAnimationItemData::AnimationValueIteratorL |
|
1040 // ----------------------------------------------------------------------------- |
|
1041 // |
|
1042 MAknsAlIterator* CAknsAnimationItemData::AnimationValueIteratorL() const |
|
1043 { |
|
1044 return new (ELeave) CAknsValueIter( &iAnimationValues ); |
|
1045 } |
|
1046 |
|
1047 // ----------------------------------------------------------------------------- |
|
1048 // CAknsAnimationItemData::AppendTimingModelL |
|
1049 // ----------------------------------------------------------------------------- |
|
1050 // |
|
1051 void CAknsAnimationItemData::AppendTimingModelL( CAknsTimingModel* aData ) |
|
1052 { |
|
1053 User::LeaveIfError( iTimingModels.Append( aData ) ); |
|
1054 } |
|
1055 |
|
1056 // ----------------------------------------------------------------------------- |
|
1057 // CAknsAnimationItemData::TimingModelIteratorL |
|
1058 // ----------------------------------------------------------------------------- |
|
1059 // |
|
1060 MAknsAlIterator* CAknsAnimationItemData::TimingModelIteratorL() const |
|
1061 { |
|
1062 return new (ELeave) CAknsTimingModelIter( &iTimingModels ); |
|
1063 } |
|
1064 |
|
1065 // ----------------------------------------------------------------------------- |
|
1066 // CAknsAnimationItemData::AppendSizeBoundParamL |
|
1067 // ----------------------------------------------------------------------------- |
|
1068 // |
|
1069 void CAknsAnimationItemData::AppendSizeBoundParamL( |
|
1070 const TAknsAlSizeBoundParameterData& aData ) |
|
1071 { |
|
1072 CAknsSizeBoundParameter* parameter = new (ELeave) CAknsSizeBoundParameter(); |
|
1073 CleanupStack::PushL( parameter ); |
|
1074 parameter->SetDataL( aData ); |
|
1075 User::LeaveIfError( iSizeBoundParams.Append( parameter ) ); |
|
1076 CleanupStack::Pop( parameter ); |
|
1077 } |
|
1078 |
|
1079 // ----------------------------------------------------------------------------- |
|
1080 // CAknsAnimationItemData::SizeBoundParamIteratorL |
|
1081 // ----------------------------------------------------------------------------- |
|
1082 // |
|
1083 MAknsAlIterator* CAknsAnimationItemData::SizeBoundParamIteratorL() const |
|
1084 { |
|
1085 return new(ELeave) CAknsSizeBoundParameterIter( &iSizeBoundParams ); |
|
1086 } |
|
1087 |
|
1088 // End of File |