[dali_2.3.24] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / controller / text-controller-impl.h
index c6d8b8c..0b404cc 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_TEXT_CONTROLLER_IMPL_H
 
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -26,6 +26,7 @@
 #include <dali-toolkit/devel-api/styling/style-manager-devel.h>
 #include <dali-toolkit/internal/text/controller/text-controller.h>
 #include <dali-toolkit/internal/text/input-style.h>
+#include <dali-toolkit/internal/text/multi-language-support.h>
 #include <dali-toolkit/internal/text/text-model.h>
 #include <dali-toolkit/internal/text/text-view.h>
 #include <dali-toolkit/public-api/styling/style-manager.h>
@@ -330,6 +331,7 @@ struct Controller::Impl
     mEmbossDefaults(NULL),
     mOutlineDefaults(NULL),
     mEventData(NULL),
+    mIdleCallback(NULL),
     mFontClient(),
     mClipboard(),
     mView(),
@@ -371,7 +373,9 @@ struct Controller::Impl
     mTextFitChanged(false),
     mTextFitArrayEnabled(false),
     mIsLayoutDirectionChanged(false),
-    mIsUserInteractionEnabled(true)
+    mIsUserInteractionEnabled(true),
+    mProcessorRegistered(false),
+    mTextCutout(false)
   {
     mModel = Model::New();
 
@@ -440,6 +444,16 @@ struct Controller::Impl
   }
 
   /**
+   * @copydoc Text::Controller::ResetFontAndStyleData()
+   */
+  void ResetFontAndStyleData()
+  {
+    ClearFontData();
+    ClearStyleData();
+    RequestRelayout();
+  }
+
+  /**
    * @brief Helper to move the cursor, grab handle etc.
    */
   bool ProcessInputEvents();
@@ -603,12 +617,6 @@ struct Controller::Impl
     return mClipboard != nullptr ? true : false;
   }
 
-  bool IsClipboardEmpty()
-  {
-    bool result(Clipboard::IsAvailable() && EnsureClipboardCreated() && mClipboard.NumberOfItems());
-    return !result; // If NumberOfItems greater than 0, return false
-  }
-
   bool IsClipboardVisible()
   {
     bool result(Clipboard::IsAvailable() && EnsureClipboardCreated() && mClipboard.IsVisible());
@@ -616,6 +624,14 @@ struct Controller::Impl
   }
 
   /**
+   * @brief Whether the clipboard is empty or not.
+   * Checks the types that the text controller can paste and returns the result.
+   *
+   * @return Return whether or not the clipboard is empty.
+   */
+  bool IsClipboardEmpty();
+
+  /**
    * @copydoc Controller::GetLayoutDirection()
    */
   Dali::LayoutDirection::Type GetLayoutDirection(Dali::Actor& actor) const;
@@ -1042,6 +1058,7 @@ public:
   EmbossDefaults*              mEmbossDefaults;             ///< Avoid allocating this when the user does not specify emboss parameters.
   OutlineDefaults*             mOutlineDefaults;            ///< Avoid allocating this when the user does not specify outline parameters.
   EventData*                   mEventData;                  ///< Avoid allocating everything for text input until EnableTextInput().
+  CallbackBase*                mIdleCallback;               ///< Callback what would be called at idler
   TextAbstraction::FontClient  mFontClient;                 ///< Handle to the font client.
   Clipboard                    mClipboard;                  ///< Handle to the system clipboard
   View                         mView;                       ///< The view interface to the rendering back-end.
@@ -1091,6 +1108,8 @@ public:
   bool  mTextFitArrayEnabled : 1;      ///< Whether the text's fit array is enabled.
   bool  mIsLayoutDirectionChanged : 1; ///< Whether the layout has changed.
   bool  mIsUserInteractionEnabled : 1; ///< Whether the user interaction is enabled.
+  bool  mProcessorRegistered : 1;      ///< Whether the text controller registered into processor or not.
+  bool  mTextCutout : 1;               ///< Whether the text cutout enabled.
 
 private:
   friend ControllerImplEventHandler;