16 */ |
16 */ |
17 #ifndef __PEN_UI_WINDOW_CONTROL__ |
17 #ifndef __PEN_UI_WINDOW_CONTROL__ |
18 #define __PEN_UI_WINDOW_CONTROL__ |
18 #define __PEN_UI_WINDOW_CONTROL__ |
19 |
19 |
20 #include <coecntrl.h> |
20 #include <coecntrl.h> |
|
21 #include <AknIconUtils.h> |
|
22 #include <AknsUtils.h> |
|
23 #include <AknsDrawUtils.h> |
|
24 |
|
25 #ifndef FIX_FOR_NGA |
|
26 #define FIX_FOR_NGA |
|
27 #endif |
|
28 |
21 class RAknUiServer; |
29 class RAknUiServer; |
22 class CPenUiWndCtrl; |
30 class CPenUiWndCtrl; |
|
31 class CPenUiHwnWnd; |
|
32 |
|
33 struct TCommonBgCtrlSubItem |
|
34 { |
|
35 TRect iRect; |
|
36 TAknsItemID iFrameID; |
|
37 TAknsItemID iCenterID; |
|
38 TBool iIsShow; |
|
39 }; |
|
40 class CPenUiWndCtrl; |
|
41 |
|
42 class CCursorWindow : public CCoeControl |
|
43 { |
|
44 public: // Functions from base classes. |
|
45 |
|
46 CCursorWindow(CPenUiWndCtrl* aParent); |
|
47 //void ConstructL(CCoeControl* aParent); |
|
48 /** |
|
49 * From CCoeControl |
|
50 * Function where control's drawing is done. |
|
51 * |
|
52 * @param aRect Control's area. |
|
53 */ |
|
54 void Draw( const TRect &aRect ) const; |
|
55 |
|
56 void SetCursorVisible(TBool aFlag); |
|
57 |
|
58 private: |
|
59 TBool iCursorVisible; |
|
60 CPenUiWndCtrl* iParent; |
|
61 }; |
|
62 |
23 class CPenUiPopWnd : public CCoeControl |
63 class CPenUiPopWnd : public CCoeControl |
24 { |
64 { |
25 public: // Constructors and destructor |
65 public: // Constructors and destructor |
26 static CPenUiPopWnd* NewL(RWindowGroup& aWndGroup,CFbsBitmap * aBitmap, |
66 static CPenUiPopWnd* NewL(RWindowGroup& aWndGroup,CFbsBitmap * aBitmap, |
27 CPenUiWndCtrl* aCtrl); |
67 CPenUiWndCtrl* aCtrl); |
151 void DimPenUiForMenu(TInt aPriority); |
191 void DimPenUiForMenu(TInt aPriority); |
152 void DimInternalPenUiForMenu(TInt aPriority); |
192 void DimInternalPenUiForMenu(TInt aPriority); |
153 void DimPenUiForMenu(); |
193 void DimPenUiForMenu(); |
154 TInt GetWndPriority(); |
194 TInt GetWndPriority(); |
155 void SetResourceChange(TBool aResourceChange); |
195 void SetResourceChange(TBool aResourceChange); |
|
196 void UpdateCursor(TBool aOnFlag,const CFbsBitmap* aCursorBmp,const TRect& aPos); |
|
197 void SetPopupArea(const TRect& aRect, TBool aFlag); |
|
198 void UpdateICFArea(const CFbsBitmap* aBmp,const TPoint& aPos); |
|
199 |
|
200 /** |
|
201 * Update the bubble area list |
|
202 * |
|
203 * @since S60 v5.0 |
|
204 * @param aCtrl the Ctrl's address |
|
205 * @param aBmp the bubble bitmap's address |
|
206 * @param aRect the bubble rect |
|
207 * @param aFlag ETrue means add bubble area and |
|
208 * EFalse means remove bubble area |
|
209 * @return void |
|
210 */ |
|
211 void UpdateChangedArea( const TUint32 aCtrl, |
|
212 const CFbsBitmap* aBmp, const TRect& aRect, TBool aFlag ); |
|
213 |
|
214 /** |
|
215 * Update the bubble area list |
|
216 * |
|
217 * @since S60 v5.0 |
|
218 * @param aCtrl the Ctrl's address |
|
219 * @param aBmp the bubble bitmap's address |
|
220 * @param aMaskBmp the bubble mask bitmap's address |
|
221 * @param aPos the bubble rect |
|
222 * @param aFlag ETrue means add bubble area and |
|
223 * EFalse means remove bubble area |
|
224 * @return void |
|
225 */ |
|
226 void UpdateBubble( const TUint32 aCtrl, |
|
227 const CFbsBitmap* aBmp, const CFbsBitmap* aMaskBmp, |
|
228 const TRect& aPos, TBool aFlag ); |
|
229 |
|
230 void Clean(); |
|
231 |
|
232 void HandleNGASpecificSignal(TInt aEventType, const TDesC& aEventData); |
|
233 void LiftUpPriority(); |
|
234 |
|
235 /** |
|
236 * Update the cursor color |
|
237 * |
|
238 * @since S60 v5.0 |
|
239 * @param none |
|
240 * @return void |
|
241 */ |
|
242 void SetCursorColor(); |
|
243 |
156 public: // Functions from base classes. |
244 public: // Functions from base classes. |
157 |
245 |
158 /** |
246 /** |
159 * From CCoeControl |
247 * From CCoeControl |
160 * Function where control's drawing is done. |
248 * Function where control's drawing is done. |
161 * |
249 * |
162 * @param aRect Control's area. |
250 * @param aRect Control's area. |
163 */ |
251 */ |
164 void Draw( const TRect &aRect ) const; |
252 void Draw( const TRect &aRect ) const; |
165 |
253 |
|
254 public: |
|
255 /** |
|
256 * Auto refresh timer callback, refresh pen ui. (for NGA) |
|
257 */ |
|
258 void RefreshUI(); |
|
259 |
|
260 protected: |
|
261 CCoeControl* ComponentControl(TInt) const; |
|
262 TInt CountComponentControls() const; |
|
263 |
166 private: |
264 private: |
167 |
265 |
168 /** |
266 /** |
169 * when pen ui is activated, e.g. after screen saver, restore system fading status |
267 * when pen ui is activated, e.g. after screen saver, restore system fading status |
170 * and set non-fading for pen ui |
268 * and set non-fading for pen ui |
195 * @param aWS Indicate RWsSession. |
293 * @param aWS Indicate RWsSession. |
196 * @param aWGId Id of focus window group. |
294 * @param aWGId Id of focus window group. |
197 */ |
295 */ |
198 TUid WindowGroupNameAppUidL( RWsSession& aWS,TInt aWGId ); |
296 TUid WindowGroupNameAppUidL( RWsSession& aWS,TInt aWGId ); |
199 |
297 |
|
298 /** |
|
299 * Restart auto refresh timer. (for NGA) |
|
300 */ |
|
301 void RestartRefreshTimer(); |
|
302 |
|
303 /** |
|
304 * stop auto refresh timer. (for NGA) |
|
305 */ |
|
306 void StopRefreshTimer(); |
|
307 |
|
308 void DrawBkground(CWindowGc& aGc,const TRect& aRect) const; |
|
309 void DrawFrame( CWindowGc& aGc,const TRect& aRect,TAknsItemID aFrameID,TAknsItemID aCenterID ) const; |
|
310 |
|
311 void DrawCursor(CWindowGc& aGc) const; |
|
312 void DrawBubbleAsBackground(CFbsBitGc* aGc, CFbsBitmap* aBmp, const TRect& aRect); |
200 |
313 |
201 private: // Data |
314 private: // Data |
202 RWindowGroup& iWndGroup; |
315 RWindowGroup& iWndGroup; |
203 CFbsBitmap * iBitmap; |
316 CFbsBitmap * iBitmap; |
204 |
317 |
211 TInt iFocusWndGrpPos; |
324 TInt iFocusWndGrpPos; |
212 TInt iFocusWgHandle; |
325 TInt iFocusWgHandle; |
213 |
326 |
214 TInt iPriority; |
327 TInt iPriority; |
215 TInt iPreEditorPriority; |
328 TInt iPreEditorPriority; |
|
329 CAknIncallBubble* iIncallBubble; |
216 CPenUiPopWnd* iPopupWnd; |
330 CPenUiPopWnd* iPopupWnd; |
217 |
331 |
218 TBool iShowPopup; |
332 TBool iShowPopup; |
219 TRect iInvalidateRect; |
333 TRect iInvalidateRect; |
220 TBool iResourceChange; |
334 TBool iResourceChange; |
221 //TBool iUiLayoutChange; |
335 //TBool iUiLayoutChange; |
222 TBool iInGlobalEditorState; |
336 TBool iInGlobalEditorState; |
223 TRect iLayoutClipRect; |
337 TRect iLayoutClipRect; |
|
338 |
|
339 CFbsBitmap * iCursorBmp; |
|
340 CFbsBitmap* iICFBmp; |
|
341 CFbsBitmap* iChangedBmp; |
|
342 RPointerArray<CFbsBitmap> iBubblesArea; |
|
343 RPointerArray<CFbsBitmap> iBubblesMaskArea; |
|
344 |
|
345 /** |
|
346 * An array of the Controls' addresses |
|
347 */ |
|
348 RArray<TUint32> iBubblesCtrl; |
|
349 |
|
350 RArray<TRect> iBubblesPos; |
|
351 |
|
352 TPoint iCursorPos; |
|
353 TPoint iIcfPos; |
|
354 TPoint iChangedPos; |
|
355 TRect iIcfRect; |
|
356 TRect iCursorRect; |
|
357 CIdle *iIdle; |
|
358 TRect iRedrawRect; |
|
359 TInt iTouchCount; |
|
360 |
|
361 TBool iCursorVisible; |
|
362 |
|
363 RRegion iPopRegion; |
|
364 |
|
365 TBool iBackground; |
|
366 TAknsItemID iFrameID; |
|
367 TAknsItemID iCenterID; |
|
368 |
|
369 /** |
|
370 * Auto refresh timer |
|
371 * own |
|
372 */ |
|
373 CPeriodic* iAutoRefreshTimer; |
|
374 |
|
375 /** |
|
376 * The sub items of the background |
|
377 */ |
|
378 RArray<TCommonBgCtrlSubItem> *iSubItems; //not own |
|
379 |
|
380 TBool iNotUpdating; |
|
381 CCursorWindow* iCursorWnd; |
|
382 |
|
383 /** |
|
384 * The cursor's color |
|
385 */ |
|
386 TRgb iCursorColor; |
|
387 |
|
388 friend class CCursorWindow; |
224 }; |
389 }; |
225 class CInternalBkCtrl : public CCoeControl |
390 class CInternalBkCtrl : public CCoeControl |
226 { |
391 { |
227 public: // Constructors and destructor |
392 public: // Constructors and destructor |
228 /** |
393 /** |