|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // These are a dummy data provider and animation. |
|
15 // The intent of these is to prove that versions of each basic type can be |
|
16 // created and added to the framework. It is more important that this can |
|
17 // be compiled and linked than that it does anything useful when run. |
|
18 // |
|
19 // |
|
20 |
|
21 /** |
|
22 @file |
|
23 @internalComponent - Internal Symbian test code |
|
24 */ |
|
25 |
|
26 #include "AnimationDataProvider.h" |
|
27 #include "Animation.h" |
|
28 #include "AnimationTls.h" |
|
29 |
|
30 _LIT8(KDummyData, "dummy"); |
|
31 |
|
32 class CDummyDataProvider : public CAnimationDataProvider |
|
33 { |
|
34 public: |
|
35 virtual void StartL() { }; |
|
36 virtual TPtrC8 DataType() { return KDummyData(); } |
|
37 }; |
|
38 |
|
39 class CDummyAnimation : public CAnimation, public MAnimationDrawer |
|
40 { |
|
41 public: |
|
42 static CDummyAnimation * NewLC(CAnimationDataProvider * aDataProvider) |
|
43 { |
|
44 __ASSERT_ALWAYS(aDataProvider, User::Leave(KErrArgument)); |
|
45 CDummyAnimation * self = new (ELeave) CDummyAnimation(aDataProvider); |
|
46 CleanupStack::PushL(self); |
|
47 self->iTls = CAnimationTls::NewL(); |
|
48 return self; |
|
49 } |
|
50 ~CDummyAnimation() { delete iDataProvider; iTls->Close(); } |
|
51 |
|
52 // From CAnimation: |
|
53 virtual void Start(const TAnimationConfig& /*aConfig*/) { } |
|
54 virtual void Stop() { } |
|
55 virtual void Pause() { } |
|
56 virtual void Resume() { } |
|
57 virtual void Hold() { } |
|
58 virtual void Unhold() { } |
|
59 virtual void Freeze() { } |
|
60 virtual void Unfreeze() { } |
|
61 virtual void SetPosition(const TPoint& /*aPoint*/) { } |
|
62 |
|
63 // From MAnimationDrawer: |
|
64 virtual void AnimatorDraw() { } |
|
65 virtual void AnimatorInitialisedL(const TSize& /*aSize*/) { } |
|
66 virtual void AnimatorResetL() { } |
|
67 virtual const TPtrC8 AnimatorDataType() const { return iDataProvider->DataType(); } |
|
68 virtual CAnimationTicker& AnimatorTicker() { return *iTls->Ticker(); } |
|
69 protected: |
|
70 CDummyAnimation(CAnimationDataProvider * aDataProvider) : iDataProvider(aDataProvider) { } |
|
71 protected: |
|
72 CAnimationDataProvider * iDataProvider; |
|
73 CAnimationTls* iTls; |
|
74 }; |