Merge branch 'tizen' into new_text
[platform/core/uifw/dali-toolkit.git] / base / dali-toolkit / internal / controls / text-input / text-input-impl.h
index 5801137..76160de 100644 (file)
  *
  */
 
+// EXTERNAL INCLUDES
+#include <dali/public-api/actors/mesh-actor.h>
+#include <dali/public-api/adaptor-framework/clipboard.h>
+#include <dali/public-api/adaptor-framework/clipboard-event-notifier.h>
+#include <dali/public-api/adaptor-framework/imf-manager.h>
+#include <dali/public-api/adaptor-framework/timer.h>
+#include <dali/public-api/common/dali-vector.h>
+#include <dali/public-api/geometry/mesh.h>
+
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali-toolkit/public-api/controls/text-input/text-input.h>
@@ -25,9 +34,6 @@
 #include <dali-toolkit/public-api/controls/buttons/push-button.h>
 #include <dali-toolkit/internal/controls/text-input/text-input-popup-impl.h>
 
-#include <dali/public-api/common/dali-vector.h>
-#include <dali/public-api/geometry/mesh.h>
-
 namespace Dali
 {
 
@@ -615,7 +621,7 @@ private:
     * @param actor Handle of the selection or grab handle.
     * @param gesture Data structure with the parameters of the gesture.
     */
-   void OnHandlePan(Actor actor, PanGesture gesture);
+   void OnHandlePan(Actor actor, const PanGesture& gesture);
 
    /**
     * Callback for touch down on Grab handle
@@ -643,21 +649,21 @@ private:
     * @param[in] actor
     * @param[in] tap touch event
     */
-   void OnTextTap(Dali::Actor actor, Dali::TapGesture tap);
+   void OnTextTap(Dali::Actor actor, const Dali::TapGesture& tap);
 
    /**
     * Callback for double tap on TextInput
     * @param[in] actor
     * @param[in] tap touch event
     */
-   void OnDoubleTap(Dali::Actor actor, Dali::TapGesture tap);
+   void OnDoubleTap(Dali::Actor actor, const Dali::TapGesture& tap);
 
     /**
      * Callback for long press on TextInput
      * @param[in] actor
      * @param[in] longPress long press event
      */
-   void OnLongPress(Dali::Actor actor, Dali::LongPressGesture longPress);
+   void OnLongPress(Dali::Actor actor, const Dali::LongPressGesture& longPress);
 
    /**
     * Callback for the ClipboardEventNotifier when text is selected in the clipboard window.
@@ -702,6 +708,22 @@ private:
    bool OnKeyUpEvent(const KeyEvent& event);
 
    /**
+    * Chooses from all handle position and alternative handle positions where to set the position of the two selection handles.
+    *
+    * @param[in] cursorPositionOne The initial position of the first selection handle.
+    * @param[in] cursorPositionTwo The initial position of the second selection handle.
+    * @param[in] altPositionValidOne Whether there is an alternative position for the first selection handle.
+    * @param[in] altPositionValidTwo Whether there is an alternative position for the second selection handle.
+    * @param[in] altPositionOne The alternative position of the first selection handle.
+    * @param[in] altPositionTwo The alternative position of the second selection handle.
+    */
+   void ChooseRtlSelectionHandlePosition( const Vector3& cursorPositionOne,
+                                          const Vector3& cursorPositionTwo,
+                                          bool altPositionValidOne,
+                                          bool altPositionValidTwo,
+                                          const Vector3& altPositionOne,
+                                          const Vector3& altPositionTwo );
+   /**
     * Callback called when the text-view is scrolled.
     *
     * Updates the selection and grab handles, and the highlighted text.
@@ -1033,6 +1055,11 @@ public:  // Public to allow internal testing.
   HighlightInfo CalculateHighlightInfo();
 
   /**
+   * This method was added to fix a PLM. it creates one quad per character so the mesh can show different selection boxes when a mix of right to left and left to right text is selected.
+   */
+  HighlightInfo CalculateHighlightInfoRtl();
+
+  /**
    * Calculates new Mesh data so highlight moves with selection handles.
    */
   void UpdateHighlight();