equal
deleted
inserted
replaced
16 */ |
16 */ |
17 |
17 |
18 |
18 |
19 // INCLUDE FILES |
19 // INCLUDE FILES |
20 #include <../bidi.h> |
20 #include <../bidi.h> |
21 #include <aknAppUi.h> |
21 #include <aknappui.h> |
22 #include <aknutils.h> |
22 #include <AknUtils.h> |
23 #include "StaticObjectsContainer.h" |
23 #include "StaticObjectsContainer.h" |
24 #include "WebCannedImages.h" |
24 #include "WebCannedImages.h" |
25 #include "WebPageFullScreenHandler.h" |
25 #include "WebPageFullScreenHandler.h" |
26 #include "WebView.h" |
26 #include "WebView.h" |
27 #include "BrCtl.h" |
27 #include "BrCtl.h" |
28 |
28 |
29 using namespace WebCore; |
29 using namespace WebCore; |
30 |
30 |
31 const int KFullScreenButtonOffset = 50; |
31 const int KFullScreenButtonHeight = 60; |
32 const int KFullScreenButtonBuff = 15; |
32 const int KFullScreenButtonWidth = 60; |
|
33 const int KFullScreenButtonBuff = 5; |
33 |
34 |
34 // ----------------------------------------------------------------------------- |
35 // ----------------------------------------------------------------------------- |
35 // WebPageFullScreenHandler::NewL |
36 // WebPageFullScreenHandler::NewL |
36 // The two-phase Symbian constructor |
37 // The two-phase Symbian constructor |
37 // ----------------------------------------------------------------------------- |
38 // ----------------------------------------------------------------------------- |
63 void WebPageFullScreenHandler::ConstructL() |
64 void WebPageFullScreenHandler::ConstructL() |
64 { |
65 { |
65 m_buttonIcon = StaticObjectsContainer::instance()->webCannedImages()->getImage(WebCannedImages::EImageEscFullScreen); |
66 m_buttonIcon = StaticObjectsContainer::instance()->webCannedImages()->getImage(WebCannedImages::EImageEscFullScreen); |
66 TPoint pos = CalculatePosition(); |
67 TPoint pos = CalculatePosition(); |
67 BaseConstructL(m_webView, pos, m_buttonIcon.m_img, m_buttonIcon.m_msk, ETrue); |
68 BaseConstructL(m_webView, pos, m_buttonIcon.m_img, m_buttonIcon.m_msk, ETrue); |
68 if (AknLayoutUtils::PenEnabled()) { |
|
69 DrawableWindow()->SetPointerGrab(ETrue); |
|
70 } |
|
71 Hide(); |
69 Hide(); |
72 } |
70 } |
73 |
71 |
74 // ----------------------------------------------------------------------------- |
72 // ----------------------------------------------------------------------------- |
75 // Destructor |
73 // Destructor |
87 |
85 |
88 pos -= iconSize; |
86 pos -= iconSize; |
89 pos -= TPoint(KFullScreenButtonBuff, KFullScreenButtonBuff); |
87 pos -= TPoint(KFullScreenButtonBuff, KFullScreenButtonBuff); |
90 //pos -= m_webView->PositionRelativeToScreen(); |
88 //pos -= m_webView->PositionRelativeToScreen(); |
91 return pos; |
89 return pos; |
92 } |
|
93 |
|
94 TSize WebPageFullScreenHandler::CalculateSize() |
|
95 { |
|
96 TSize size = m_buttonIcon.m_img->SizeInPixels(); |
|
97 size += TSize(KFullScreenButtonBuff, KFullScreenButtonBuff); |
|
98 return size; |
|
99 } |
90 } |
100 |
91 |
101 //------------------------------------------------------------------------------- |
92 //------------------------------------------------------------------------------- |
102 // WebPageFullScreenHandler::showEscBtnL |
93 // WebPageFullScreenHandler::showEscBtnL |
103 // Draws the full screen button on the screen |
94 // Draws the full screen button on the screen |
130 void WebPageFullScreenHandler::SizeChanged(void) |
121 void WebPageFullScreenHandler::SizeChanged(void) |
131 { |
122 { |
132 if (AknLayoutUtils::PenEnabled()) { |
123 if (AknLayoutUtils::PenEnabled()) { |
133 TPoint pos = CalculatePosition(); |
124 TPoint pos = CalculatePosition(); |
134 SetPos(pos); |
125 SetPos(pos); |
135 TSize size = CalculateSize(); |
|
136 SetSizeWithoutNotification(size); |
|
137 } |
126 } |
138 } |
127 } |
139 |
128 |
140 //------------------------------------------------------------------------------- |
129 //------------------------------------------------------------------------------- |
141 // WebPageFullScreenHandler::fullScreenMode |
130 // WebPageFullScreenHandler::fullScreenMode |
156 m_isTouchDown = ETrue; |
145 m_isTouchDown = ETrue; |
157 break; |
146 break; |
158 |
147 |
159 case TPointerEvent::EButton1Up: |
148 case TPointerEvent::EButton1Up: |
160 { |
149 { |
161 TPoint fsPostion = PositionRelativeToScreen(); |
150 if (m_isTouchDown) { |
162 TRect fsRect = TRect(fsPostion,Size()); |
151 Hide(); |
163 fsRect = TRect(fsRect.iTl - TPoint(KFullScreenButtonOffset,KFullScreenButtonOffset), fsRect.iBr); |
152 m_webView->notifyFullscreenModeChangeL( false ); |
164 TPoint pointerPosition = fsPostion + aPointerEvent.iPosition; |
153 } |
165 if( fsRect.Contains(pointerPosition)) |
154 m_isTouchDown = EFalse; |
166 { |
|
167 if (m_isTouchDown) { |
|
168 Hide(); |
|
169 m_webView->notifyFullscreenModeChangeL( false ); |
|
170 } |
|
171 m_isTouchDown = EFalse; |
|
172 } |
|
173 } |
155 } |
174 break; |
156 break; |
175 } |
157 } |
176 } |
158 } |
177 |
159 |