const int IDA_SAVED_PAGES_CLICKED = 119;
const int IDA_DESKTOP_VIEW_CLICKED = 120;
const int IDA_SAVE_CLICKED = 121;
+const int IDA_PRINT_CLICKED = 122;
const int IDA_FINDWORD_SEARCH_CLICKED = 201;
const int IDA_FINDWORD_NEXT_CLICKED = 202;
}
__pGoForwardBtn->SetActionId(IDA_GO_FORWARD);
__pGoForwardBtn->AddActionEventListener(*this);
- __pGoForwardBtn->SetEnabled(false);
+// __pGoForwardBtn->SetEnabled(false);
+ if (__pWebViewer && __pWebViewer->CanGoForward())
+ {
+ //__pAddressbar->SetForwardButtonEnabled(true);
+ SetForwardButtonEnabled(true);
+ }
+ else
+ {
+ //__pAddressbar->SetForwardButtonEnabled(false);
+ SetForwardButtonEnabled(false);
+ }
__pRefreshBtn = static_cast<Button*> (GetControl(L"IDC_REFRESH_BUTTON",true));
if (__pRefreshBtn == NULL)
}
break;
+ case IDA_PRINT_CLICKED:
+ {
+ r = __pWebViewer->SavePageAsPdf(UiApp::GetInstance()->GetAppRootPath()+"//data//test.pdf");
+ AppLog("SavePageAsPdf result %s",GetErrorMessage(r));
+
+ AppLog("RequestPrint called!");
+ Tizen::App::AppControl* pAc = Tizen::App::AppManager::FindAppControlN(L"org.tizen.mobileprint", L"http://tizen.org/appcontrol/operation/print");
+ result nResult = E_FAILURE;
+ if (pAc)
+ {
+ AppLog("TestPrint if (pAc) == true");
+
+ HashMap map;
+ map.Construct();
+
+ String fileType = L"service_print_files_type";
+ String typeVal = L"DOC";
+
+ String fileCount = L"service_print_files_count";
+ String countVal = L"1";
+ String fileFolder= L"service_print_files_folder_name";
+ String folderVal = UiApp::GetInstance()->GetAppRootPath()+"//data";
+
+ map.Add(&fileCount, &countVal);
+// map.Add(&fileIndex, &indexVal);
+ map.Add(&fileFolder, &folderVal);
+ map.Add(&fileType, &typeVal);
+
+ String fileName = L"service_print_files_files_name";
+
+ ArrayList fileNameList;
+ fileNameList.Construct();
+ String file1 = L"test.pdf";
+
+ fileNameList.Add(&file1);
+ map.Add(&fileName, &fileNameList);
+
+ nResult = pAc->Start(NULL, NULL, &map, NULL);
+
+ if (nResult == E_SUCCESS) AppLog("TestPrint ret == E_SUCCESS");
+ else if (nResult == E_MAX_EXCEEDED)
+ AppLog("TestPrint ret == E_MAX_EXCEEDED");
+ else if (nResult == E_OBJ_NOT_FOUND)
+ AppLog("TestPrint ret == E_OBJ_NOT_FOUND");
+ else if (nResult == E_IN_PROGRESS)
+ AppLog("TestPrint ret == E_IN_PROGRESS");
+ else if (nResult == E_PRIVILEGE_DENIED)
+ AppLog("TestPrint ret == E_PRIVILEGE_DENIED");
+ else if(nResult == E_SYSTEM)
+ AppLog("TestPrint ret == E_SYSTEM");
+
+ delete pAc;
+ }
+ else
+ {
+ int __modalMsgBoxResult;
+ MessageBox* pMsgBox = new MessageBox();
+ pMsgBox->Construct("Not Supported","Not Supported",MSGBOX_STYLE_OK,3000);
+ pMsgBox->ShowAndWait(__modalMsgBoxResult);
+ delete pMsgBox;
+ pMsgBox = null;
+ __modalMsgBoxResult = 0;
+ }
+ }
+ break;
case IDA_SHARE_CLICKED:
{
if(__pPopUp != null)
}
AppLogDebug("ONACTION_PERFORMED:IDA_MOREBTN_CLICKED 3");
- if (__pMenu->GetItemCount() == 8)
+ if (__pMenu->GetItemCount() == 9)
{
r = __pMenu->SetItemAt(1,CommonUtil::GetString(L"IDS_BR_OPT_ADDTOBOOKMARKS"), IDA_ADDTOBOOKMARK_CLICKED,*pBitmap);
}
return ;
}
AppLogDebug("ONACTION_PERFORMED:IDA_MOREBTN_CLICKED 4");
- if (__pMenu->GetItemCount() != 8)
+ if (__pMenu->GetItemCount() != 9)
{
__pMenu->InsertItemAt(1,CommonUtil::GetString(L"IDS_BR_OPT_ADDTOBOOKMARKS"), IDA_ADDTOBOOKMARK_CLICKED);
-
+ __pMenu->InsertItemAt(2,"Print", IDA_PRINT_CLICKED);
// __pMenu->InsertItemAt(2,L"Add to Home"/*CommonUtil::GetString(L"IDS_BR_OPT_SHARE")*/, IDA_ADD_TO_HOME_CLICKED);
- __pMenu->InsertItemAt(2,CommonUtil::GetString(L"IDS_BR_OPT_SHARE"), IDA_SHARE_CLICKED);
- __pMenu->InsertItemAt(3,CommonUtil::GetString(L"IDS_BR_OPT_FIND_ON_PAGE_ABB"), IDA_FINDONPAGE_CLICKED);
+ __pMenu->InsertItemAt(3,CommonUtil::GetString(L"IDS_BR_OPT_SHARE"), IDA_SHARE_CLICKED);
+ __pMenu->InsertItemAt(4,CommonUtil::GetString(L"IDS_BR_OPT_FIND_ON_PAGE_ABB"), IDA_FINDONPAGE_CLICKED);
__pMenu->SetMaxVisibleItemsCount(6);
}
if( GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE || GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE)
if (pNotification != null)
{
pNotification->SetText(msg);
- pNotification->SetPositionDiff(__pFooterPanel->GetHeight());
+ if (__pFooterPanel->GetShowState() == true)
+ {
+ pNotification->SetPositionDiff(__pFooterPanel->GetHeight());
+ }
+ else
+ {
+ pNotification->SetPositionDiff(0);
+ }
+
pNotification->ShowNotification();
}
}
case IDA_FIND_TEXT__CLICKED:
{
OnAddressCancelledClicked(*__pAddressbar);
+ __pFooterPanel->SetShowState(false);
AppLogDebug("MainForm::OnActionPerformed find word clicked");
__currentSearchStr.Clear();
__currentSearchStr.Append(__currentSelectedStr);
String idElement = __pHitElementResult->GetAttributeValue(L"id");
String nameElement = __pHitElementResult->GetAttributeValue(L"name");
AppLog("MainForm::IDA_PASTE_TEXT_CLICKED id is %ls",idElement.GetPointer());
- String script = L"function insertAtCursor(myField, myValue) { if (document.selection) { myField.focus(); sel = document.selection.createRange(); sel.text = myValue; } else if (myField.selectionStart || myField.selectionStart == '0'){ var startPos = myField.selectionStart; var endPos = myField.selectionEnd; myField.value = myField.value.substring(0, startPos)+ myValue + myField.value.substring(endPos, myField.value.length); } else { myField.value += myValue; } } ";
+// String script = L"function insertAtCursor(myField, myValue) { if (document.selection) { myField.focus(); sel = document.selection.createRange(); sel.text = myValue; } else if (myField.selectionStart || myField.selectionStart == '0'){ var startPos = myField.selectionStart; var endPos = myField.selectionEnd; myField.value = myField.value.substring(0, startPos)+ myValue + myField.value.substring(endPos, myField.value.length); } else { myField.value += myValue; } } ";
+ String script = L"function insertAtCursor(myField, myValue) { if (document.selection) { document.getElementById(myField).focus(); sel = document.selection.createRange(); sel.text = myValue; } else if (document.getElementById(myField).selectionStart || document.getElementById(myField).selectionStart == '0'){ var startPos = document.getElementById(myField).selectionStart; var endPos = document.getElementById(myField).selectionEnd; document.getElementById(myField).value = document.getElementById(myField).value.substring(0, startPos)+ myValue + document.getElementById(myField).value.substring(endPos, document.getElementById(myField).value.length); } else { document.getElementById(myField).value += myValue; } } ";
if(idElement.GetLength() != 0)
{
- script.Append("insertAtCursor(");
+ script.Append("insertAtCursor('");
script.Append(idElement);
- script.Append(",");
+ script.Append("',");
script.Append("\"");
script.Append(*pString);
script.Append("\");");
__pFooterPanel->SetShowState(false);
__pWebViewer->SetBounds(Rectangle(0, 0,GetClientAreaBounds().width, GetClientAreaBounds().height));
}
- if(__pImageMenu && __pImageMenu->GetShowState() == true)
- {
- __pImageMenu->SetAnchorPosition(Point(__pImageMenu->GetAnchorPosition().x/2,__pImageMenu->GetAnchorPosition().y/2));
- AppLog("omgomgomg");
- }
+// if(__pImageMenu && __pImageMenu->GetShowState() == true)
+// {
+// __pImageMenu->SetAnchorPosition(Point(__pImageMenu->GetAnchorPosition().x/2,__pImageMenu->GetAnchorPosition().y/2));
+// AppLog("omgomgomg");
+// }
Invalidate(true);
}
AppLog("MainForm::OnOrientationChanged GetClientAreaBounds %d, %d",GetClientAreaBounds().width,GetClientAreaBounds().height);
int widthContextItem = 0;
- if(__pWebViewer != null)
+ // As per the platform engineer comment removed this line
+ /*if(__pWebViewer != null)
{
// this is added because if any text is selected on long press followed by on rotation we are hiding the context menu therefore we should release the text block also
__pWebViewer->ReleaseBlock();
- }
+ }*/
if(__pFindWordControl != null)
ShowFindWordPanel(__pFindWordControl->GetShowState(), false);
void
MainForm::OnTouchMoved(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
{
- __currentWordIndex = 0;
+// __currentWordIndex = 0;
__isLongPressedDone = false;
}
if (removedHttpUrl.IsEmpty() == false)
{
__pFooterUrlField->SetText(removedHttpUrl);
+ if(__pAddressbar != NULL)
__pAddressbar->SetUrl(__displayUrl);
}
else
{
__pFooterUrlField->SetText(__displayUrl);
+ if(__pAddressbar != NULL)
__pAddressbar->SetUrl(__displayUrl);
}
if(__pFooterUrlField)
__pFooterUrlField->SetCursorPosition(__pFooterUrlField->GetTextLength());
__pFooterUrlField->Invalidate(false);
+ if(__pAddressbar != NULL)
__pAddressbar->Invalidate(true);
// __pFooterUrlField->SetCursorPosition(0);
}
{
__pWebViewer->AddTouchEventListener(*this);
}
+
+void MainForm::OnUserEventReceivedN (RequestId requestId, Tizen::Base::Collection::IList *pArgs)
+{
+ if (requestId == BACK_GROUND_APP_EVENT)
+ {
+ if(__pWebViewer != null)
+ {
+ __pWebViewer->Pause();
+ }
+ }
+}