webengine/webkitutils/HistoryProvider/HistoryController.cpp
branchRCL_3
changeset 93 79859ed3eea9
parent 64 ac77f89b1d9e
child 94 919f36ff910f
equal deleted inserted replaced
92:e1bea15f9a39 93:79859ed3eea9
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 // INCLUDE FILES
    19 // INCLUDE FILES
    20 #include <../bidi.h>
    20 #include <../bidi.h>
    21 #include <brctldialogsprovider.h>
       
    22 
       
    23 #include "HistoryController.h"
    21 #include "HistoryController.h"
    24 #include <brctldefs.h>
    22 #include "BrCtlDefs.h"
    25 #include "HistoryView.h"
    23 #include "HistoryView.h"
    26 #include "HistoryEntry.h"
    24 #include "HistoryEntry.h"
       
    25 #include "BrCtlDialogsProvider.h"
    27 
    26 
    28 // EXTERNAL DATA STRUCTURES
    27 // EXTERNAL DATA STRUCTURES
    29 
    28 
    30 // EXTERNAL FUNCTION PROTOTYPES
    29 // EXTERNAL FUNCTION PROTOTYPES
    31 
    30 
   150         }
   149         }
   151     }
   150     }
   152     CleanupStack::PushL( pageInfo );
   151     CleanupStack::PushL( pageInfo );
   153     return pageInfo;
   152     return pageInfo;
   154 }
   153 }
   155 void HistoryController::rollBackIndex()
   154 
   156     {
       
   157     m_currentIndex = m_tempCurrentIndex;
       
   158     }
       
   159 /**
   155 /**
   160 */
   156 */
   161 void HistoryController::handleHistoryCommandL(int command)
   157 void HistoryController::handleHistoryCommandL(int command)
   162 {
   158 {
   163     m_tempCurrentIndex = m_currentIndex;
   159     m_tempCurrentIndex = m_currentIndex;
   170         break;
   166         break;
   171         }
   167         }
   172     case TBrCtlDefs::ECommandBack:
   168     case TBrCtlDefs::ECommandBack:
   173         {
   169         {
   174         if (m_historyViewEnabled && m_backListAllowed) {
   170         if (m_historyViewEnabled && m_backListAllowed) {
   175             showHistoryViewL(false);
   171             showHistoryViewL(true);
   176         }
   172         }
   177         else {
   173         else {
   178             loadHistoryUrl( EHistoryStackDirectionPrevious, TBrCtlDefs::ECacheModeHistory, -1);
   174             loadHistoryUrl( EHistoryStackDirectionPrevious, TBrCtlDefs::ECacheModeHistory, -1);
   179         }
   175         }
   180         break;
   176         break;
   256 {
   252 {
   257     if(m_historyViewEnabled) {
   253     if(m_historyViewEnabled) {
   258         HistoryEntry* entry = entryByIndex(m_currentIndex);
   254         HistoryEntry* entry = entryByIndex(m_currentIndex);
   259         if (entry) {
   255         if (entry) {
   260             TSize bmsize = bitmap->SizeInPixels();
   256             TSize bmsize = bitmap->SizeInPixels();
   261 #ifdef BRDO_MULTITOUCH_ENABLED_FF            
       
   262             entry->storeThumbnail(bitmap, TRect(0,0,bmsize.iWidth, bmsize.iHeight));
       
   263 #else
       
   264             TRect parentControlRect = m_historyCallback->parent()->Rect();
   257             TRect parentControlRect = m_historyCallback->parent()->Rect();
   265             int historyViewWidth = parentControlRect.Width();
   258             int historyViewWidth = parentControlRect.Width();
   266             int historyViewHeight( parentControlRect.Height());
   259             int historyViewHeight( parentControlRect.Height());
   267             // Find out that in either portrait or landscape view what is the max height
   260             // Find out that in either portrait or landscape view what is the max height
   268             int maxDimension = (historyViewWidth > historyViewHeight)? historyViewWidth:historyViewHeight;
   261             int maxDimension = (historyViewWidth > historyViewHeight)? historyViewWidth:historyViewHeight;
   269             int thumbnailHeight = Min(bmsize.iHeight, maxDimension*KCenterThumbnailHeightPercent/100);
   262             int thumbnailHeight = Min(bmsize.iHeight, maxDimension*KCenterThumbnailHeightPercent/100);
   270             int thumbnailWidth = Min(bmsize.iWidth, maxDimension*KCenterThumbnailWidthPercent/100);
   263             int thumbnailWidth = Min(bmsize.iWidth, maxDimension*KCenterThumbnailWidthPercent/100);
   271             entry->storeThumbnail(bitmap, TRect(0,0,thumbnailWidth, thumbnailHeight));            
   264             entry->storeThumbnail(bitmap, TRect(0,0,thumbnailWidth, thumbnailHeight));
   272 #endif
       
   273         }
   265         }
   274     }
   266     }
   275 }
   267 }
   276 
   268 
   277 /**
   269 /**
   523 void HistoryController::showHistoryListL()
   515 void HistoryController::showHistoryListL()
   524 {
   516 {
   525     SelectArray* historyList = new( ELeave ) CArrayFixFlat<TBrCtlSelectOptionData>(10);
   517     SelectArray* historyList = new( ELeave ) CArrayFixFlat<TBrCtlSelectOptionData>(10);
   526     CleanupStack::PushL( historyList );
   518     CleanupStack::PushL( historyList );
   527     for( int i = m_historyStack.Count() - 1; i >= 0; i-- ) {
   519     for( int i = m_historyStack.Count() - 1; i >= 0; i-- ) {
   528     if(entryByIndex(i))
   520         TBrCtlSelectOptionData t( TBrCtlSelectOptionData(entryByIndex(i)->pageTitle(), i == m_currentIndex, false, false) );
   529     {
   521         historyList->AppendL(t);
   530       TBrCtlSelectOptionData t( TBrCtlSelectOptionData(entryByIndex(i)->pageTitle(), i == m_currentIndex, false, false) );
       
   531       historyList->AppendL(t);
       
   532      }
       
   533     }
   522     }
   534     // Display history dialog
   523     // Display history dialog
   535     bool ret = m_historyCallback->dialogSelectOption(historyList);
   524     bool ret = m_historyCallback->dialogSelectOption(historyList);
   536     if (ret) {
   525     if (ret) {
   537         int index = 0;
   526         int index = 0;