#if ENABLE(TIZEN_WEBKIT2_FOR_MOVING_TEXT_SELECTION_HANDLE_FROM_OSP)
, m_selectedHandle(0)
#endif
+ , m_handleMovingDirection(HandleMovingDirectionNormal)
{
ASSERT(viewWidget);
hide();
clear();
initHandlesMouseDownedStatus();
+ setIsTextSelectionDowned(false);
}
m_isTextSelectionMode = isTextSelectionMode;
WebCore::IntPoint leftEvasPoint = toEvasTransform.mapPoint(leftRect.minXMaxYCorner());
WebCore::IntPoint rightEvasPoint = toEvasTransform.mapPoint(rightRect.maxXMaxYCorner());
+ TextSelectionHandle* shownLeftHandle = m_leftHandle;
+ TextSelectionHandle* shownRightHandle = m_rightHandle;
+
+ if (m_handleMovingDirection == HandleMovingDirectionReverse) {
+ shownLeftHandle = m_rightHandle;
+ shownRightHandle = m_leftHandle;
+ }
+
EditorState editorState = m_viewImpl->page()->editorState();
if (editorState.isContentEditable) {
- m_leftHandle->hide();
- m_rightHandle->hide();
+ shownLeftHandle->hide();
+ shownRightHandle->hide();
WebCore::IntRect editorRect = editorState.editorRect;
WebCore::IntPoint editorLeftEvasPoint = toEvasTransform.mapPoint(editorRect.location());
evas_object_geometry_get(m_viewImpl->view(), &webViewX, &webViewY, &webViewWidth, &webViewHeight);
if ((editorLeftEvasPoint.x() <= leftEvasPoint.x() && editorLeftEvasPoint.y() <= leftEvasPoint.y())
&& (webViewX <= leftEvasPoint.x() && webViewY <= leftEvasPoint.y())) {
- m_leftHandle->move(leftEvasPoint, m_viewImpl->transformToScene().mapRect(leftRect));
- m_leftHandle->show();
+ shownLeftHandle->move(leftEvasPoint, m_viewImpl->transformToScene().mapRect(leftRect));
+ shownLeftHandle->show();
}
if ((editorRightEvasPoint.x() >= rightEvasPoint.x() && editorRightEvasPoint.y() >= rightEvasPoint.y())
&& ((webViewX + webViewWidth) >= rightEvasPoint.x() && (webViewY <= rightEvasPoint.y() && (webViewY + webViewHeight) >= rightEvasPoint.y()))) {
- m_rightHandle->move(rightEvasPoint, m_viewImpl->transformToScene().mapRect(rightRect));
- m_rightHandle->show();
+ shownRightHandle->move(rightEvasPoint, m_viewImpl->transformToScene().mapRect(rightRect));
+ shownRightHandle->show();
}
} else {
- m_leftHandle->move(leftEvasPoint, m_viewImpl->transformToScene().mapRect(leftRect));
- m_leftHandle->show();
+ shownLeftHandle->move(leftEvasPoint, m_viewImpl->transformToScene().mapRect(leftRect));
+ shownLeftHandle->show();
- m_rightHandle->move(rightEvasPoint, m_viewImpl->transformToScene().mapRect(rightRect));
- m_rightHandle->show();
+ shownRightHandle->move(rightEvasPoint, m_viewImpl->transformToScene().mapRect(rightRect));
+ shownRightHandle->show();
}
}
void TextSelection::setLeftSelectionToEvasPoint(const IntPoint& evasPoint)
{
- m_viewImpl->page()->setLeftSelection(m_viewImpl->transformFromScene().mapPoint(evasPoint));
+ int result = m_viewImpl->page()->setLeftSelection(m_viewImpl->transformFromScene().mapPoint(evasPoint), m_handleMovingDirection);
+ if (result)
+ m_handleMovingDirection = result;
updateHandlers();
}
void TextSelection::setRightSelectionToEvasPoint(const IntPoint& evasPoint)
{
- m_viewImpl->page()->setRightSelection(m_viewImpl->transformFromScene().mapPoint(evasPoint));
+ int result = m_viewImpl->page()->setRightSelection(m_viewImpl->transformFromScene().mapPoint(evasPoint), m_handleMovingDirection);
+ if (result)
+ m_handleMovingDirection = result;
updateHandlers();
}
void TextSelection::handleMouseUp(TextSelectionHandle* /* handle */, const IntPoint& /* position */)
{
+ m_handleMovingDirection = HandleMovingDirectionNormal;
+
hideMagnifier();
+ updateHandlers();
showContextMenu();
}
// 'return false' means text selection is not possible for point.
// 'return true' means text selection is possible.
-bool TextSelection::textSelectionDown(const IntPoint& point, bool isStartedTextSelectionFromOutside)
+bool TextSelection::textSelectionDown(const IntPoint& point)
{
// text selection should be ignored when longtap on handle from osp
if (!isEnabled() && isTextSelectionHandleDowned())
setIsTextSelectionMode(false);
IntPoint contentsPoint = m_viewImpl->transformFromScene().mapPoint(point);
- bool result = m_viewImpl->page()->selectClosestWord(contentsPoint, isStartedTextSelectionFromOutside);
+ bool result = m_viewImpl->page()->selectClosestWord(contentsPoint);
if (!result)
return false;
static int s_textSelectionMargin = 5;
-void TextSelection::textSelectionMove(const IntPoint& point, bool isStartedTextSelectionFromOutside)
+void TextSelection::textSelectionMove(const IntPoint& point)
{
// text selection should be ignored when longtap on handle from osp
if (!isEnabled() && isTextSelectionHandleDowned())
WebCore::IntPoint viewPoint;
EditorState editorState = m_viewImpl->page()->editorState();
+ bool isInEditablePicker = false;
+
+#if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
if (editorState.isContentEditable) {
+ if (editorState.inputMethodHints == "date"
+ || editorState.inputMethodHints == "datetime"
+ || editorState.inputMethodHints == "datetime-local"
+ || editorState.inputMethodHints == "month"
+ || editorState.inputMethodHints == "time"
+ || editorState.inputMethodHints == "week")
+ isInEditablePicker = true;
+ }
+#endif
+
+ if (editorState.isContentEditable && !isInEditablePicker) {
IntRect mapRect = m_viewImpl->transformToScene().mapRect(editorState.editorRect);
IntPoint updatedPoint = point;
bool scrolledY = false;
if (!scrolledX && !scrolledY) {
viewPoint = m_viewImpl->transformFromScene().mapPoint(updatedPoint);
- m_viewImpl->page()->selectClosestWord(viewPoint, isStartedTextSelectionFromOutside);
+ m_viewImpl->page()->selectClosestWord(viewPoint);
updateMagnifier(updatedPoint);
}
} else {
viewPoint = m_viewImpl->transformFromScene().mapPoint(point);
- m_viewImpl->page()->selectClosestWord(viewPoint, isStartedTextSelectionFromOutside);
+ m_viewImpl->page()->selectClosestWord(viewPoint);
updateMagnifier(point);
}
showMagnifier();