+
+void MainForm::OnSharePopupControlStarted(void)
+{
+ __pWebViewer->AddTouchEventListener(*this);
+}
+
+void
+MainForm::OnUserEventReceivedN (RequestId requestId, Tizen::Base::Collection::IList *pArgs)
+{
+ if (requestId == UPDATE_MAINFORM_FOOTER_ON_WINDOWCLOSED)
+ {
+ AppLog("OnWebWindowCloseRequested mainform test 1 OnUserEventReceivedN");
+ InitFooter();
+ }
+ else if (requestId == BACK_GROUND_APP_EVENT)
+ {
+ if(__pWebViewer != null)
+ {
+ __pWebViewer->Pause();
+ }
+ if(__pImageMenu)
+ {
+ __pImageMenu->SetShowState(false);
+ }
+ if(__pAddressbar != null)
+ {
+ __pAddressbar->SendUserEvent(BACK_GROUND_APP_EVENT,NULL);
+ }
+ }
+ else if(requestId == FORE_GROUND_APP_EVENT)
+ {
+ if(__pWebViewer != null)
+ {
+ __pWebViewer->Resume();
+ }
+ if(__pAddressbar != null)
+ {
+ __pAddressbar->SendUserEvent(FORE_GROUND_APP_EVENT,NULL);
+ }
+ }
+}
+
+void
+MainForm::AddressBarCancelledClicked(const Addressbar& addBar)
+{
+ AppLog("XYZ::MainForm::AddressBarCancelledClicked");
+ result r = E_SUCCESS;
+
+ if (__pAddressbar)
+ __pAddressbar->SetShowState(false);
+
+ AppLog("akjshdasd 5");
+ __pFooterPanel->SetShowState(true);
+
+ if(__pWebViewer)
+ __pWebViewer->SetFocus();
+ else if(__pMostVisitedListView)
+ __pMostVisitedListView->SetFocus();
+ else if(__pMultiWindowButton)
+ __pMultiWindowButton->SetFocus();
+ else if(__pMoreButton)
+ __pMoreButton->SetFocus();
+
+ __pAddressbar->SetShowState(false);
+
+ RelayoutControls(false);
+}
+
+void
+MainForm::OnFormMenuRequested (Tizen::Ui::Controls::Form &source)
+{
+ AppLog("MainForm::OnFormMenuRequested called");
+ InitOptionMenu();
+ if (__pWindowInfo != NULL && __pWindowInfo->pageUrl != NULL && __pWebViewer && __pWebViewer->GetShowState() == true)
+ {
+ int bookmarkCount=0;
+ bool exist = false;
+ String url=L"";
+ url=__pWindowInfo->pageUrl;
+ AppLog("MainForm::OnFormMenuRequested url %ls",url.GetPointer());
+ result r = E_SUCCESS;
+ Bitmap* pBitmap = null;
+ String lastChar = L"";
+// if(url.SubString(url.GetLength()-1,lastChar));
+// if(lastChar == L"/")
+// {
+// bool exist1 = false;
+// bool exist2 = false;
+// r=BookmarkPresentationModel::GetInstance()->DoesBookmarkExist(url,exist1);
+// url.SubString(0,url.GetLength() - 1,url);
+// r=BookmarkPresentationModel::GetInstance()->DoesBookmarkExist(url,exist2);
+// exist = exist1 | exist2;
+// }
+// else
+// {
+ r=BookmarkPresentationModel::GetInstance()->DoesBookmarkExist(url,exist);
+ if (IsFailed(r))
+ {
+ AppLogDebug("ONACTION_PERFORMED:IDA_MOREBTN_CLICKED failed");
+ return;
+ }
+// }
+ if ( exist == true)
+ {
+ pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_ICON_BOOKMARK_ON_TEMP);
+ }
+ else
+ {
+ pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_ICON_BOOKMARK_OFF_TEMP);
+ }
+ AppLogDebug("ONACTION_PERFORMED:IDA_MOREBTN_CLICKED 3");
+
+ if (__pOptionMenu->GetItemCount() == 9)
+ {
+ r = __pOptionMenu->SetItemAt(1,CommonUtil::GetString(L"IDS_BR_OPT_ADDTOBOOKMARKS"), IDA_ADDTOBOOKMARK_CLICKED,*pBitmap);
+ }
+ else
+ {
+ r = __pOptionMenu->InsertItemAt(1,CommonUtil::GetString(L"IDS_BR_OPT_ADDTOBOOKMARKS"), IDA_ADDTOBOOKMARK_CLICKED,*pBitmap);
+ }
+
+ if (IsFailed(r))
+ {
+ AppLogException("ONACTION_PERFORMED:IDA_MOREBTN_CLICKED Add to Bookmark failed with %s", GetErrorMessage(r));
+ delete pBitmap;
+ return ;
+ }
+ AppLogDebug("ONACTION_PERFORMED:IDA_MOREBTN_CLICKED 4");
+ if (__pOptionMenu->GetItemCount() != 9)
+ {
+ __pOptionMenu->InsertItemAt(1,CommonUtil::GetString(L"IDS_BR_OPT_ADDTOBOOKMARKS"), IDA_ADDTOBOOKMARK_CLICKED);
+ __pOptionMenu->InsertItemAt(2,CommonUtil::GetString(L"IDS_BR_BODY_PRINT"), IDA_PRINT_CLICKED);
+// __pOptionMenu->InsertItemAt(2,L"Add to Home"/*CommonUtil::GetString(L"IDS_BR_OPT_SHARE")*/, IDA_ADD_TO_HOME_CLICKED);
+ __pOptionMenu->InsertItemAt(3,CommonUtil::GetString(L"IDS_BR_OPT_SHARE"), IDA_SHARE_CLICKED);
+ __pOptionMenu->InsertItemAt(4,CommonUtil::GetString(L"IDS_BR_OPT_FIND_ON_PAGE_ABB"), IDA_FINDONPAGE_CLICKED);
+ __pOptionMenu->SetMaxVisibleItemsCount(6);
+ }
+ if( GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE || GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
+ {
+ AppLog(" Orientation landscape");
+ __pOptionMenu->SetMaxVisibleItemsCount(5);
+ }
+ else
+ {
+ AppLog(" Orientation potrait");
+ __pOptionMenu->SetMaxVisibleItemsCount(6);
+ }
+
+ AppLogDebug("ONACTION_PERFORMED:IDA_MOREBTN_CLICKED 5");
+ delete pBitmap;
+ }
+ AppLogDebug("ONACTION_PERFORMED:IDA_MOREBTN_CLICKED end");
+ if(__pAddressbar)
+ __pAddressbar->SetShowState(false);
+ SetFocus();
+ __pFooterPanel->SetShowState(true);
+ result r = __pOptionMenu->SetShowState(true);
+ AppLog("ajsghd %s",GetErrorMessage(r));
+ RelayoutControls(false);
+ __pOptionMenu->Invalidate(true);
+ __pOptionMenu->Show();
+
+}