|
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 the License "Symbian Foundation License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef WINANIM_H |
|
17 #define WINANIM_H |
|
18 |
|
19 // INCLUDES |
|
20 #include <e32std.h> |
|
21 #include <e32base.h> |
|
22 #include "w32adll.h" |
|
23 #include "w32std.h" |
|
24 #include "T_AnimProc.h" |
|
25 |
|
26 |
|
27 // CLASS DECLARATION |
|
28 |
|
29 /** |
|
30 * MTimeoutNotify |
|
31 * |
|
32 */ |
|
33 class MTimeoutNotify |
|
34 { |
|
35 public: |
|
36 |
|
37 /** |
|
38 * TimedOut |
|
39 * Handle the event when a time out occurs. |
|
40 */ |
|
41 virtual void TimedOut() = 0; |
|
42 }; |
|
43 |
|
44 /** |
|
45 * CTimeOutTimer |
|
46 */ |
|
47 class CTimeOutTimer : public CTimer |
|
48 { |
|
49 public: // Constructors and destructor |
|
50 |
|
51 static CTimeOutTimer* NewL( const TInt aPriority, |
|
52 MTimeoutNotify& aTimeOutNotify ); |
|
53 virtual ~CTimeOutTimer(); |
|
54 |
|
55 public: // From CTimer |
|
56 void RunL(); |
|
57 |
|
58 protected: // Constructor |
|
59 CTimeOutTimer( const TInt aPriority, MTimeoutNotify& aTimeOutNotify ); |
|
60 |
|
61 protected: // Constructor |
|
62 void ConstructL(); |
|
63 |
|
64 private: |
|
65 MTimeoutNotify& iNotify; |
|
66 }; |
|
67 |
|
68 /** |
|
69 * CWinAnim |
|
70 * |
|
71 */ |
|
72 |
|
73 const TInt KBufMessage = 200; |
|
74 |
|
75 class CTestAnimDll; |
|
76 |
|
77 class CTWinAnim : public CWindowAnim, CAnimProc , public MTimeoutNotify |
|
78 { |
|
79 public: // Constructors and destructor |
|
80 |
|
81 /** |
|
82 * Destructor. |
|
83 */ |
|
84 ~CTWinAnim(); |
|
85 |
|
86 /** |
|
87 * Constructor for performing 1st stage construction |
|
88 */ |
|
89 CTWinAnim(CTestAnimDll* aDll, TInt aType); |
|
90 |
|
91 virtual void ConstructL(TAny *aArgs, TBool aHasFocus); |
|
92 virtual void Redraw(); |
|
93 virtual void FocusChanged(TBool aState); |
|
94 virtual TInt CommandReplyL(TInt aOpcode, TAny *aArgs); |
|
95 virtual void Command(TInt aOpcode, TAny *aArgs); |
|
96 virtual void Animate(TDateTime *aDateTime); |
|
97 virtual TBool OfferRawEvent(const TRawEvent &aRawEvent); |
|
98 virtual void HandleNotification(const TWsEvent &aEvent); |
|
99 public: |
|
100 virtual void TimedOut(); |
|
101 |
|
102 private: |
|
103 void Draw(); |
|
104 void Compare(); |
|
105 |
|
106 //for M class testing |
|
107 private: |
|
108 //for MAnimWindowFunctions |
|
109 TInt DoCmdSetRect(); |
|
110 TInt DoCmdWindowSize(); |
|
111 TInt DoCmdSetVisible(); |
|
112 TInt DoCmdInvalidate(); |
|
113 TInt DoCmdParameters(); |
|
114 TInt DoCmdVisibleRegion(); |
|
115 //for MAnimGeneralFunctionsWindowExtension |
|
116 TInt DoCmdSetFocusScreen(); |
|
117 TInt DoCmdWindowGroups(); |
|
118 TBool DoCmdWindowGroupInfo(); |
|
119 TBool DoCmdWindowGroupName(); |
|
120 TInt DoCmdSetOrdinalPosition(); |
|
121 TBool DoCmdIsFocusable(); |
|
122 //for MAnimGeneralFunctions |
|
123 TInt DoCmdDuplicateBitmapL(); |
|
124 TInt DoCmdDuplicateFontL(); |
|
125 TInt DoCmdCloseFontL(); |
|
126 TInt DoCmdSetIntervalL(); |
|
127 TInt DoCmdSetNextIntervalL(); |
|
128 TInt DoCmdSystemTimeL(); |
|
129 TInt DoCmdRegisterForNotisL(); |
|
130 TInt DoCmdMessageL(); |
|
131 TInt DoCmdAnimateL(); |
|
132 TInt DoCmdFlashStateOn(); |
|
133 TInt DoCmdPanic(); |
|
134 TInt DoCmdScreenDevice(); |
|
135 TInt DoCmdWindowExtension(); |
|
136 TInt DoCmdEventExtension(); |
|
137 TInt DoCmdExtendedInterfaceL(); |
|
138 TInt DoCmdNumOfExtInterfaces(); |
|
139 TInt DoCmdSetSyncL(); |
|
140 TInt DoCmdSync(); |
|
141 TInt DoCmdGetRawEventsL(); |
|
142 TInt DoCmdPostRawEventL(); |
|
143 TInt DoCmdPostKeyEventL(); |
|
144 TInt DoCmdClient(); |
|
145 TInt DoCmdGeneralReplyBuf8L(); |
|
146 TInt DoCmdGeneralReplyBuf16L(); |
|
147 |
|
148 //Util |
|
149 TInt DoCmdEatupMemory(); |
|
150 TInt DoCmdFreeEatenMemory(); |
|
151 void FreeMemory(); |
|
152 |
|
153 private: |
|
154 CTimeOutTimer* iServerTimer; |
|
155 MAnimGeneralFunctions::TAnimSync iSyncMode; |
|
156 TInt iCurrentCommand; |
|
157 CFbsBitmap* iDuplicateBitmap; |
|
158 CFbsFont* iDuplicateFont; |
|
159 TDateTime iDateTime; |
|
160 TInt iResult; |
|
161 TDateTime iAnimateTime; |
|
162 TInt64* iIntervalTimeStamp; |
|
163 TInt iInterval; |
|
164 TInt iNextInterval; |
|
165 TEventCode iExpectEventCode; |
|
166 TInt iAvaiableSpace; |
|
167 TInt iBiggestBlock; |
|
168 RPointerArray < TAny > iMemArray; |
|
169 }; |
|
170 |
|
171 #endif // WINANIM_H |
|
172 |