equal
deleted
inserted
replaced
14 * Description: This file implements overlay controls |
14 * Description: This file implements overlay controls |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 #include "OverlayControl.h" |
18 #include "OverlayControl.h" |
19 |
|
20 // CONSTS |
|
21 const TReal KSolidTransparencyFactor = 2; |
|
22 |
|
23 |
19 |
24 COverlayControl::COverlayControl( MOverlayControlObserver* aObserver ) |
20 COverlayControl::COverlayControl( MOverlayControlObserver* aObserver ) |
25 : iObserver( aObserver ) |
21 : iObserver( aObserver ) |
26 { |
22 { |
27 } |
23 } |
42 return self; |
38 return self; |
43 } |
39 } |
44 |
40 |
45 void COverlayControl::ConstructL( CCoeControl* aParent, const TRect& aRect, TInt aBitmapId, TInt aMaskId ) |
41 void COverlayControl::ConstructL( CCoeControl* aParent, const TRect& aRect, TInt aBitmapId, TInt aMaskId ) |
46 { |
42 { |
47 |
|
48 SetContainerWindowL( *aParent ); |
43 SetContainerWindowL( *aParent ); |
49 |
|
50 TFileName iconFileName; |
44 TFileName iconFileName; |
51 TFsEmailUiUtility::GetFullIconFileNameL( iconFileName ); |
45 TFsEmailUiUtility::GetFullIconFileNameL( iconFileName ); |
52 AknIconUtils::CreateIconL( iBitmap, |
46 AknIconUtils::CreateIconL( iBitmap, |
53 iMask, |
47 iMask, |
54 iconFileName, |
48 iconFileName, |
55 aBitmapId, |
49 aBitmapId, |
56 aMaskId ); |
50 aMaskId ); |
57 |
|
58 SetRect( aRect ); |
51 SetRect( aRect ); |
|
52 iTouchFeedBack = MTouchFeedback::Instance(); |
|
53 iTouchFeedBack->EnableFeedbackForControl(this, ETrue); |
59 EnableDragEvents(); |
54 EnableDragEvents(); |
60 |
|
61 ActivateL(); |
55 ActivateL(); |
62 } |
56 } |
63 |
57 |
64 void COverlayControl::SetRect( const TRect& aRect ) |
58 void COverlayControl::SetRect( const TRect& aRect ) |
65 { |
59 { |
74 CCoeControl::SetRect( aRect ); |
68 CCoeControl::SetRect( aRect ); |
75 } |
69 } |
76 |
70 |
77 void COverlayControl::HandlePointerEventL( const TPointerEvent& aPointerEvent ) |
71 void COverlayControl::HandlePointerEventL( const TPointerEvent& aPointerEvent ) |
78 { |
72 { |
|
73 if (aPointerEvent.iType == TPointerEvent::EButton1Down) |
|
74 { |
|
75 // Give feedback to user (vibration) |
|
76 iTouchFeedBack->InstantFeedback(this, ETouchFeedbackBasic); |
|
77 } |
|
78 |
79 CCoeControl::HandlePointerEventL( aPointerEvent ); |
79 CCoeControl::HandlePointerEventL( aPointerEvent ); |
80 |
80 |
81 if( iObserver ) |
81 if( iObserver ) |
82 { |
82 { |
83 // Do not let leaves disturb the system |
83 // Do not let leaves disturb the system |