|
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 // |
|
15 |
|
16 #include "T_TestAnimDll.h" |
|
17 #include "T_AnimDef.h" |
|
18 #include "T_TWinAnim.h" |
|
19 #include "T_TSpriteAnim.h" |
|
20 #include "T_TFreeTimerWinAnim.h" |
|
21 |
|
22 |
|
23 CTestAnimDll::CTestAnimDll() |
|
24 { |
|
25 // No implementation required |
|
26 } |
|
27 |
|
28 |
|
29 CTestAnimDll::~CTestAnimDll() |
|
30 { |
|
31 WriteLog(_L("~CTestAnimDll")); |
|
32 delete iLog; |
|
33 iFs.Close(); |
|
34 } |
|
35 |
|
36 CTestAnimDll* CTestAnimDll::NewLC() |
|
37 { |
|
38 CTestAnimDll* self = new (ELeave)CTestAnimDll(); |
|
39 CleanupStack::PushL(self); |
|
40 self->ConstructL(); |
|
41 return self; |
|
42 } |
|
43 |
|
44 CTestAnimDll* CTestAnimDll::NewL() |
|
45 { |
|
46 CTestAnimDll* self=CTestAnimDll::NewLC(); |
|
47 CleanupStack::Pop(); // self; |
|
48 return self; |
|
49 } |
|
50 |
|
51 void CTestAnimDll::ConstructL() |
|
52 { |
|
53 User::LeaveIfError(iFs.Connect()); |
|
54 _LIT(KFileName,"c:\\anim.txt"); |
|
55 iLog=CLog::NewL(iFs,KFileName); |
|
56 |
|
57 } |
|
58 |
|
59 EXPORT_C CAnimDll* CreateCAnimDllL() |
|
60 { |
|
61 return CTestAnimDll::NewL(); |
|
62 } |
|
63 |
|
64 TInt CTestAnimDll::WriteLog(const TDesC& aInfo) |
|
65 { |
|
66 return iLog->WriteLog((aInfo)); |
|
67 } |
|
68 TInt CTestAnimDll::WriteLog(const TDesC8& aInfo) |
|
69 { |
|
70 return iLog->WriteLog((aInfo)); |
|
71 } |
|
72 |
|
73 CAnim* CTestAnimDll::CreateInstanceL(TInt aType) |
|
74 { |
|
75 TBuf<50> buf; |
|
76 buf.Format(_L("CTestAnimDll::CreateInstanceL %d"),aType); |
|
77 WriteLog(buf); |
|
78 |
|
79 CAnim* anim=NULL; |
|
80 switch (aType) |
|
81 { |
|
82 case EKWindowAnim: |
|
83 { |
|
84 anim=new (ELeave)CTWinAnim(this,aType); |
|
85 break; |
|
86 } |
|
87 case EKSpriteAnim: |
|
88 { |
|
89 anim=new (ELeave)CTSpriteAnim(this,aType); |
|
90 break; |
|
91 } |
|
92 case EKFreeTimerWindowAnim: |
|
93 { |
|
94 anim=new (ELeave) CTFreeTimerWinAnim(); |
|
95 break; |
|
96 } |
|
97 default: |
|
98 { |
|
99 // iFunctions->Panic(); |
|
100 break; |
|
101 } |
|
102 |
|
103 } |
|
104 |
|
105 return anim; |
|
106 } |