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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "T_AnimDef.h" |
|
19 |
|
20 #include "T_TFreeTimerWinAnim.h" |
|
21 |
|
22 CTFreeTimerWinAnim::CTFreeTimerWinAnim() |
|
23 { |
|
24 iResult=EFalse; |
|
25 iCurrentCommand=ECmdNone; |
|
26 } |
|
27 |
|
28 CTFreeTimerWinAnim::~CTFreeTimerWinAnim() |
|
29 { |
|
30 } |
|
31 |
|
32 //from CWindowAnim |
|
33 void CTFreeTimerWinAnim::ConstructL(TAny */*aArgs*/, TBool /*aHasFocus*/) |
|
34 { |
|
35 // Store the screen size |
|
36 iScreenSize = iWindowFunctions->WindowSize(); |
|
37 |
|
38 // Set the screen visible |
|
39 iWindowFunctions->SetVisible( ETrue ); |
|
40 //just for start heartbeat |
|
41 iWindowFunctions->SetRect(TRect(0,0,1,1)); |
|
42 } |
|
43 |
|
44 void CTFreeTimerWinAnim::Redraw() |
|
45 { |
|
46 if(iCurrentCommand==ECmdFreeTimerWinUpdate) |
|
47 { |
|
48 iResult=ETrue; |
|
49 } |
|
50 } |
|
51 |
|
52 void CTFreeTimerWinAnim::FocusChanged(TBool /*aState*/) |
|
53 { |
|
54 |
|
55 } |
|
56 |
|
57 //from CAnim |
|
58 TInt CTFreeTimerWinAnim::CommandReplyL(TInt aOpcode, TAny */*aArgs*/) |
|
59 { |
|
60 iCurrentCommand=aOpcode; |
|
61 TInt nReturn=KErrNone; |
|
62 switch(aOpcode) |
|
63 { |
|
64 case ECmdFreeTimerWinDeactivateGc: |
|
65 { |
|
66 TRect rect(10,10,20,20); |
|
67 TInt err; |
|
68 iWindowFunctions->ActivateGc(); |
|
69 TRAP(err,iGc->DrawRect(rect)); |
|
70 if(KErrNone == err) |
|
71 { |
|
72 WindowFunctions()->DeactivateGc(); |
|
73 TRAP(err,iGc->DrawRect(rect)); |
|
74 if(KErrGeneral != err) |
|
75 { |
|
76 nReturn = err; |
|
77 } |
|
78 } |
|
79 else |
|
80 { |
|
81 nReturn = err; |
|
82 } |
|
83 } |
|
84 break; |
|
85 case ECmdFreeTimerWinUpdate: |
|
86 { |
|
87 iResult=EFalse; |
|
88 WindowFunctions()->Update(); |
|
89 } |
|
90 break; |
|
91 case ECmdRetrieveResult: |
|
92 nReturn=iResult; |
|
93 break; |
|
94 } |
|
95 return nReturn; |
|
96 } |
|
97 |
|
98 void CTFreeTimerWinAnim::Command(TInt /*aOpcode*/, TAny */*aArgs*/) |
|
99 { |
|
100 |
|
101 } |
|
102 void CTFreeTimerWinAnim::Animate(TDateTime */*aDateTime*/) |
|
103 { |
|
104 |
|
105 } |
|
106 |
|
107 //from MEventHandler |
|
108 TBool CTFreeTimerWinAnim::OfferRawEvent(const TRawEvent &/*aRawEvent*/) |
|
109 { |
|
110 return EFalse; |
|
111 } |
|
112 |
|