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 void UpdateChangedArea(const CFbsBitmap* aBmp,const TRect& aRect,TBool aFlag); |
|
200 void UpdateBubble(const CFbsBitmap* aBmp,const CFbsBitmap* aMaskBmp,const TRect& aPos,TBool aFlag); |
|
201 void Clean(); |
|
202 |
|
203 void HandleNGASpecificSignal(TInt aEventType, const TDesC& aEventData); |
156 public: // Functions from base classes. |
204 public: // Functions from base classes. |
157 |
205 |
158 /** |
206 /** |
159 * From CCoeControl |
207 * From CCoeControl |
160 * Function where control's drawing is done. |
208 * Function where control's drawing is done. |
166 public: |
214 public: |
167 /** |
215 /** |
168 * Auto refresh timer callback, refresh pen ui. (for NGA) |
216 * Auto refresh timer callback, refresh pen ui. (for NGA) |
169 */ |
217 */ |
170 void RefreshUI(); |
218 void RefreshUI(); |
171 |
219 |
|
220 protected: |
|
221 CCoeControl* ComponentControl(TInt) const; |
|
222 TInt CountComponentControls() const; |
|
223 |
172 private: |
224 private: |
173 |
225 |
174 /** |
226 /** |
175 * when pen ui is activated, e.g. after screen saver, restore system fading status |
227 * when pen ui is activated, e.g. after screen saver, restore system fading status |
176 * and set non-fading for pen ui |
228 * and set non-fading for pen ui |
211 /** |
263 /** |
212 * stop auto refresh timer. (for NGA) |
264 * stop auto refresh timer. (for NGA) |
213 */ |
265 */ |
214 void StopRefreshTimer(); |
266 void StopRefreshTimer(); |
215 |
267 |
|
268 void DrawBkground(CWindowGc& aGc,const TRect& aRect) const; |
|
269 void DrawFrame( CWindowGc& aGc,const TRect& aRect,TAknsItemID aFrameID,TAknsItemID aCenterID ) const; |
|
270 |
|
271 void DrawCursor(CWindowGc& aGc) const; |
|
272 void DrawBubbleAsBackground(CFbsBitGc* aGc, CFbsBitmap* aBmp, const TRect& aRect); |
216 |
273 |
217 private: // Data |
274 private: // Data |
218 RWindowGroup& iWndGroup; |
275 RWindowGroup& iWndGroup; |
219 CFbsBitmap * iBitmap; |
276 CFbsBitmap * iBitmap; |
220 |
277 |
236 TRect iInvalidateRect; |
293 TRect iInvalidateRect; |
237 TBool iResourceChange; |
294 TBool iResourceChange; |
238 //TBool iUiLayoutChange; |
295 //TBool iUiLayoutChange; |
239 TBool iInGlobalEditorState; |
296 TBool iInGlobalEditorState; |
240 TRect iLayoutClipRect; |
297 TRect iLayoutClipRect; |
|
298 |
|
299 CFbsBitmap * iCursorBmp; |
|
300 CFbsBitmap* iICFBmp; |
|
301 CFbsBitmap* iChangedBmp; |
|
302 RPointerArray<CFbsBitmap> iBubblesArea; |
|
303 RPointerArray<CFbsBitmap> iBubblesMaskArea; |
|
304 RArray<TRect> iBubblesPos; |
|
305 |
|
306 TPoint iCursorPos; |
|
307 TPoint iIcfPos; |
|
308 TPoint iChangedPos; |
|
309 TRect iIcfRect; |
|
310 TRect iCursorRect; |
|
311 CIdle *iIdle; |
|
312 TRect iRedrawRect; |
|
313 TInt iTouchCount; |
|
314 |
|
315 TBool iCursorVisible; |
|
316 |
|
317 RRegion iPopRegion; |
|
318 |
|
319 TBool iBackground; |
|
320 TAknsItemID iFrameID; |
|
321 TAknsItemID iCenterID; |
241 |
322 |
242 /** |
323 /** |
243 * Auto refresh timer |
324 * Auto refresh timer |
244 * own |
325 * own |
245 */ |
326 */ |
246 CPeriodic* iAutoRefreshTimer; |
327 CPeriodic* iAutoRefreshTimer; |
247 |
328 |
|
329 /** |
|
330 * The sub items of the background |
|
331 */ |
|
332 RArray<TCommonBgCtrlSubItem> *iSubItems; //not own |
|
333 |
|
334 TBool iNotUpdating; |
|
335 CCursorWindow* iCursorWnd; |
|
336 |
|
337 friend class CCursorWindow; |
248 }; |
338 }; |
249 class CInternalBkCtrl : public CCoeControl |
339 class CInternalBkCtrl : public CCoeControl |
250 { |
340 { |
251 public: // Constructors and destructor |
341 public: // Constructors and destructor |
252 /** |
342 /** |