*/
void EWebView::HandleLongPressGesture(int x, int y,
- tizen_webview::Hit_Test_Mode mode,
+ tizen_webview::Hit_Test_Mode,
tizen_webview::Hit_Test* hit_test) {
_Ewk_Hit_Test* hit_test_data = hit_test->impl;
- if (hit_test_data && hit_test_data->context & TW_HIT_TEST_RESULT_CONTEXT_EDITABLE) {
- selection_controller_->SetSelectionStatus(true);
- selection_controller_->SetSelectionEditable(true);
- selection_controller_->HandleLongPressEvent(rwhv()->ConvertPointInViewPix(gfx::Point(x, y)));
- } else if (hit_test_data
- && !(hit_test_data->context & TW_HIT_TEST_RESULT_CONTEXT_LINK)
- && !(hit_test_data->context & TW_HIT_TEST_RESULT_CONTEXT_IMAGE)
- && !(hit_test_data->context & TW_HIT_TEST_RESULT_CONTEXT_MEDIA)
- && hit_test_data->context & TW_HIT_TEST_RESULT_CONTEXT_TEXT) {
- selection_controller_->SetSelectionStatus(true);
- selection_controller_->HandleLongPressEvent(rwhv()->ConvertPointInViewPix(gfx::Point(x, y)));
- LOG(INFO) << __PRETTY_FUNCTION__ << ":: link, !image, !media, text";
- } else if (hit_test_data && hit_test_data->context & TW_HIT_TEST_RESULT_CONTEXT_DOCUMENT) {
- LOG(INFO) << __PRETTY_FUNCTION__ << ":: TW_HIT_TEST_RESULT_CONTEXT_DOCUMENT";
- } else if (hit_test_data && hit_test_data->context & TW_HIT_TEST_RESULT_CONTEXT_IMAGE) {
- LOG(INFO) << __PRETTY_FUNCTION__ << ":: TW_HIT_TEST_RESULT_CONTEXT_IMAGE";
- } else if (hit_test_data && hit_test_data->context & TW_HIT_TEST_RESULT_CONTEXT_LINK) {
- selection_controller_->ClearSelectionViaEWebView();
- LOG(INFO) << __PRETTY_FUNCTION__ << ":: TW_HIT_TEST_RESULT_CONTEXT_LINK";
- } else {
- LOG(INFO) << __PRETTY_FUNCTION__ << ":: hit_test = " << hit_test_data->context;
- }
+ if (!hit_test_data)
+ return;
+
+ selection_controller_->HandleLongPressEvent(
+ rwhv()->ConvertPointInViewPix(gfx::Point(x, y)), hit_test_data->context);
}
void EWebView::HandleTapGesture(int x, int y,
- tizen_webview::Hit_Test_Mode mode,
+ tizen_webview::Hit_Test_Mode,
tizen_webview::Hit_Test* hit_test) {
_Ewk_Hit_Test* hit_test_data = hit_test->impl;
LOG(INFO) << __PRETTY_FUNCTION__ << " hit_test = " << hit_test_data;
#include "selection_box_efl.h"
#include "selection_magnifier_efl.h"
#include "ui/gfx/screen.h"
+#include "tizen_webview/public/tw_hit_test.h"
#include <Edje.h>
+using namespace tizen_webview;
+
namespace content {
static const int menuHeight = 140;// The Height fo the context menu.
*right = selection_data_->GetRightRect();
}
-void SelectionControllerEfl::HandleLongPressEvent(const gfx::Point& touch_point) {
+void SelectionControllerEfl::HandleLongPressEvent(
+ const gfx::Point& touch_point, tizen_webview::Hit_Test_Result_Context context) {
+ if (context & TW_HIT_TEST_RESULT_CONTEXT_EDITABLE) {
+ SetSelectionStatus(true);
+ SetSelectionEditable(true);
+ } else if (!(context & TW_HIT_TEST_RESULT_CONTEXT_LINK)
+ && !(context & TW_HIT_TEST_RESULT_CONTEXT_IMAGE)
+ && !(context & TW_HIT_TEST_RESULT_CONTEXT_MEDIA)
+ && context & TW_HIT_TEST_RESULT_CONTEXT_TEXT) {
+ SetSelectionStatus(true);
+ LOG(INFO) << __PRETTY_FUNCTION__ << ":: link, !image, !media, text";
+ } else if (context & TW_HIT_TEST_RESULT_CONTEXT_DOCUMENT) {
+ LOG(INFO) << __PRETTY_FUNCTION__ << ":: TW_HIT_TEST_RESULT_CONTEXT_DOCUMENT";
+ } else if (context & TW_HIT_TEST_RESULT_CONTEXT_IMAGE) {
+ LOG(INFO) << __PRETTY_FUNCTION__ << ":: TW_HIT_TEST_RESULT_CONTEXT_IMAGE";
+ } else if (context & TW_HIT_TEST_RESULT_CONTEXT_LINK) {
+ ClearSelectionViaEWebView();
+ LOG(INFO) << __PRETTY_FUNCTION__ << ":: TW_HIT_TEST_RESULT_CONTEXT_LINK";
+ } else {
+ LOG(INFO) << __PRETTY_FUNCTION__ << ":: hit_test = " << context;
+ }
+
+ HandleLongPressEventPrivate(touch_point);
+}
+
+void SelectionControllerEfl::HandleLongPressEventPrivate(const gfx::Point& touch_point) {
show_only_large_handler_ = false;
long_mouse_press_ = true;
Clear();
* Source/WebKit2/UIProcess/API/efl/ewk_view.cpp line 614
*/
if (!long_mouse_press_) {
- HandleLongPressEvent(gfx::Point(x, y));
+ HandleLongPressEventPrivate(gfx::Point(x, y));
return true;
}
explicit SelectionControllerEfl(EWebView* parent_view);
// Functions that handle long press, long press move and release
- void HandleLongPressEvent(const gfx::Point& touch_point);
+ void HandleLongPressEvent(const gfx::Point& touch_point, tizen_webview::Hit_Test_Result_Context);
void HandleLongPressMoveEvent(const gfx::Point& touch_point);
void HandleLongPressEndEvent();
// Set if selection is valid
bool GetShowOnlyLargeHandler() const { return show_only_large_handler_; }
private:
+ void HandleLongPressEventPrivate(const gfx::Point& touch_point);
+
// TODO: This method should be renamed to ScheduleShowHandleAndContextMenuIfNeeded
// as it now performs an asyncrhonous hit test passing the method that actually
// updates the selection handles and context menu as a registered callback.