(Text Controller) Moved some input properties into a different class & some functiona...
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / text-controller-impl.h
index 55184ef..219ca72 100644 (file)
@@ -46,6 +46,7 @@ const float DEFAULT_FONT_SIZE_SCALE = 1.f;
 struct CursorInfo;
 struct FontDefaults;
 struct ControllerImplEventHandler;
+struct ControllerImplModelUpdater;
 struct SelectionHandleController;
 
 class SelectableControlInterface;
@@ -66,6 +67,7 @@ struct Event
     SELECT,
     SELECT_ALL,
     SELECT_NONE,
+    SELECT_RANGE,
   };
 
   union Param
@@ -115,12 +117,12 @@ struct EventData
     return (stateToCheck == EDITING || stateToCheck == EDITING_WITH_POPUP || stateToCheck == EDITING_WITH_GRAB_HANDLE || stateToCheck == EDITING_WITH_PASTE_POPUP);
   }
 
-  DecoratorPtr       mDecorator;               ///< Pointer to the decorator.
-  InputMethodContext mInputMethodContext;      ///< The Input Method Framework Manager.
-  FontDefaults*      mPlaceholderFont;         ///< The placeholder default font.
-  std::string        mPlaceholderTextActive;   ///< The text to display when the TextField is empty with key-input focus.
-  std::string        mPlaceholderTextInactive; ///< The text to display when the TextField is empty and inactive.
-  Vector4            mPlaceholderTextColor;    ///< The in/active placeholder text color.
+  DecoratorPtr                  mDecorator;               ///< Pointer to the decorator.
+  InputMethodContext            mInputMethodContext;      ///< The Input Method Framework Manager.
+  std::unique_ptr<FontDefaults> mPlaceholderFont;         ///< The placeholder default font.
+  std::string                   mPlaceholderTextActive;   ///< The text to display when the TextField is empty with key-input focus.
+  std::string                   mPlaceholderTextInactive; ///< The text to display when the TextField is empty and inactive.
+  Vector4                       mPlaceholderTextColor;    ///< The in/active placeholder text color.
 
   /**
    * This is used to delay handling events until after the model has been updated.
@@ -355,7 +357,8 @@ struct Controller::Impl
     mTextFitMaxSize(DEFAULT_TEXTFIT_MAX),
     mTextFitStepSize(DEFAULT_TEXTFIT_STEP),
     mTextFitEnabled(false),
-    mFontSizeScale(DEFAULT_FONT_SIZE_SCALE)
+    mFontSizeScale(DEFAULT_FONT_SIZE_SCALE),
+    mIsLayoutDirectionChanged(false)
   {
     mModel = Model::New();
 
@@ -624,7 +627,7 @@ struct Controller::Impl
   /**
    * @copydoc Text::Controller::SetPrimaryCursorPosition()
    */
-  bool SetPrimaryCursorPosition(CharacterIndex index);
+  bool SetPrimaryCursorPosition(CharacterIndex index, bool focused);
 
   /**
    * @copydoc Text::SelectableControlInterface::SetTextSelectionRange()
@@ -768,6 +771,37 @@ struct Controller::Impl
    */
   Actor CreateBackgroundActor();
 
+  /**
+   * @brief fill needed relayout parameters when line size is changed & request relayout.
+   */
+  void RelayoutForNewLineSize();
+
+  /**
+   * @copydoc Controller::IsInputStyleChangedSignalsQueueEmpty
+   */
+  bool IsInputStyleChangedSignalsQueueEmpty();
+
+  /**
+   * @copydoc Controller::ProcessInputStyleChangedSignals
+   */
+  void ProcessInputStyleChangedSignals();
+
+  /**
+   * @copydoc Controller::ScrollBy()
+   */
+  void ScrollBy(Vector2 scroll);
+
+  /**
+   * @copydoc Controller::GetHorizontalScrollPosition()
+   */
+  float GetHorizontalScrollPosition();
+
+  /**
+   * @copydoc Controller::GetVerticalScrollPosition()
+   */
+  float GetVerticalScrollPosition();
+
+
 public:
   /**
    * @brief Gets implementation from the controller handle.
@@ -834,14 +868,16 @@ public:
 
   Shader mShaderBackground; ///< The shader for text background.
 
-  float mTextFitMinSize;     ///< Minimum Font Size for text fit. Default 10
-  float mTextFitMaxSize;     ///< Maximum Font Size for text fit. Default 100
-  float mTextFitStepSize;    ///< Step Size for font intervalse. Default 1
-  bool  mTextFitEnabled : 1; ///< Whether the text's fit is enabled.
-  float mFontSizeScale;      ///< Scale value for Font Size. Default 1.0
+  float mTextFitMinSize;               ///< Minimum Font Size for text fit. Default 10
+  float mTextFitMaxSize;               ///< Maximum Font Size for text fit. Default 100
+  float mTextFitStepSize;              ///< Step Size for font intervalse. Default 1
+  bool  mTextFitEnabled : 1;           ///< Whether the text's fit is enabled.
+  float mFontSizeScale;                ///< Scale value for Font Size. Default 1.0
+  bool  mIsLayoutDirectionChanged : 1; ///< Whether the layout has changed.
 
 private:
   friend ControllerImplEventHandler;
+  friend ControllerImplModelUpdater;
   friend SelectionHandleController;
 };