|
1 /* |
|
2 * Copyright (c) 2006-2006 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: header file of peninput fullscreen HWR ui layout |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CFEPUI_FULLSCREEN_LAYOUT_H |
|
20 #define C_CFEPUI_FULLSCREEN_LAYOUT_H |
|
21 |
|
22 #include "peninputlayout.h" |
|
23 // INCLUDES |
|
24 class CLayoutTimer; |
|
25 class CHwrWndBase; |
|
26 |
|
27 const TInt KMaxBufferEventNum = 30; |
|
28 |
|
29 class CFepFullScreenLayout : public CFepUiLayout,public MTimerHandler |
|
30 { |
|
31 public: |
|
32 /** |
|
33 * Destructor. |
|
34 * |
|
35 * @since S60 v4.0 |
|
36 */ |
|
37 IMPORT_C virtual ~CFepFullScreenLayout(); |
|
38 |
|
39 /** |
|
40 * BaseConstructL |
|
41 * Does the base construction. Derivated class must call this when constructed. |
|
42 * |
|
43 * @since S60 v4.0 |
|
44 */ |
|
45 IMPORT_C virtual void BaseConstructL(); |
|
46 |
|
47 /** |
|
48 * Constructor |
|
49 * |
|
50 * @since S60 v4.0 |
|
51 * @param aLayoutOwner The layout owner |
|
52 * @param aDuration The maximum time to buffer the event. |
|
53 */ |
|
54 IMPORT_C CFepFullScreenLayout(MLayoutOwner* aLayoutOwner, |
|
55 TInt aDuration = 0); |
|
56 |
|
57 /** |
|
58 * Get the buffered event |
|
59 * |
|
60 * @since S60 v4.0 |
|
61 * @return The buffered event |
|
62 */ |
|
63 inline const RArray<TRawEvent>& BufferedEvent(); |
|
64 |
|
65 /** |
|
66 * From MPenUiLayoutBase |
|
67 * Init. |
|
68 * Do layout initialization. It's called by layout owner |
|
69 * |
|
70 * @since S60 v4.0 |
|
71 * @return The layout rect including the shadow rect |
|
72 */ |
|
73 IMPORT_C TRect Init(); |
|
74 |
|
75 /** |
|
76 * From MPenUiLayoutBase |
|
77 * HandleEventL. Handle UI event. |
|
78 * There are only 3 kinds of UI event right now: raw event, |
|
79 * pointer and pointer buffer event. |
|
80 * |
|
81 * @since S60 v4.0 |
|
82 * @param aType The event type. See TEventType |
|
83 * @param aEventData The event data. |
|
84 * @return The control which processes the event |
|
85 */ |
|
86 IMPORT_C TBool HandleEventL(TEventType aType, const TAny* aEventData); |
|
87 |
|
88 /** |
|
89 * SemiTransparencyRequired. Tell whether this layout requires semi-transparency. |
|
90 * This is to save memory used in mask bitmap. If transparency not deeded, |
|
91 * We use black-white bitmap. |
|
92 * |
|
93 * @since S60 v4.0 |
|
94 * @return ETrue if layout require transparency, otherwise EFalse. |
|
95 */ |
|
96 IMPORT_C TBool SemiTransparencyRequired(); |
|
97 |
|
98 //from base class MTimerHandler |
|
99 /** |
|
100 * From MTimerHandler |
|
101 * HandleTimerOut. Handling time out event |
|
102 * @since S60 v4.0 |
|
103 * @param aTimeType The timer type |
|
104 */ |
|
105 IMPORT_C void HandleTimerOut(TInt aTimeType); |
|
106 |
|
107 protected: |
|
108 /** |
|
109 * Test whether the buffered event is valid for a trace |
|
110 * |
|
111 * @since S60 v4.0 |
|
112 * @return ETrue if buffered event consists of a valid stroke. Otherwise EFalse. |
|
113 */ |
|
114 IMPORT_C virtual TBool IsValidStroke(); |
|
115 |
|
116 /** |
|
117 * Test whether a new character starts. Default implementation is checking the |
|
118 * HWR window stroke list |
|
119 * |
|
120 * @since S60 v4.0 |
|
121 * @return ETrue if a new character starts. Otherwise EFalse. |
|
122 */ |
|
123 IMPORT_C virtual TBool IsHwrNewCharacter(); |
|
124 |
|
125 private: |
|
126 |
|
127 /** |
|
128 * Start to buffer event |
|
129 * |
|
130 * @since S60 v4.0 |
|
131 * @param aEvent The event to be buffered |
|
132 */ |
|
133 void StartBufferEvent(TRawEvent& aEvent); |
|
134 |
|
135 /** |
|
136 * buffer event |
|
137 * |
|
138 * @since S60 v4.0 |
|
139 * @param aEvent The event to be buffered |
|
140 */ |
|
141 void BufferEventL(TRawEvent& aEvent); |
|
142 |
|
143 /** |
|
144 * Forward the bufferred event to input UI. |
|
145 * |
|
146 * @since S60 v4.0 |
|
147 */ |
|
148 void HandleBufferedEventL(); |
|
149 |
|
150 /** |
|
151 * Simulates the buffered event to other apps |
|
152 * |
|
153 * @since S60 v4.0 |
|
154 */ |
|
155 void SimulateEvent(); |
|
156 |
|
157 private: |
|
158 /** |
|
159 * Timer to check whether event needs simulatation or handling. |
|
160 * Own. |
|
161 */ |
|
162 CLayoutTimer* iBufferTimer; |
|
163 |
|
164 /** |
|
165 * Full-screen HWR window. |
|
166 * Not own. |
|
167 */ |
|
168 CHwrWndBase* iHwrWnd; |
|
169 |
|
170 /* |
|
171 * Flag to tell whether current event should be buffered. |
|
172 */ |
|
173 TBool iBufferEvent; |
|
174 |
|
175 /* |
|
176 * The left most position in current event buffer. |
|
177 */ |
|
178 TInt iXLeftPos; |
|
179 |
|
180 /* |
|
181 * The right most position in current event buffer. |
|
182 */ |
|
183 TInt iXRightPos; |
|
184 |
|
185 /* |
|
186 * The top most position in current event buffer. |
|
187 */ |
|
188 TInt iYTopPos; |
|
189 |
|
190 /* |
|
191 * The bottom most position in current event buffer. |
|
192 */ |
|
193 TInt iYBottomPos; |
|
194 |
|
195 /* |
|
196 * pen size for Full-screen HWR window. It's used to keep the value. |
|
197 * pen size is set to 0 when event is bufferring. |
|
198 */ |
|
199 TSize iHwrWndPenSize; |
|
200 |
|
201 /* |
|
202 * Event buffer. |
|
203 */ |
|
204 RArray<TRawEvent> iEventBuf;//[KMaxBufferEventNum+1]; |
|
205 |
|
206 /* |
|
207 * The buffering duration after pen down event. If pen is up within this duration, |
|
208 * The pen operation is considering to be a clicking instead of a writting. |
|
209 * The value is in micro-second unit. |
|
210 */ |
|
211 TInt iEventBufDruation; |
|
212 |
|
213 /** |
|
214 * Reserved item1 |
|
215 */ |
|
216 TInt iReserved1; |
|
217 |
|
218 /** |
|
219 * Reserved item2 |
|
220 */ |
|
221 TInt iReserved2; |
|
222 }; |
|
223 |
|
224 #include "peninputfullscrlayout.inl" |
|
225 #endif C_CFEPUI_FULLSCREEN_LAYOUT_H |
|
226 |
|
227 // End of file |