webengine/osswebengine/WebKit/s60/webview/WebView.cpp
branchRCL_3
changeset 37 ac77f89b1d9e
parent 36 c711bdda59f4
child 38 4917f9bf7995
equal deleted inserted replaced
36:c711bdda59f4 37:ac77f89b1d9e
    97 #include "WebPageFullScreenHandler.h"
    97 #include "WebPageFullScreenHandler.h"
    98 #include "eikon.hrh"
    98 #include "eikon.hrh"
    99 #include "WebScrollbarDrawer.h"
    99 #include "WebScrollbarDrawer.h"
   100 #include "EventNames.h"
   100 #include "EventNames.h"
   101 #include "Editor.h"
   101 #include "Editor.h"
       
   102 #include "ThumbnailGenerator.h"
   102 
   103 
   103 using namespace WebCore;
   104 using namespace WebCore;
   104 using namespace EventNames;
   105 using namespace EventNames;
   105 
   106 
   106 const int KRepaintDelayLoading = 500*1000; // dont do repaints more often than this during loading (0.5s)
   107 const int KRepaintDelayLoading = 500*1000; // dont do repaints more often than this during loading (0.5s)
   203 , m_firedEvent(0)
   204 , m_firedEvent(0)
   204 , m_waitTimer(0)
   205 , m_waitTimer(0)
   205 , m_pinchZoomHandler(NULL)
   206 , m_pinchZoomHandler(NULL)
   206 , m_isPinchZoom(false)
   207 , m_isPinchZoom(false)
   207 , m_drawsMissed(0)
   208 , m_drawsMissed(0)
       
   209 , m_scroll(false)
       
   210 , m_thumbnailGenerator(NULL)
   208 {
   211 {
   209 }
   212 }
   210 
   213 
   211 WebView::~WebView()
   214 WebView::~WebView()
   212 {
   215 {
   255     delete m_tabbedNavigation;
   258     delete m_tabbedNavigation;
   256     delete m_userAgent;
   259     delete m_userAgent;
   257     delete m_pageFullScreenHandler;
   260     delete m_pageFullScreenHandler;
   258     delete m_bridge;
   261     delete m_bridge;
   259     delete m_frameView;
   262     delete m_frameView;
       
   263     delete m_thumbnailGenerator;    
   260 }
   264 }
   261 
   265 
   262 // -----------------------------------------------------------------------------
   266 // -----------------------------------------------------------------------------
   263 // WebView::ConstructL
   267 // WebView::ConstructL
   264 // Private Class Method
   268 // Private Class Method
   336 
   340 
   337     if ( m_brctl->capabilities() & TBrCtlDefs::ECapabilityWebKitLite ) {
   341     if ( m_brctl->capabilities() & TBrCtlDefs::ECapabilityWebKitLite ) {
   338         m_pageScalerEnabled = false;
   342         m_pageScalerEnabled = false;
   339     }
   343     }
   340     else  {
   344     else  {
   341         initializePageScalerL();
   345         if(m_brctl->capabilities() & TBrCtlDefs::ECapabilityGraphicalPage)
   342         m_pageScalerEnabled = true;
   346             {
       
   347             initializePageScalerL();
       
   348             m_pageScalerEnabled = true;
       
   349             }
       
   350         else if(m_brctl->capabilities() & TBrCtlDefs::ECapabilityGraphicalHistory)
       
   351             {
       
   352             m_thumbnailGenerator = CThumbnailGenerator::NewL(*this);
       
   353             }        
   343     }
   354     }
   344     if (m_brctl->capabilities() & TBrCtlDefs::ECapabilityAutoFormFill) {
   355     if (m_brctl->capabilities() & TBrCtlDefs::ECapabilityAutoFormFill) {
   345         m_webFormFill = new WebFormFill(this);
   356         m_webFormFill = new WebFormFill(this);
   346     }
   357     }
   347     
   358     
   811     }
   822     }
   812     if ( m_pageScaler ) {
   823     if ( m_pageScaler ) {
   813         m_pageScaler->DocumentCompleted();
   824         m_pageScaler->DocumentCompleted();
   814         TRAP_IGNORE(m_pageScaler->DocumentChangedL());
   825         TRAP_IGNORE(m_pageScaler->DocumentChangedL());
   815     }
   826     }
       
   827     else if(m_thumbnailGenerator) {
       
   828         TRAP_IGNORE(m_thumbnailGenerator->CreatePageThumbnailL());    
       
   829     }    
   816 
   830 
   817     Node* focusedNode = NULL;
   831     Node* focusedNode = NULL;
   818     Frame* focusedFrame = page()->focusController()->focusedFrame();
   832     Frame* focusedFrame = page()->focusController()->focusedFrame();
   819 
   833 
   820     if (focusedFrame)
   834     if (focusedFrame)
  1728         Window().Invalidate( aRect );
  1742         Window().Invalidate( aRect );
  1729     }
  1743     }
  1730 
  1744 
  1731     if ( !aScroll && aFullScreen )
  1745     if ( !aScroll && aFullScreen )
  1732     {
  1746     {
  1733         // update the history with new bitmap
  1747     	  // update the history with new bitmap
  1734         CFbsBitmap* scaledPage = m_pageScaler->ScaledPage();
  1748         CFbsBitmap* scaledPage = NULL;
       
  1749         if(m_thumbnailGenerator)
       
  1750             {
       
  1751             scaledPage = m_thumbnailGenerator->PageThumbnail();
       
  1752             }
       
  1753         else if(m_pageScaler)
       
  1754             {
       
  1755             scaledPage = m_pageScaler->ScaledPage();
       
  1756             }
  1735         if (scaledPage) {
  1757         if (scaledPage) {
  1736             // Get the browser control rect
  1758             // Get the browser control rect
  1737             TRAP_IGNORE( m_brctl->historyHandler()->historyController()->updateHistoryEntryThumbnailL(scaledPage));
  1759             TRAP_IGNORE( m_brctl->historyHandler()->historyController()->updateHistoryEntryThumbnailL(scaledPage));
  1738 
  1760 
  1739             m_brctl->HandleBrowserLoadEventL( TBrCtlDefs::EEventThumbnailAvailable, 0, 0 );
  1761             m_brctl->HandleBrowserLoadEventL( TBrCtlDefs::EEventThumbnailAvailable, 0, 0 );
  2775     }
  2797     }
  2776 }
  2798 }
  2777 
  2799 
  2778 void WebView::Stop()
  2800 void WebView::Stop()
  2779 {
  2801 {
       
  2802 	  if (m_thumbnailGenerator)
       
  2803         {
       
  2804         //Create a thumbnail for page history
       
  2805         TRAP_IGNORE(m_thumbnailGenerator->CreatePageThumbnailL());
       
  2806         }
  2780     mainFrame()->stopLoading();
  2807     mainFrame()->stopLoading();
  2781 }
  2808 }
  2782 void WebView::synchRequestPending(bool flag)
  2809 void WebView::synchRequestPending(bool flag)
  2783 {
  2810 {
  2784     m_synchRequestPending = flag;
  2811     m_synchRequestPending = flag;
  2994 void WebView::setPinchBitmapZoomLevel(int zoomLevel)
  3021 void WebView::setPinchBitmapZoomLevel(int zoomLevel)
  2995 {
  3022 {
  2996     m_zoomLevelChangedByUser = true;
  3023     m_zoomLevelChangedByUser = true;
  2997     m_dirtyZoomMode = true;
  3024     m_dirtyZoomMode = true;
  2998     m_isPluginsVisible = false;
  3025     m_isPluginsVisible = false;
  2999     mainFrame()->makeVisiblePlugins(false);
       
  3000     m_isPinchZoom = true;
  3026     m_isPinchZoom = true;
  3001 
  3027 
  3002     if (zoomLevel > m_startZoomLevel) {
  3028     if (zoomLevel > m_startZoomLevel) {
  3003         setPinchBitmapZoomIn(zoomLevel);
  3029         setPinchBitmapZoomIn(zoomLevel);
  3004     }
  3030     }
  3110                }
  3136                }
  3111            }
  3137            }
  3112       }
  3138       }
  3113 }
  3139 }
  3114 
  3140 
       
  3141 
       
  3142 void WebView::setScrolling(bool scroll)
       
  3143 {
       
  3144     m_scroll = scroll;
       
  3145     mainFrame()->PlayPausePlugins(m_scroll);
       
  3146 }
       
  3147 
  3115 // END OF FILE
  3148 // END OF FILE