Fixed Nabi Issues
authorVinay Sachdeva <v.sachdeva@samsung.com>
Tue, 14 May 2013 18:53:10 +0000 (00:23 +0530)
committerVinay Sachdeva <v.sachdeva@samsung.com>
Tue, 14 May 2013 18:53:10 +0000 (00:23 +0530)
Change-Id: Iea598d95d25639efff824cf58b850d7e969e122e
Signed-off-by: Vinay Sachdeva <v.sachdeva@samsung.com>
13 files changed:
inc/IntBookmarkListForm.h
inc/IntHistoryListForm.h
inc/IntHistoryPresentationModel.h
inc/IntMainForm.h
inc/IntPresentationModelBase.h
res/screen-size-normal/IDL_FORM.xml
src/IntAddressbar.cpp
src/IntBookmarkListForm.cpp
src/IntHistoryListForm.cpp
src/IntHistoryPresentationModel.cpp
src/IntMainForm.cpp
src/IntNotificationPanel.cpp
src/IntPresentationModelBase.cpp

index c6a7964..be2b9fa 100644 (file)
@@ -103,6 +103,7 @@ class BookmarkListForm
        virtual void OnKeypadOpened(Tizen::Ui::Control& source);
        virtual void OnKeypadClosed(Tizen::Ui::Control& source);
        virtual void OnKeypadActionPerformed(Tizen::Ui::Control& source, Tizen::Ui::KeypadAction keypadAction);
+       virtual void OnKeypadBoundsChanged(Tizen::Ui::Control& source);
 
        //ISearchBarEventListener
        virtual void OnSearchBarModeChanged(Tizen::Ui::Controls::SearchBar& source, Tizen::Ui::Controls::SearchBarMode mode);
index dc607bf..987954d 100644 (file)
@@ -103,6 +103,7 @@ public:
        virtual void OnKeypadOpened(Tizen::Ui::Control& source);
        virtual void OnKeypadClosed(Tizen::Ui::Control& source);
        virtual void OnKeypadActionPerformed(Tizen::Ui::Control& source, Tizen::Ui::KeypadAction keypadAction);
+       virtual void OnKeypadBoundsChanged(Tizen::Ui::Control& source);
 
        //ISceneEventListener
        virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);
index 1027a98..f11d353 100644 (file)
@@ -208,6 +208,8 @@ public:
         */
        result GetUrlCount(const Tizen::Base::String& url, int& count);
 
