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 #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 TBool DoCmdWindowConfig(); |
|
123 //for MAnimGeneralFunctions |
|
124 TInt DoCmdDuplicateBitmapL(); |
|
125 TInt DoCmdDuplicateFontL(); |
|
126 TInt DoCmdCloseFontL(); |
|
127 TInt DoCmdSetIntervalL(); |
|
128 TInt DoCmdSetNextIntervalL(); |
|
129 TInt DoCmdSystemTimeL(); |
|
130 TInt DoCmdRegisterForNotisL(); |
|
131 TInt DoCmdMessageL(); |
|
132 TInt DoCmdAnimateL(); |
|
133 TInt DoCmdFlashStateOn(); |
|
134 TInt DoCmdPanic(); |
|
135 TInt DoCmdScreenDevice(); |
|
136 TInt DoCmdWindowExtension(); |
|
137 TInt DoCmdEventExtension(); |
|
138 TInt DoCmdExtendedInterfaceL(); |
|
139 TInt DoCmdNumOfExtInterfaces(); |
|
140 TInt DoCmdSetSyncL(); |
|
141 TInt DoCmdSync(); |
|
142 TInt DoCmdGetRawEventsL(); |
|
143 TInt DoCmdPostRawEventL(); |
|
144 TInt DoCmdPostKeyEventL(); |
|
145 TInt DoCmdClient(); |
|
146 TInt DoCmdGeneralReplyBuf8L(); |
|
147 TInt DoCmdGeneralReplyBuf16L(); |
|
148 |
|
149 //Util |
|
150 TInt DoCmdEatupMemory(); |
|
151 TInt DoCmdFreeEatenMemory(); |
|
152 void FreeMemory(); |
|
153 |
|
154 private: |
|
155 CTimeOutTimer* iServerTimer; |
|
156 MAnimGeneralFunctions::TAnimSync iSyncMode; |
|
157 TInt iCurrentCommand; |
|
158 CFbsBitmap* iDuplicateBitmap; |
|
159 CFbsFont* iDuplicateFont; |
|
160 TDateTime iDateTime; |
|
161 TInt iResult; |
|
162 TDateTime iAnimateTime; |
|
163 TInt64* iIntervalTimeStamp; |
|
164 TInt iInterval; |
|
165 TInt iNextInterval; |
|
166 TEventCode iExpectEventCode; |
|
167 TInt iAvaiableSpace; |
|
168 TInt iBiggestBlock; |
|
169 RPointerArray < TAny > iMemArray; |
|
170 }; |
|
171 |
|
172 #endif // WINANIM_H |
|
173 |
|