webengine/osswebengine/WebKit/s60/webview/WebPageFullScreenHandler.cpp
branchRCL_3
changeset 47 e1bea15f9a39
parent 42 a1a5d4e727e8
child 48 79859ed3eea9
equal deleted inserted replaced
46:30342f40acbf 47:e1bea15f9a39
    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 KFullScreenButtonOffset = 50;
    32 const int KFullScreenButtonBuff  = 5;
    32 const int KFullScreenButtonBuff  = 15;
    33 
    33 
    34 // -----------------------------------------------------------------------------
    34 // -----------------------------------------------------------------------------
    35 // WebPageFullScreenHandler::NewL
    35 // WebPageFullScreenHandler::NewL
    36 // The two-phase Symbian constructor
    36 // The two-phase Symbian constructor
    37 // -----------------------------------------------------------------------------
    37 // -----------------------------------------------------------------------------
    89     pos -= TPoint(KFullScreenButtonBuff, KFullScreenButtonBuff);
    89     pos -= TPoint(KFullScreenButtonBuff, KFullScreenButtonBuff);
    90     //pos -= m_webView->PositionRelativeToScreen();
    90     //pos -= m_webView->PositionRelativeToScreen();
    91     return pos;
    91     return pos;
    92 }
    92 }
    93 
    93 
       
    94 TSize WebPageFullScreenHandler::CalculateSize()
       
    95 {
       
    96     TSize size = m_buttonIcon.m_img->SizeInPixels();
       
    97     size += TSize(KFullScreenButtonBuff, KFullScreenButtonBuff);
       
    98     return size;
       
    99 }
       
   100 
    94 //-------------------------------------------------------------------------------
   101 //-------------------------------------------------------------------------------
    95 // WebPageFullScreenHandler::showEscBtnL
   102 // WebPageFullScreenHandler::showEscBtnL
    96 // Draws the full screen button on the screen
   103 // Draws the full screen button on the screen
    97 //-------------------------------------------------------------------------------
   104 //-------------------------------------------------------------------------------
    98 
   105 
   123 void WebPageFullScreenHandler::SizeChanged(void)
   130 void WebPageFullScreenHandler::SizeChanged(void)
   124 {
   131 {
   125     if (AknLayoutUtils::PenEnabled()) {
   132     if (AknLayoutUtils::PenEnabled()) {
   126         TPoint pos = CalculatePosition();
   133         TPoint pos = CalculatePosition();
   127         SetPos(pos);
   134         SetPos(pos);
       
   135         TSize size = CalculateSize();
       
   136         SetSizeWithoutNotification(size);
   128     }
   137     }
   129 }
   138 }
   130 
   139 
   131 //-------------------------------------------------------------------------------
   140 //-------------------------------------------------------------------------------
   132 // WebPageFullScreenHandler::fullScreenMode
   141 // WebPageFullScreenHandler::fullScreenMode
   148            break;
   157            break;
   149 
   158 
   150        case TPointerEvent::EButton1Up:
   159        case TPointerEvent::EButton1Up:
   151            {
   160            {
   152            	TPoint fsPostion = PositionRelativeToScreen();
   161            	TPoint fsPostion = PositionRelativeToScreen();
   153             TRect fsRect = TRect(fsPostion,m_buttonIcon.m_img->SizeInPixels());
   162             TRect fsRect = TRect(fsPostion,Size());
   154             fsRect = TRect(fsRect.iTl - TPoint(KFullScreenButtonOffset,KFullScreenButtonOffset), fsRect.iBr);
   163             fsRect = TRect(fsRect.iTl - TPoint(KFullScreenButtonOffset,KFullScreenButtonOffset), fsRect.iBr);
   155            	TPoint pointerPosition = fsPostion + aPointerEvent.iPosition;
   164            	TPoint pointerPosition = fsPostion + aPointerEvent.iPosition;
   156            	if( fsRect.Contains(pointerPosition))
   165            	if( fsRect.Contains(pointerPosition))
   157            	{
   166            	{
   158              if (m_isTouchDown) {
   167              if (m_isTouchDown) {