+       void UpdateHistoryFavIcon(History& history, Tizen::Graphics::Bitmap& favIconImage);
+
 private:
 
        /**
index cf355f3..eeeb523 100644 (file)
@@ -287,7 +287,7 @@ private:
        result InitMostVisitedSitesView(Tizen::Ui::OrientationStatus orientationStatus);
        void MoveUiControls(void);
        void UpdateFavicon(void);
-       void RelayoutControls(bool showAddressbar);
+       void RelayoutControls(bool showAddressbar,bool relayoutFooter = true);
        void ShowFindWordPanel(bool show = true, bool isTouchPressed = false);
        void ShowMostVisitedSitesPanel(void);
        void StartWordSearch();
@@ -325,6 +325,7 @@ private:
        Tizen::Base::String __editTextUrl;
 
        Addressbar* __pAddressbar;
+       History* __pHistory;
        Tizen::Graphics::Point __contextMenuPosition;
        Tizen::Ui::Controls::Label* __pArticleReaderLabel;
        Tizen::Ui::Controls::Panel* __pArticleReaderPanel;
index d3e651f..4562ab1 100644 (file)
@@ -117,6 +117,8 @@ public:
 
         result ExecuteHistoryQuery(const Tizen::Base::String& pszFormatQuery, int& nRowCount, History& history);
 
+        result ExecuteUpdateHistoryFavIconQuery(const Tizen::Base::String& formatQuery, int& nRowCount, History& history);
+
         result GetColumn(int nIndex, Tizen::Base::String& strVal);
 
         result GetColumn(int nIndex, int& nIntVal);
index 4ee5914..e051efb 100644 (file)
@@ -18,7 +18,7 @@
     </Panel>
     <Panel id="IDC_FOOTER_PANEL" parent="IDL_FORM">
         <property backgroundColor="" backgroundColorOpacity="0" compositeEnabled="true" groupStyle="GROUP_STYLE_NONE"/>
-        <layout bottomRelation="IDL_FORM" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM" centerHorizontal="false" centerVertical="false" height="112.0" horizontalFitPolicy="FIT_POLICY_PARENT" leftRelation="" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="0.0" marginLeft="0.0" marginRight="0.0" marginTop="0.0" mode="Portrait" rightRelation="" rightRelationType="" topRelation="" topRelationType="" type="LAYOUT_RELATIVE" verticalFitPolicy="FIT_POLICY_FIXED" width="720.0" x="0" y="1108.0"/>
+        <layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="112.0" horizontalFitPolicy="FIT_POLICY_PARENT" leftRelation="" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="0.0" marginLeft="0.0" marginRight="0.0" marginTop="0.0" mode="Portrait" rightRelation="" rightRelationType="" topRelation="" topRelationType="" type="LAYOUT_RELATIVE" verticalFitPolicy="FIT_POLICY_FIXED" width="720.0" x="0" y="1108.0"/>
         <layout bottomRelation="" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM" centerHorizontal="false" centerVertical="false" height="105.0" horizontalFitPolicy="FIT_POLICY_PARENT" leftRelation="" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="0.0" marginLeft="0.0" marginRight="0.0" marginTop="0.0" mode="Landscape" rightRelation="" rightRelationType="" topRelation="" topRelationType="" type="LAYOUT_RELATIVE" verticalFitPolicy="FIT_POLICY_FIXED" width="1280.0" x="0" y="555.0"/>
     </Panel>
     <Label id="IDC_CHECK_LABEL" parent="IDC_FOOTER_PANEL">
index 158b86a..6bbac6a 100644 (file)
@@ -737,12 +737,23 @@ Addressbar::OnKeypadClosed(Tizen::Ui::Control& source)
 //     if(__isCancelledClicked == true)
        {
                if(__pAddressbarUrlField)
-                       __pAddressbarUrlField->SetText(__displayUrl);
+               {
+                       String removedHttpUrl = RemoveHttpTextFromDisplayURL();
+                       if (removedHttpUrl.IsEmpty() == false)
+                       {
+                               __pAddressbarUrlField->SetText(removedHttpUrl);
+                       }
+                       else
+                       {
+                               __pAddressbarUrlField->SetText(__displayUrl);
+                       }
+               }
+//                     __pAddressbarUrlField->SetText(__displayUrl);
                __editTextUrl = L"";
                SetShowState(false);
                if(__pListener != null)
                {
-                       __pListener->OnAddressBarKeypadClosed(*this);
+                       __pListener->OnAddressBarKeypadClosed(*this,false);
                }
        }
        __isCancelledClicked = false;
@@ -871,12 +882,23 @@ Addressbar::OnFocusLost(const Tizen::Ui::Control& source)
 {
        AppLog("Focus::Addressbar::OnFocusLost");
        if(__pAddressbarUrlField)
-               __pAddressbarUrlField->SetText(__displayUrl);
+       {
+               String removedHttpUrl = RemoveHttpTextFromDisplayURL();
+               if (removedHttpUrl.IsEmpty() == false)
+               {
+                       __pAddressbarUrlField->SetText(removedHttpUrl);
+               }
+               else
+               {
+                       __pAddressbarUrlField->SetText(__displayUrl);
+               }
+       }
+       //              __pAddressbarUrlField->SetText(__displayUrl);
        __editTextUrl = L"";
        SetShowState(false);
        if(__pListener != null)
        {
-               __pListener->OnAddressBarKeypadClosed(*this);
+               __pListener->OnAddressBarKeypadClosed(*this,false);
        }
 }
 
index 1d5e0a6..758f0e6 100644 (file)
@@ -227,7 +227,7 @@ BookmarkListForm::OnInitializing(void)
        if (__pPopUp != null)
        {
                __pPopUp->Initialize();
-               AddControl(*__pPopUp);
+               AddControl(__pPopUp);
        }
 
        __pSearchListView = new(std::nothrow) ListView();
@@ -1042,20 +1042,17 @@ BookmarkListForm::OnSearchBarModeChanged(Tizen::Ui::Controls::SearchBar& source,
 void
 BookmarkListForm::OnKeypadWillOpen(Tizen::Ui::Control& source)
 {
-//     GetFooter()->SetShowState(false);
-       __pSearchListView->SetBounds(__pSearchListView->GetX(), __pSearchListView->GetY(), __pSearchListView->GetWidth(), __pSearchListView->GetHeight() + GetFooter()->GetHeight());
+       GetFooter()->SetShowState(false);
+       __pSearchListView->SetBounds(__pSearchListView->GetX(), __pSearchListView->GetY(), GetClientAreaBounds().width, GetClientAreaBounds().height - __pSearchBar->GetHeight());
        __pSearchListView->SetEnabled(false);
        __pSearchBar->SetContentAreaSize(Dimension(__pSearchListView->GetWidth(), __pSearchListView->GetHeight()));
        Invalidate(true);
-       __pSearchListView->SetBounds(__pSearchListView->GetX(), __pSearchListView->GetY(), __pSearchListView->GetWidth(), __pSearchListView->GetHeight() - GetFooter()->GetHeight());
 }
 
 void
 BookmarkListForm::OnKeypadOpened(Tizen::Ui::Control& source)
 {
-       GetFooter()->SetShowState(false);
-//     __pSearchListView->SetBounds(__pSearchListView->GetX(), __pSearchListView->GetY(), __pSearchListView->GetWidth(), GetClientAreaBounds().height - __pSearchBar->GetHeight());
-       __pSearchListView->UpdateList();
+       __pSearchListView->SetBounds(__pSearchListView->GetX(), __pSearchListView->GetY(), __pSearchListView->GetWidth(), GetClientAreaBounds().height - __pSearchBar->GetHeight());
        Invalidate(true);
 }
 
@@ -1068,12 +1065,10 @@ BookmarkListForm::OnKeypadClosed(Tizen::Ui::Control& source)
                return;
        }
        GetFooter()->SetShowState(true);
-       GetFooter()->Invalidate(true);
        __pSearchListView->SetBounds(__pSearchListView->GetX(), __pSearchListView->GetY(), __pSearchListView->GetWidth(), GetClientAreaBounds().height - __pSearchBar->GetHeight());
-       __pListview->SetBounds(__pSearchListView->GetX(), __pSearchBar->GetY() + __pSearchBar->GetHeight(), __pSearchListView->GetWidth(), GetClientAreaBounds().height - __pSearchBar->GetHeight());
        __pSearchListView->Invalidate(false);
-       //__pSearchListView->SetEnabled(true);
        __pSearchBar->SetContentAreaSize(Dimension(__pSearchListView->GetWidth(), GetClientAreaBounds().height - __pSearchBar->GetHeight()));
+       __pListview->SetBounds(0, __pSearchBar->GetY() + __pSearchBar->GetHeight(), GetClientAreaBounds().width, GetClientAreaBounds().height - __pSearchBar->GetHeight());
        Invalidate(true);
 }
 
@@ -1082,6 +1077,10 @@ BookmarkListForm::OnKeypadActionPerformed(Tizen::Ui::Control& source, Tizen::Ui:
 {
        AppLog("BookmarkListForm::OnKeypadActionPerformed %d",keypadAction);
 
+       if (__pSearchBar != null)
+       {
+               __pSearchBar->HideKeypad();
+       }
        if ( __pSearchBar != null && keypadAction == KEYPAD_ACTION_SEARCH)
        {
                if (__pSearchBar->GetText().GetLength() == 0)
@@ -1108,6 +1107,19 @@ BookmarkListForm::OnKeypadActionPerformed(Tizen::Ui::Control& source, Tizen::Ui:
 }
 
 void
+BookmarkListForm::OnKeypadBoundsChanged(Tizen::Ui::Control& source)
+{
+       FloatRectangle clientRect;
+       clientRect = GetClientAreaBoundsF();
+       AppLogDebug("SearchBarForm::OnKeypadBoundsChanged ClientBounds(%f, %f, %f, %f)",clientRect.x, clientRect.y, clientRect.width, clientRect.height);
+       __pSearchBar->SetContentAreaSize(FloatDimension(clientRect.width, clientRect.height - __pSearchBar->GetHeightF()));
+       __pSearchListView->SetSize(FloatDimension(clientRect.width, clientRect.height - __pSearchBar->GetHeightF()));
+       __pListview->SetSize(FloatDimension(clientRect.width, clientRect.height - __pSearchBar->GetHeightF()));
+//     __pListview->SetEnabled(false);
+       Invalidate(true);
+}
+
+void
 BookmarkListForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
 {
        AppLogDebug("BookmarkListForm::OnSceneActivatedN called");
index 3113aff..fc92f05 100644 (file)
@@ -38,6 +38,7 @@ using namespace Tizen::Base::Collection;
 using namespace Tizen::Base::Runtime;
 using namespace Tizen::Graphics;
 using namespace Tizen::Locales;
+using namespace Tizen::Media;
 using namespace Tizen::Ui;
 using namespace Tizen::Ui::Controls;
 using namespace Tizen::Ui::Scenes;
@@ -494,6 +495,10 @@ HistoryListForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
        int bookmarkBtnWidth = 0;
        String bitmapId;
 
+       Image* pImage = null;
+       pImage = new Image();
+       pImage->Construct();
+
        if(__pGroupData == null)
        {
                delete pItem;
@@ -528,9 +533,26 @@ HistoryListForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
                return null;
        }
 
-       bitmapId = pHistory->GetFaviconId() ;
+       ByteBuffer* pFavIconBuffer = null;
+       pFavIconBuffer = pHistory->GetFavIconBuffer();
+
+       AppLog("BookmarkListForm::CreateItem check 0");
+
+       if (pFavIconBuffer != null)
+       {
+               AppLog("BookmarkListForm::CreateItem pFavIconBuffer is not null");
+       }
+       else
+       {
+               AppLog("BookmarkListForm::CreateItem pFavIconBuffer is null");
+       }
+
+       pBitmap = pImage->DecodeN(*pFavIconBuffer, IMG_FORMAT_PNG, BITMAP_PIXEL_FORMAT_ARGB8888);
+
+       AppLog("BookmarkListForm::CreateItem check 1");
 
-       pBitmap = pHistory->GetFavIconBitmap();
+       //bitmapId = pHistory->GetFaviconId() ;
+       //pBitmap = pHistory->GetFavIconBitmap();
 
        if (pBitmap == null)
        {
@@ -586,6 +608,7 @@ HistoryListForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
                TryCatch(!IsFailed(r), "CreateItem failed with %s",GetErrorMessage(r));
                delete pBookmarkBitmap;
        }
+       delete pImage;
        return pItem;
 
        CATCH:
@@ -877,15 +900,16 @@ HistoryListForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, in
                {
                        // Add the history in bookmark database
                        result r = E_FAILURE;
-                       BookmarkData pBookmark;
+                       BookmarkData bookmark;
 
                        String bookmarkTitle = pHistory->GetHistoryTitle();
 
-                       pBookmark.SetBookmarkTitle(bookmarkTitle);
-                       pBookmark.SetUrl(pHistory->GetHistoryUrl());
-                       pBookmark.SetFaviconId(pHistory->GetFaviconId());
-
-                       r = BookmarkPresentationModel::GetInstance()->SaveBookmark(pBookmark);
+                       bookmark.SetBookmarkTitle(bookmarkTitle);
+                       bookmark.SetUrl(pHistory->GetHistoryUrl());
+                       bookmark.SetFaviconId(pHistory->GetFaviconId());
+                       bookmark.SetFavIconBuffer(*pHistory->GetFavIconBuffer());
+                       //r = BookmarkPresentationModel::GetInstance()->SaveBookmark(pBookmark);
+                       r = BookmarkPresentationModel::GetInstance()->SaveTempBookmark(bookmark);
                }
                else
                {
@@ -1136,6 +1160,19 @@ HistoryListForm::OnKeypadActionPerformed(Control &source, KeypadAction keypadAct
 }
 
 void
+HistoryListForm::OnKeypadBoundsChanged(Tizen::Ui::Control& source)
+{
+       FloatRectangle clientRect;
+       clientRect = GetClientAreaBoundsF();
+       AppLogDebug("SearchBarForm::OnKeypadBoundsChanged ClientBounds(%f, %f, %f, %f)",clientRect.x, clientRect.y, clientRect.width, clientRect.height);
+       __pSearchBar->SetContentAreaSize(FloatDimension(clientRect.width, clientRect.height - __pSearchBar->GetHeightF()));
+       __pSearchListView->SetSize(FloatDimension(clientRect.width, clientRect.height - __pSearchBar->GetHeightF()));
+       __pGroupedListView->SetSize(FloatDimension(clientRect.width, clientRect.height - __pSearchBar->GetHeightF()));
+//     __pGroupedListView->SetEnabled(false);
+       Invalidate(true);
+}
+
+void
 HistoryListForm::OnOrientationChanged(const Control& source, OrientationStatus orientationStatus)
 {
        result r = E_FAILURE;
@@ -1197,7 +1234,10 @@ HistoryListForm::OnKeypadOpened(Control& source)
 void
 HistoryListForm::OnKeypadClosed(Control& source)
 {
-       
+       if(Clipboard::GetInstance()->IsPopupVisible() == true)
+       {
+               return;
+       }
        GetFooter()->SetShowState(true);
        __pSearchListView->SetBounds(__pSearchListView->GetX(), __pSearchListView->GetY(), __pSearchListView->GetWidth(), GetClientAreaBounds().height - __pSearchBar->GetHeight());
        __pSearchListView->Invalidate(false);
index 96d1fdb..732d930 100644 (file)
@@ -321,6 +321,53 @@ HistoryPresentationModel::SaveHistory(History& history)
        CATCH: return r;
 }
 
+void HistoryPresentationModel::UpdateHistoryFavIcon(History& history, Tizen::Graphics::Bitmap& favIconImage)
+{
+       result r = E_FAILURE;
+       String historyTable(HISTORY_DATA_TABLE);
+       String query;
+       String columnNames;
+       int resultCount = -1;
+
+       Image* pImage = null;
+       pImage = new Image();
+       pImage->Construct();
+
+       int __favIconWidth = favIconImage.GetWidth();
+       int __favIconHeight = favIconImage.GetHeight();
+
+       Tizen::Base::ByteBuffer* pFavBuffer = pImage->EncodeToBufferN(favIconImage, IMG_FORMAT_PNG);
+
+       history.SetFavIconBuffer(*pFavBuffer);
+
+       delete pImage;
+
+       query.Append(L"UPDATE ");
+       query.Append(historyTable);
+       query.Append(" SET FAVICON = ");
+       query.Append("?");
+       query.Append(", FAVICON_W = ");
+       query.Append("?");
+       query.Append(", FAVICON_H = ");
+       query.Append("?");
+       query.Append(" WHERE ID = ");
+       query.Append("?");
+
+       AppLog("query is %ls", query.GetPointer());
+
+       r = PresentationModelBase::ExecuteUpdateHistoryFavIconQuery(query, resultCount, history);
+       if (r == E_SUCCESS)
+       {
+               AppLog("HistoryPresentationModel::SaveHistory result is success");
+       }
+       else
+       {
+               AppLog("HistoryPresentationModel::SaveHistory result is failure");
+       }
+       r = PresentationModelBase::CommitDb();
+
+}
+
 result
 HistoryPresentationModel::SaveTempHistory(History& history)
 {
index ad12dd8..6426ba5 100644 (file)
@@ -137,6 +137,7 @@ static const int HEIGHT_CONTEXT_MENU_BUTTON = 72;
 MainForm::MainForm(void)
 {
        __isLongPressedDone = false;
+       __pHistory = null;
        __pAddressbar = null;
        //      __pMostVisitedSitesPanel = null;
        __pMostVisitedListView = null;
@@ -205,6 +206,13 @@ MainForm::~MainForm(void)
        {
                __pAddressbar->SetAddressbarEventListener(null);
        }
+
+       if(__pHistory != null)
+       {
+               delete __pHistory;
+               __pHistory = null;
+       }
+
        if (__pReaderData != null)
        {
                delete __pReaderData;
@@ -330,7 +338,7 @@ MainForm::InitAddressbar(void)
                return r;
        }
        __pAddressbar->SetAddressbarEventListener(this);
-       AddControl(*__pAddressbar);
+       AddControl(__pAddressbar);
        __pAddressbar->SetBounds(Rectangle(0,0,GetClientAreaBounds().width,__pAddressbar->GetHeight()));
        SetControlAlwaysOnTop(*__pAddressbar, true);
        __adressPanelPosition = __pAddressbar->GetPosition();
@@ -377,15 +385,15 @@ MainForm::CreateReaderPanel(void)
        __pArticleReaderLabel = new Label();
        __pArticleReaderLabel->Construct(Rectangle(__pArticleReaderPanel->GetX(),__pArticleReaderPanel->GetY(),__pArticleReaderPanel->GetWidth(),__pArticleReaderPanel->GetHeight()),L"");
 
-       __pBlankPanel->AddControl(*__pArticleReaderLabel);
-       __pBlankPanel->AddControl(*__pArticleReaderPanel);
-       AddControl(*__pBlankPanel);
+       __pBlankPanel->AddControl(__pArticleReaderLabel);
+       __pBlankPanel->AddControl(__pArticleReaderPanel);
+       AddControl(__pBlankPanel);
 
        __pBlankPanel->SetBounds(0,0,GetClientAreaBounds().width,GetClientAreaBounds().height);
        __pArticleReaderPanel->SetBounds((GetClientAreaBounds().width - __pArticleReaderPanel->GetWidth())/2,(GetClientAreaBounds().height - __pArticleReaderPanel->GetHeight())/2, __pArticleReaderPanel->GetWidth(), __pArticleReaderPanel->GetHeight());
        __pArticleReaderLabel->SetBounds(__pArticleReaderPanel->GetX(),__pArticleReaderPanel->GetY(),__pArticleReaderPanel->GetWidth(),__pArticleReaderPanel->GetHeight());
 
-       __pArticleReaderPanel->AddControl(*__pWebReader);
+       __pArticleReaderPanel->AddControl(__pWebReader);
        __pWebReader->SetBounds(Rectangle(2,2, __pArticleReaderPanel->GetWidth()-2,__pArticleReaderPanel->GetHeight() - 96 -2));
        Bitmap* pBitmap = CommonUtil::GetNinepatchedBitmapN(L"I01_popup_bg.9.png",__pArticleReaderPanel->GetWidth(),__pArticleReaderPanel->GetHeight());
        Bitmap* pSrcBitmap = CommonUtil::GetNinepatchedBitmapN(L"I01_popup_bottom_bg.9.png",__pArticleReaderPanel->GetWidth(),__pArticleReaderPanel->GetHeight());
@@ -467,7 +475,7 @@ MainForm::InitWebControl()
        }
        else
        {
-               r = AddControl(*__pWebViewer);
+               r = AddControl(__pWebViewer);
 
                if (IsFailed(r))
                {
@@ -941,7 +949,7 @@ MainForm::InitFindWordPanel(void)
                AppLogException("There is some problem in the xml file. Please check.");
                return E_FAILURE;
        }
-       AddControl(*__pFindWordControl);
+       AddControl(__pFindWordControl);
        __pFindWordControl->SetBounds(0,0, __pFindWordControl->GetWidth(), __pFindWordControl->GetHeight());
        SetControlAlwaysOnTop(*__pFindWordControl,true);
        __pFindWordControl->SetShowState(false);
@@ -1811,7 +1819,7 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                {
                        //__pArticleReaderPanel->SetShowState(false);
                        //__pArticleReaderPanel->Show();
-                       RemoveControl(*__pBlankPanel);
+                       RemoveControl(__pBlankPanel);
                        //RemoveControl(*__pArticleReaderPanel);
                        __pArticleReaderPanel = null;
                        __pBlankPanel = null;
@@ -2345,6 +2353,8 @@ MainForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
        InitFooter();
        InitAddressbar();
 
+       __pFooterPanel->SetBounds(0, GetClientAreaBounds().height - __pFooterPanel->GetHeight(), GetClientAreaBounds().width, __pFooterPanel->GetHeight());
+
        // hiding the address bar
        //      __pAddressbar->SetBounds(__pAddressbar->GetX(), __pAddressbar->GetY() - __pAddressbar->GetHeight(), __pAddressbar->GetWidth(), __pAddressbar->GetHeight());
        __pAddressbar->SetShowState(false);
@@ -2377,6 +2387,13 @@ MainForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
        {
                InitMostVisitedSitesView(GetOrientationStatus());
        }
+       else if (homePage.CompareTo((L"IDS_BR_BODY_BLANK_PAGE")) == 0)
+       {
+               if(__pMostVisitedListView != null)
+               {
+                       __pMostVisitedListView->SetShowState(false);
+               }
+       }
 
        if (__pAddressbar != null && pArgs != null && (previousSceneId == IDSCN_BOOKMARK_VIEW || previousSceneId == IDSCN_HISTORY_LIST))
        {
@@ -2693,22 +2710,23 @@ MainForm::OnLoadingCompleted(void)
        bool isPrivateBrowsing = SettingPresentationModel::GetInstance()->GetPrivateOn();
        if (isPrivateBrowsing == false)
        {
-               History* pHistory = new(std::nothrow) History;
+               if(__pHistory != null)
+               {
+                       delete __pHistory;
+                       __pHistory = null;
+               }
 
+               __pHistory = new(std::nothrow) History;
                HistoryPresentationModel::GetCurrentDateTime(date);
-               if(__pWindowInfo)
+               if (__pWindowInfo)
                {
-                       pHistory->SetHistoryTitle(__pWindowInfo->pageTitle);
+                       __pHistory->SetHistoryTitle(__pWindowInfo->pageTitle);
                        AppLogDebug("MainForm::OnLoadingCompleted pagetitle = %ls", __pWindowInfo->pageTitle.GetPointer());
 
-                       pHistory->SetHistoryUrl(__pWindowInfo->pageUrl);
+                       __pHistory->SetHistoryUrl(__pWindowInfo->pageUrl);
                        AppLogDebug("MainForm::OnLoadingCompleted pageUrl = %ls", __pWindowInfo->pageUrl.GetPointer());
                }
-               pHistory->SetVisitedTime(date);
-               /*String id = "";
-               if(__pWindowInfo)
-                       id = FaviconManager::GetInstance()->SaveFavicon(*__pWindowInfo->pFavicon, __pWindowInfo->faviconUrl);
-               pHistory->SetFaviconId(id);*/
+               __pHistory->SetVisitedTime(date);
 
                if (__pWebViewer != null)
                {
@@ -2718,7 +2736,7 @@ MainForm::OnLoadingCompleted(void)
                        if (pTempBitmap != null)
                        {
                                AppLog("MainForm::OnLoadingCompleted setting the fav icon 1");
-                               pHistory->SetFavIconBitmap(*pTempBitmap);
+                               __pHistory->SetFavIconBitmap(*pTempBitmap);
                        }
 
                        AppLog("MainForm::OnLoadingCompleted setting the fav icon 2");
@@ -2730,17 +2748,17 @@ MainForm::OnLoadingCompleted(void)
                {
                        pBitmap->Construct(*pCanvas, pCanvas->GetBounds());
                        pBitmap->Scale(Dimension(pBitmap->GetWidth()/4, pBitmap->GetHeight()/4));
-                       pHistory->SetThumbnail(pBitmap);
+                       __pHistory->SetThumbnail(pBitmap);
                }
                Bitmap *pFavIcon = __pWebViewer->GetFaviconN();
-               if(pFavIcon)
+               if (pFavIcon)
                {
-                       pHistory->SetFavIconBitmap(*pFavIcon);
+                       __pHistory->SetFavIconBitmap(*pFavIcon);
                        delete pFavIcon;
                }
 
-               HistoryPresentationModel::GetInstance()->SaveTempHistory(*pHistory);
-               delete pHistory;
+               HistoryPresentationModel::GetInstance()->SaveTempHistory(*__pHistory);
+               //delete pHistory;
        }
        else
        {
@@ -2768,12 +2786,11 @@ MainForm::OnEstimatedProgress(int progress)
 void MainForm::OnFaviconReceived(const Tizen::Graphics::Bitmap& favicon)
 {
        AppLog("MainForm::OnFaviconReceived");
-       Bitmap* pFavIconBitmap = __pWebViewer->GetFaviconN();
-
-       if (pFavIconBitmap != null)
+       if (__pWebViewer != null && __pHistory != null)
        {
-               pFavIconBitmap->GetWidth();
-               pFavIconBitmap->GetHeight();
+               Bitmap* pFavIconBitmap = __pWebViewer->GetFaviconN();
+
+               HistoryPresentationModel::GetInstance()->UpdateHistoryFavIcon(*__pHistory, *(__pWebViewer->GetFaviconN()));
        }
 }
 
@@ -3115,7 +3132,7 @@ MainForm::OnAddressCancelledClicked(const Addressbar& addBar)
 
        __pAddressbar->SetShowState(false);
 
-       RelayoutControls(false);
+       RelayoutControls(false,false);
 
 }
 
