|
1 /* |
|
2 * Copyright (c) 2005-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 button and dragbar |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef C_CBUTTONBASE_H |
|
19 #define C_CBUTTONBASE_H |
|
20 |
|
21 #include <peninputlayoutbasecontrol.h> |
|
22 /** |
|
23 * CButtonBase |
|
24 * |
|
25 * Button base control. This class could be used directly by user. |
|
26 * |
|
27 * @lib peninputlayoutcontrol.lib |
|
28 * @since S60 V4.0 |
|
29 */ |
|
30 class CButtonBase: public CFepUiBaseCtrl |
|
31 { |
|
32 public: |
|
33 //constructor and destructor |
|
34 /** |
|
35 * Destructor. |
|
36 * |
|
37 * @since S60 V4.0 |
|
38 */ |
|
39 IMPORT_C virtual ~CButtonBase(); |
|
40 |
|
41 /** |
|
42 * Factory function. |
|
43 * |
|
44 * @since S60 V4.0 |
|
45 * @param aRect The rectangle area for this control |
|
46 * @param aUiLayout Ui layout who contains this control.Ownership not transferred |
|
47 * @param aControlId control Id |
|
48 * @return An instance of CButtonBase class |
|
49 */ |
|
50 IMPORT_C static CButtonBase* NewL(const TRect& aRect,CFepUiLayout* aUiLayout,TInt aControlId); |
|
51 |
|
52 /** |
|
53 * Set button active or deactive. |
|
54 * |
|
55 * @since S60 V4.0 |
|
56 * @param aFlag Button status flag. |
|
57 */ |
|
58 IMPORT_C void SetActive(TBool aFlag); |
|
59 |
|
60 /** |
|
61 * Set button dimmed. |
|
62 * |
|
63 * @since S60 V4.0 |
|
64 * @param aFlag Dim status. Default value is ETrue. |
|
65 */ |
|
66 IMPORT_C void SetDimmed(TBool aFlag); |
|
67 |
|
68 /** |
|
69 * Set bitmap for given status . |
|
70 * |
|
71 * @since S60 V4.0 |
|
72 * @param aBmp The bitmap. Ownership transferred to button |
|
73 * @param aType The bitmap type used for |
|
74 */ |
|
75 IMPORT_C void SetBitmapL(CFbsBitmap* aBmp, TButtonBmpType aType); |
|
76 |
|
77 /** |
|
78 * Set mask bitmap for given status. |
|
79 * |
|
80 * @since S60 V4.0 |
|
81 * @param aBmp The bitmap. Ownership transferred to button |
|
82 * @param aType The bitmap type used for |
|
83 */ |
|
84 IMPORT_C void SetMaskBitmapL(CFbsBitmap* aBmp, TButtonBmpType aType); |
|
85 |
|
86 /** |
|
87 * get bitmap for given type . |
|
88 * |
|
89 * @since S60 V4.0 |
|
90 * @param aType The bitmap type used for |
|
91 * @param aMaskFlag EFalse if want to get the mask bitmap, otherwise, |
|
92 * return the bitmap. Default value is EFalse. |
|
93 * @return The bitmap |
|
94 */ |
|
95 IMPORT_C CFbsBitmap* Bitmap(TButtonBmpType aType,TBool aMaskFlag = EFalse); |
|
96 |
|
97 /** |
|
98 * Set caption. |
|
99 * |
|
100 * @since S60 V4.0 |
|
101 * @param aText The button caption |
|
102 */ |
|
103 IMPORT_C void SetCaptionL(const TDesC& aText); |
|
104 |
|
105 /** |
|
106 * Get button dimmed status . |
|
107 * |
|
108 * @since S60 V4.0 |
|
109 * @return Button dimmed status |
|
110 */ |
|
111 inline TBool IsDimmed(); |
|
112 |
|
113 |
|
114 /** |
|
115 * Enable bitmap stretchable. When it's set, all bitmap in this control |
|
116 * will be stretched to fit in the control. It's stretchable by default |
|
117 * |
|
118 * @since S60 V4.0 |
|
119 * @param aFlag the bitmap stretching flag |
|
120 */ |
|
121 inline void SetBmpStretchable(TBool aFlag = ETrue); |
|
122 |
|
123 /** |
|
124 * Get bitmap stretchable flag |
|
125 * |
|
126 * @since S60 V4.0 |
|
127 * @return aFlag the bitmap stretching flag |
|
128 */ |
|
129 inline TBool BmpStretchable(); |
|
130 |
|
131 |
|
132 //from base class CFepUiBaseCtrl |
|
133 /** |
|
134 * From CFepUiBaseCtrl |
|
135 * Draw control |
|
136 * |
|
137 * @since S60 V4.0 |
|
138 */ |
|
139 IMPORT_C virtual void Draw(); |
|
140 |
|
141 /** |
|
142 * From CFepUiBaseCtrl |
|
143 * Handle pointer levae event. |
|
144 * This will be called only when it's got pointer down event before and |
|
145 * now pointer leaves without pointer up event |
|
146 * |
|
147 * @since S60 V4.0 |
|
148 * @param aPoint current pointer position |
|
149 */ |
|
150 IMPORT_C virtual void HandlePointerLeave(const TPoint& aPoint); |
|
151 |
|
152 /** |
|
153 * From CFepUiBaseCtrl |
|
154 * Handle pointer enter event. |
|
155 * This will be called only when it's got pointer down event before and |
|
156 * pointer leaves but now comes back without pointer up event. |
|
157 * |
|
158 * @since S60 V4.0 |
|
159 * @param aPoint current pointer position |
|
160 */ |
|
161 IMPORT_C virtual void HandlePointerEnter(const TPoint& aPoint); |
|
162 |
|
163 /** |
|
164 * From CFepUiBaseCtrl |
|
165 * Set control's rectangle |
|
166 * |
|
167 * @since S60 V4.0 |
|
168 * @param aRect The new control area |
|
169 */ |
|
170 //IMPORT_C virtual void SetRect(const TRect& aRect); |
|
171 |
|
172 /** |
|
173 * Hide or shoe control. A hiden control will not handle the event. |
|
174 * |
|
175 * @since S60 V4.0 |
|
176 * @param aFlag ETrue if want to hide the control. |
|
177 */ |
|
178 //IMPORT_C virtual void Hide(TBool aFlag); |
|
179 |
|
180 /* Set the font for caption |
|
181 * |
|
182 * @since S60 V4.0 |
|
183 * @param aFontSpec the font spec to be used. |
|
184 */ |
|
185 IMPORT_C void SetFont(const TFontSpec& aFontSpec); |
|
186 |
|
187 /** |
|
188 * Set font information |
|
189 * |
|
190 * @since S60 V4.0 |
|
191 * @param aFont The font info for key drawing.Ownership not transferred |
|
192 */ |
|
193 IMPORT_C void SetFont(const CFont* aFont); |
|
194 |
|
195 /** |
|
196 * Set caption color |
|
197 * |
|
198 * @since S60 V4.0 |
|
199 * @param aCol The caption font color |
|
200 */ |
|
201 inline void SetCaptionColor(const TRgb& aCol); |
|
202 |
|
203 /** |
|
204 * Set font shadow color |
|
205 * |
|
206 * @since S60 V4.0 |
|
207 * @param aCol The font color |
|
208 */ |
|
209 inline void SetCaptionShadowColor(const TRgb& aCol); |
|
210 |
|
211 /** |
|
212 * Reset the bitmap pool. |
|
213 * |
|
214 * @since S60 v4.0 |
|
215 */ |
|
216 IMPORT_C void ResetBmpPool(); |
|
217 |
|
218 IMPORT_C void Hide(TBool aFlag); |
|
219 |
|
220 protected: |
|
221 /** |
|
222 * Constructor |
|
223 * |
|
224 * @since S60 V4.0 |
|
225 * @param aRect The rectangle area for this control |
|
226 * @param aUiLayout Ui layout who contains this control.Ownership not transferred |
|
227 * @param aControlId control Id |
|
228 */ |
|
229 IMPORT_C CButtonBase(const TRect& aRect,CFepUiLayout* aUiLayout,TInt aControlId); |
|
230 /** |
|
231 * From CFepUiBaseCtrl |
|
232 * Handle pointer down event |
|
233 * |
|
234 * @since S60 V4.0 |
|
235 * @param aPoint The point position relative the layout |
|
236 * @return The control which handles the event. |
|
237 */ |
|
238 IMPORT_C virtual CFepUiBaseCtrl* HandlePointerDownEventL(const TPoint& aPoint); |
|
239 |
|
240 /** |
|
241 * Handle pointer move event |
|
242 * From CFepUiBaseCtrl |
|
243 * |
|
244 * @since S60 V4.0 |
|
245 * @param aPoint The point position relative the layout |
|
246 * @return The control which handles the event. |
|
247 */ |
|
248 IMPORT_C virtual CFepUiBaseCtrl* HandlePointerMoveEventL(const TPoint& aPoint); |
|
249 |
|
250 /** |
|
251 * From CFepUiBaseCtrl |
|
252 * Handle pointer up event |
|
253 * |
|
254 * @since S60 V4.0 |
|
255 * @param aPoint The point position relative the layout |
|
256 * @return The control which handles the event |
|
257 */ |
|
258 IMPORT_C virtual CFepUiBaseCtrl* HandlePointerUpEventL(const TPoint& aPoint); |
|
259 |
|
260 /** |
|
261 * Set background bitmap |
|
262 * |
|
263 * @since S60 V4.0 |
|
264 * @param aBmp The background bitmap. Ownership transferred to control |
|
265 */ |
|
266 IMPORT_C virtual void SetBackgroundBitmapL(CFbsBitmap* aBmp); |
|
267 |
|
268 /** |
|
269 * Set background mask bitmap |
|
270 * |
|
271 * @since S60 V4.0 |
|
272 * @param aBmp The background bitmap. Ownership transferred to control |
|
273 */ |
|
274 IMPORT_C virtual void SetBackgroundMaskBitmapL(CFbsBitmap* aBmp); |
|
275 |
|
276 private: |
|
277 /** |
|
278 * Add a bitmap to bitmap pool |
|
279 * |
|
280 * @since S60 V4.0 |
|
281 * @param aBmp The bitmap to be added |
|
282 */ |
|
283 void AddBmpToPool(CFbsBitmap* aBmp); |
|
284 |
|
285 |
|
286 protected: |
|
287 /** |
|
288 * bitmap for active state |
|
289 * Own. |
|
290 */ |
|
291 CFbsBitmap* iActiveBmp; |
|
292 |
|
293 /** |
|
294 * bitmap for pressing in active state |
|
295 * Own. |
|
296 */ |
|
297 CFbsBitmap* iActiveBmpPressed; |
|
298 |
|
299 /** |
|
300 * bitmap for non active state |
|
301 * Own. |
|
302 */ |
|
303 CFbsBitmap* iNonActiveBkBmp; |
|
304 |
|
305 /** |
|
306 * bitmap for pressing in non active state |
|
307 * Own. |
|
308 */ |
|
309 CFbsBitmap* iNonActiveBkBmpPressed; |
|
310 |
|
311 /** |
|
312 * mask bitmap for active state |
|
313 * Own. |
|
314 */ |
|
315 CFbsBitmap* iActiveMaskBmp; |
|
316 |
|
317 /** |
|
318 * mask bitmap for pressing in active state |
|
319 * Own. |
|
320 */ |
|
321 CFbsBitmap* iActiveMaskBmpPressed; |
|
322 |
|
323 /** |
|
324 * mask bitmap for non active state |
|
325 * Own. |
|
326 */ |
|
327 CFbsBitmap* iNonActiveBkMaskBmp; |
|
328 |
|
329 /** |
|
330 * mask bitmap for pressing in non active state |
|
331 * Own. |
|
332 */ |
|
333 CFbsBitmap* iNonActiveBkMaskBmpPressed; |
|
334 |
|
335 private: |
|
336 /** |
|
337 * Button pressed status |
|
338 */ |
|
339 TBool iPressed; |
|
340 |
|
341 /** |
|
342 * Button dim status |
|
343 */ |
|
344 TBool iDimmed; |
|
345 |
|
346 /** |
|
347 * Bitmap stretchable flag |
|
348 */ |
|
349 TBool iStretchable; |
|
350 |
|
351 /** |
|
352 * bitmap for dimmed state |
|
353 * Own. |
|
354 */ |
|
355 CFbsBitmap* iDimmedBmp; |
|
356 |
|
357 /** |
|
358 * mask bitmap for dim stute |
|
359 * Own. |
|
360 */ |
|
361 CFbsBitmap* iDimmedMaskBmp; |
|
362 |
|
363 /** |
|
364 * Button caption |
|
365 */ |
|
366 HBufC* iCaption; |
|
367 |
|
368 /** |
|
369 * Font object for key drawing |
|
370 * Ownership depends on flag iFontOwnership. |
|
371 */ |
|
372 CFont* iFont; |
|
373 |
|
374 /** |
|
375 * Font information for key drawing |
|
376 */ |
|
377 TFontSpec iFontSpec; |
|
378 |
|
379 /** |
|
380 * Flag ownership flag. ETrue if CFont object is owned by this control. |
|
381 */ |
|
382 TBool iFontOwnership; |
|
383 /** |
|
384 * Baseline for caption |
|
385 */ |
|
386 TInt iBaseline; |
|
387 |
|
388 /** |
|
389 * Pen color for first level caption |
|
390 */ |
|
391 TRgb iCaptionColor; |
|
392 |
|
393 /** |
|
394 * Pen color for caption shadow |
|
395 */ |
|
396 TRgb iCaptionShadowColor; |
|
397 |
|
398 /** |
|
399 * bitmap pool for all bitmaps. |
|
400 */ |
|
401 RPointerArray<CFbsBitmap> iBmpPool; |
|
402 |
|
403 /** |
|
404 * keep the bitmap for background bitmap set by SetBackgroundBitmapL in case someone used. |
|
405 * Own. |
|
406 */ |
|
407 CFbsBitmap* iNoUsedBkbmp; |
|
408 |
|
409 /** |
|
410 * keep the bitmap for mask background bitmap set by SetBackgroundMaskBitmapL in case someone used. |
|
411 * Own. |
|
412 */ |
|
413 CFbsBitmap* iNoUsedMaskBkbmp; |
|
414 |
|
415 /** |
|
416 * Reserved item1 |
|
417 */ |
|
418 TInt iReserved1; |
|
419 |
|
420 /** |
|
421 * Reserved item2 |
|
422 */ |
|
423 TInt iReserved2; |
|
424 |
|
425 }; |
|
426 |
|
427 |
|
428 /** |
|
429 * CDragBar |
|
430 * |
|
431 * Drag bar |
|
432 * |
|
433 * @lib peninputlayoutcontrol.lib |
|
434 * @since S60 V4.0 |
|
435 */ |
|
436 class CDragBar: public CButtonBase,public MTimerHandler,public MEventObserver |
|
437 { |
|
438 public: |
|
439 /** |
|
440 * Factory function |
|
441 * |
|
442 * @since S60 V4.0 |
|
443 * @param aRect The rectangle area for this control |
|
444 * @param aUiLayout Ui layout who contains this control.Ownership not transferred |
|
445 * @param aControlId control Id |
|
446 * @return The class instance |
|
447 */ |
|
448 IMPORT_C static CDragBar* NewL(const TRect& aRect,CFepUiLayout* aUiLayout,TInt aControlId); |
|
449 |
|
450 /** |
|
451 * Destructor |
|
452 * |
|
453 * @since S60 V4.0 |
|
454 */ |
|
455 IMPORT_C virtual ~CDragBar(); |
|
456 |
|
457 /** |
|
458 * Add position observer. When drag bar moved, the observer will get notified. |
|
459 * |
|
460 * @since S60 V4.0 |
|
461 * @param aObserver The event observer |
|
462 */ |
|
463 IMPORT_C void AddPositionObserver(MPositionObserver* aObserver); |
|
464 |
|
465 /** |
|
466 * Remove position observer. |
|
467 * |
|
468 * @since S60 V4.0 |
|
469 * @param aObserver The event observer to be removed |
|
470 */ |
|
471 IMPORT_C void RemovePositionObserver(MPositionObserver* aObserver); |
|
472 |
|
473 /** |
|
474 * Set the long press time out. |
|
475 * |
|
476 * @since S60 V4.0 |
|
477 * @param aTime The long press event time out interval |
|
478 */ |
|
479 IMPORT_C void SetLongpressTimer(TTimeIntervalMicroSeconds32 aTime); |
|
480 |
|
481 /** |
|
482 * Check a control is the position observer of the dragbar |
|
483 * |
|
484 * @since S60 V4.0 |
|
485 * @param aControl The control to be checked |
|
486 * @return ETrue if the control is position observer of the dragbar |
|
487 */ |
|
488 IMPORT_C TBool IsDraggingComponent(CFepUiBaseCtrl* aControl); |
|
489 |
|
490 /** |
|
491 * Get dragging status. |
|
492 * |
|
493 * @since S60 V4.0 |
|
494 * @param None |
|
495 * @return ETrue if is dragging, otherwise EFalse |
|
496 */ |
|
497 inline TBool IsDragging(); |
|
498 |
|
499 /** |
|
500 * Set the moving draw interval. |
|
501 * |
|
502 * @since S60 V4.0 |
|
503 * @param aTime The drawing interval while moving |
|
504 */ |
|
505 inline void SetRedrawInterval(TTimeIntervalMicroSeconds32 aTime); |
|
506 |
|
507 /** |
|
508 * Enable/disable dragging feature. |
|
509 * Dragging is enabled by default when created. |
|
510 * |
|
511 * @since S60 V4.0 |
|
512 * @param aFlag dragging flag. Default value is ETrue |
|
513 */ |
|
514 inline void EnableDragging(TBool aFlag = ETrue); |
|
515 |
|
516 /** |
|
517 * Set bitmap for given status . |
|
518 * |
|
519 * @since S60 V4.0 |
|
520 * @param aBmp The bitmap. Ownership transferred to dragbar |
|
521 * @param The type of the bitmap |
|
522 */ |
|
523 IMPORT_C void SetBitmapL(CFbsBitmap* aBmp, TButtonBmpType aType); |
|
524 |
|
525 /** |
|
526 * Set mask bitmap for given status . |
|
527 * |
|
528 * @since S60 V4.0 |
|
529 * @param aBmp The bitmap. Ownership transferred to dragbar |
|
530 * @parma aType The type of bitmap |
|
531 */ |
|
532 IMPORT_C void SetMaskBitmapL(CFbsBitmap* aBmp, TButtonBmpType aType); |
|
533 |
|
534 //From base class CFepUiBaseCtrl |
|
535 |
|
536 /** |
|
537 * From CFepUiBaseCtrl |
|
538 * Update control and it's components rect |
|
539 * |
|
540 * @since S60 V4.0 |
|
541 * @param aOffset The offset to be moved |
|
542 */ |
|
543 IMPORT_C void Move(const TPoint& aOffset); |
|
544 |
|
545 //from base class MEventObserver |
|
546 |
|
547 /** |
|
548 * From MEventObserver |
|
549 * Handle control event |
|
550 * |
|
551 * @since S60 V4.0 |
|
552 * @param aEventType The event type |
|
553 * @param aCtrl The control who sends the event |
|
554 * @param aEventData The event data |
|
555 */ |
|
556 IMPORT_C void HandleControlEvent(TInt aEventType, CFepUiBaseCtrl* aCtrl, |
|
557 const TDesC& aEventData); |
|
558 |
|
559 //from base class MTimerHandler |
|
560 /** |
|
561 * From MTimerHandler |
|
562 * HandleTimerOut. Handling time out event |
|
563 * |
|
564 * @since S60 V4.0 |
|
565 * @param aTimeType The timer type |
|
566 */ |
|
567 IMPORT_C void HandleTimerOut(TInt aTimeType); |
|
568 |
|
569 /** |
|
570 * From CFepUiBaseCtrl |
|
571 * OnDeActivate. Called when the layout is going to be hidden |
|
572 * |
|
573 * @since S60 v4.0 |
|
574 */ |
|
575 IMPORT_C void OnDeActivate(); |
|
576 |
|
577 /** |
|
578 * Cancel pointer down event. |
|
579 * This will be called when a control has pointer down but pointer up |
|
580 * event happens in other ways. If overrided, this base implementation |
|
581 * must be called in order to report the event. |
|
582 * |
|
583 * @since S60 V4.0 |
|
584 * @param aFocusedFlag ETrue if got focused, otherwise EFalse |
|
585 */ |
|
586 IMPORT_C virtual void CancelPointerDownL(); |
|
587 |
|
588 /** |
|
589 * Recalculate moving area. It's called when it's observer changes size. |
|
590 * |
|
591 * @since S60 v4.0 |
|
592 */ |
|
593 void ReCalculateDragArea(); |
|
594 |
|
595 protected: |
|
596 /** |
|
597 * Constructor |
|
598 * |
|
599 * @since S60 V4.0 |
|
600 * @param aRect The rectangle area for this control |
|
601 * @param aUiLayout Ui layout who contains this control. Ownership not transferred |
|
602 * @param aControlId control Id |
|
603 */ |
|
604 IMPORT_C CDragBar(const TRect& aRect,CFepUiLayout* aUiLayout, |
|
605 TInt aControlId); |
|
606 |
|
607 /** |
|
608 * Second phrase constructor |
|
609 * |
|
610 * @since S60 V4.0 |
|
611 */ |
|
612 IMPORT_C void ConstructL(); |
|
613 |
|
614 /** |
|
615 * Test whether the moving destination is valid |
|
616 * |
|
617 * @since S60 V4.0 |
|
618 * @param aPt The destionation point |
|
619 * @param aVInfo The valid information in vertial dirtection |
|
620 * @param aHInfo The valid information in horizontal dirtection |
|
621 * @return ETrue if valid, otherwise EFalse |
|
622 */ |
|
623 IMPORT_C TBool IsValidDestination(const TPoint& aPt,TBool& aVInfo, |
|
624 TBool& aHInfo); |
|
625 |
|
626 |
|
627 /** |
|
628 * From CFepUiBaseCtrl |
|
629 * Handle pointer down event |
|
630 * |
|
631 * @since S60 V4.0 |
|
632 * @param aPoint The point position relative the layout |
|
633 * @return The control which handles the event. |
|
634 */ |
|
635 IMPORT_C virtual CFepUiBaseCtrl* HandlePointerDownEventL(const TPoint& aPoint); |
|
636 |
|
637 /** |
|
638 * From CFepUiBaseCtrl |
|
639 * Handle pointer move event |
|
640 * |
|
641 * @since S60 V4.0 |
|
642 * @param aPoint The point position relative the layout |
|
643 * @return The control which handles the event. |
|
644 */ |
|
645 IMPORT_C virtual CFepUiBaseCtrl* HandlePointerMoveEventL(const TPoint& aPoint); |
|
646 |
|
647 /** |
|
648 * From CFepUiBaseCtrl |
|
649 * Handle pointer up event |
|
650 * |
|
651 * @since S60 V4.0 |
|
652 * @param aPoint The point position relative the layout |
|
653 * @return The control which handles the event. |
|
654 */ |
|
655 IMPORT_C virtual CFepUiBaseCtrl* HandlePointerUpEventL(const TPoint& aPoint); |
|
656 |
|
657 private: |
|
658 /** |
|
659 * Draw control frame |
|
660 * |
|
661 * @since S60 V4.0 |
|
662 * @param aFrameRect The rect to be drawn |
|
663 * @param aDrawFlag Draw or erase flag. ETrue if draw |
|
664 * @return The affected rect |
|
665 */ |
|
666 TRect DrawFrame(const TRect& aFrameRect, TBool aDrawFlag = ETrue); |
|
667 |
|
668 /** |
|
669 * Show or hide the moving indicator |
|
670 * |
|
671 * @since S60 V4.0 |
|
672 * @param aDrawFlag ETrue if show the moving indicator. Default value ETrue |
|
673 */ |
|
674 void ShowMovingIndicator(TBool aDrawFlag = ETrue); |
|
675 |
|
676 /** |
|
677 * Add a control to the dragging list |
|
678 * |
|
679 * @since S60 V4.0 |
|
680 * @param aCtrl The control to be added |
|
681 */ |
|
682 void AddToDraggingCtrlList(CFepUiBaseCtrl* aCtrl); |
|
683 |
|
684 /** |
|
685 * Do preparation before dragging |
|
686 * |
|
687 * @since S60 V4.0 |
|
688 */ |
|
689 void PrepareDragging(); |
|
690 |
|
691 /** |
|
692 * Restore states after dragging |
|
693 * |
|
694 * @since S60 V4.0 |
|
695 */ |
|
696 void AfterDragging(); |
|
697 |
|
698 private: |
|
699 /** |
|
700 * dragging flag |
|
701 */ |
|
702 TBool iIsDragging; |
|
703 |
|
704 /** |
|
705 * Moving offset when drag bar is moving. |
|
706 */ |
|
707 TPoint iMoveOffset; |
|
708 |
|
709 /** |
|
710 * dragging start position |
|
711 */ |
|
712 TPoint iDraggingStartPt; |
|
713 |
|
714 /** |
|
715 * Position change observer list |
|
716 */ |
|
717 RPointerArray<MPositionObserver> iPosObserverList; |
|
718 |
|
719 /** |
|
720 * The rect to be drawn when dragging. It's the rect of whole dragging area |
|
721 */ |
|
722 TRect iDragFrameRect; |
|
723 |
|
724 /** |
|
725 * Moving flag, is it moving. |
|
726 */ |
|
727 TBool iMoved; |
|
728 |
|
729 /** |
|
730 * Flag tells whether whole layout is being draged |
|
731 */ |
|
732 TBool iLayoutBeingDraged; |
|
733 |
|
734 /** |
|
735 * Long time press event flag. |
|
736 * When this is enabled, dragbar starts move only after long press time out |
|
737 */ |
|
738 TBool iNeedLongtimePress; |
|
739 |
|
740 /** |
|
741 * Long time press timer interval |
|
742 */ |
|
743 TTimeIntervalMicroSeconds32 iLongtimePressTimeout; |
|
744 |
|
745 /** |
|
746 * Flag tells whether long pressing happend |
|
747 */ |
|
748 TBool iLongPressed; |
|
749 |
|
750 /** |
|
751 * Draing enabler flag. Only this flag set can dragbar movable. |
|
752 * Default value is ETrue |
|
753 */ |
|
754 TBool iDraggingEnabled; |
|
755 |
|
756 /** |
|
757 * The position where moving indidator is displayed |
|
758 */ |
|
759 TPoint iMovingIndicatorPos; |
|
760 |
|
761 /** |
|
762 * Currnt pointer position. Need to kept since we use timely drawing. |
|
763 */ |
|
764 TPoint iCurrentPointerPos; |
|
765 |
|
766 /** |
|
767 * Redraw timer interval. |
|
768 * While moving, it's not drawn if another redraw event comes |
|
769 */ |
|
770 TTimeIntervalMicroSeconds32 iDrawInterval; |
|
771 |
|
772 /** |
|
773 * A list keeps all the control belongs to the dragging area |
|
774 */ |
|
775 RPointerArray<CFepUiBaseCtrl> iDraggingCtrlList; |
|
776 |
|
777 /** |
|
778 * long press timer |
|
779 * Own. |
|
780 */ |
|
781 CLayoutTimer* iLongPressTimer; |
|
782 |
|
783 /** |
|
784 * Moving indicator bitmap |
|
785 * Own. |
|
786 */ |
|
787 CFbsBitmap* iMovingIndicatorBmp; |
|
788 |
|
789 /** |
|
790 * Moving indicator mask bitmap |
|
791 * Own |
|
792 */ |
|
793 CFbsBitmap* iMovingIndicatorMaskBmp; |
|
794 |
|
795 /** |
|
796 * Redraw timer for moving |
|
797 * Own |
|
798 */ |
|
799 CLayoutTimer* iMoveTimer; |
|
800 |
|
801 /** |
|
802 * Reserved item1 |
|
803 */ |
|
804 TInt iReserved1; |
|
805 |
|
806 /** |
|
807 * Reserved item2 |
|
808 */ |
|
809 TInt iReserved2; |
|
810 }; |
|
811 //end of CDragBar |
|
812 |
|
813 #include <peninputlayoutbutton.inl> |
|
814 #endif //C_CBUTTONBASE_H |