@@ -3174,7 +3191,7 @@ MainForm::OnAddressBarKeypadClosed(const Addressbar& addBar, bool footerState)
        {
                __pFooterUrlField->SetFocusable(true);
        }
-       RelayoutControls(false);
+       RelayoutControls(false,footerState);
 }
 
 void
@@ -3492,7 +3509,7 @@ MainForm::OnWebWindowCreateRequested(void)
 }
 
 void
-MainForm::RelayoutControls(bool showAddressbar)
+MainForm::RelayoutControls(bool showAddressbar,bool relayoutFooter)
 {
        __webControlPosition.y = 0;
        __webControlHeight = GetClientAreaBounds().height;
@@ -3512,9 +3529,10 @@ MainForm::RelayoutControls(bool showAddressbar)
                __pFindWordControl->SetBounds(0, 0, GetClientAreaBounds().width, __pFindWordControl->GetHeight());
        }
 
-       if(__pFooterPanel != null && __pFooterPanel->GetShowState() == true)
+       if(__pFooterPanel != null && __pFooterPanel->GetShowState() == true && relayoutFooter == true)
        {
                __webControlHeight -= __pFooterPanel->GetHeight();
+
                __pFooterPanel->SetBounds(0, __webControlPosition.y + __webControlHeight, GetClientAreaBounds().width, __pFooterPanel->GetHeight());
        }
        if (__pWebViewer != null && __pWebViewer->GetShowState() == true)
@@ -4437,7 +4455,7 @@ MainForm::InitMostVisitedSitesView(Tizen::Ui::OrientationStatus orientationStatu
 
        if (__pMostVisitedListView != null)
        {
-               RemoveControl(*__pMostVisitedListView);
+               RemoveControl(__pMostVisitedListView);
        }
        if(__pMostVisitedSites != null)
        {
@@ -4471,7 +4489,7 @@ MainForm::InitMostVisitedSitesView(Tizen::Ui::OrientationStatus orientationStatu
        __pMostVisitedListView->SetItemProvider(*this);
        __pMostVisitedListView->AddListViewItemEventListener(*this);
        __pMostVisitedListView->SetTextOfEmptyList(CommonUtil::GetString(L"IDS_BR_BODY_NO_RECENTLY_VISITED_SITES"));
-       AddControl(*__pMostVisitedListView);
+       AddControl(__pMostVisitedListView);
        __pMostVisitedListView->UpdateList();
 
        return E_SUCCESS;
index da1ce28..a479bfb 100644 (file)
@@ -81,10 +81,10 @@ NotificationPanel::ShowNotification(void)
        SceneManager* pSceneManager = null;
        if ( __pLabel != NULL)
        {
-               AddControl(*__pLabel);
+               AddControl(__pLabel);
                __pLabel->SetBackgroundColor(CUSTOM_COLOR_INFO_LABEL);
        }
-       __form.AddControl(*this);
+       __form.AddControl(this);
 
        SceneId sceneId = pSceneManager->GetInstance()->GetCurrentSceneId();
 
index 4ea43ee..b727c24 100644 (file)
@@ -615,6 +615,68 @@ PresentationModelBase::ExecuteHistoryQuery(const Tizen::Base::String& formatQuer
        return r;
 }
 
+result PresentationModelBase::ExecuteUpdateHistoryFavIconQuery(const Tizen::Base::String& formatQuery, int& nRowCount, History& history)
+{
+       result r = E_FAILURE;
+       String queryType;
+       int historyID;
+       r = Integer::Parse(history.GetHistoryId(), historyID);
+
+       if (__pDataBase == null)
+       {
+               return E_INIT_FAILED;
+       }
+
+       if (__pDbEnum != null)
+       {
+               delete __pDbEnum;
+               __pDbEnum = null;
+       }
+
+       if (__pDbStatement != null)
+       {
+               delete __pDbStatement;
+               __pDbStatement = null;
+       }
+       r = formatQuery.SubString(0, QUERY_TYPE_LENGTH, queryType);
+
+       if (__isBeginTransaction == false )
+       {
+               r = __pDataBase->BeginTransaction();
+               if (IsFailed(r))
+               {
+                       AppLogException("Failed Database::BeginTransaction() . (error: %s)", GetErrorMessage(r));
+                       return r;
+               }
+
+               __isBeginTransaction = true;
+               __pDbStatement = __pDataBase->CreateStatementN(formatQuery);
+               if(GetLastResult() != E_SUCCESS)
+               {
+                       AppLog("CreateStatementN error: %s", GetErrorMessage(GetLastResult()));
+                       return GetLastResult();
+               }
+               __pDbStatement->BindBlob(0,*(history.GetFavIconBuffer()));
+               __pDbStatement->BindInt(1,history.GetFavIconWidth());
+               __pDbStatement->BindInt(2,history.GetFavIconHeight());
+               __pDbStatement->BindInt(3,historyID);
+
+               __pDataBase->ExecuteStatementN(*__pDbStatement);
+
+               if (IsFailed(GetLastResult()))
+               {
+                       AppLog("PresentationModelBase::ExecuteBookmarkQuery Failed Database::ExecuteSql(). (error: %s, query: %ls)", GetErrorMessage(r), formatQuery.GetPointer());
+                       return r;
+               }
+               else
+               {
+                       AppLog("PresentationModelBase::ExecuteBookmarkQuery success database");
+               }
+       }
+
+               return r;
+}
+
 result
 PresentationModelBase::DbIsNextRowPresent(bool& nextRowpresent)
 {