#define DALI_TOOLKIT_INTERNAL_TEXT_EDITOR_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
DevelTextEditor::SelectionClearedSignalType& SelectionClearedSignal();
/**
+ * @copydoc Dali::Toollkit::TextEditor::SelectionStartedSignal()
+ */
+ DevelTextEditor::SelectionStartedSignalType& SelectionStartedSignal();
+
+ /**
* Connects a callback function with the object's signals.
* @param[in] object The object providing the signal.
* @param[in] tracker Used to disconnect the signal.
/**
* @copydoc Text::EditableControlInterface::AddDecoration()
*/
- void AddDecoration(Actor& actor, bool needsClipping) override;
+ void AddDecoration(Actor& actor, Toolkit::Text::DecorationType type, bool needsClipping) override;
/**
* @copydoc Text::EditableControlInterface::InputFiltered()
void EmitSelectionClearedSignal();
/**
+ * @brief Emits SelectionStarted signal.
+ */
+ void EmitSelectionStartedSignal();
+
+ /**
* @brief set RenderActor's position with new scrollPosition
*
* Apply updated scroll position or start scroll animation if VerticalScrollAnimation is enabled
void OnLayoutDirectionChanged(Actor actor, LayoutDirection::Type type);
/**
+ * @brief Add a layer for active or cursor.
+ * @param[in] layer The actor in which to store the layer.
+ * @param[in] actor The new layer to add.
+ */
+ void AddLayer(Actor& layer, Actor& actor);
+
+ /**
* Construct a new TextEditor.
*/
TextEditor();
Toolkit::DevelTextEditor::CursorPositionChangedSignalType mCursorPositionChangedSignal;
Toolkit::DevelTextEditor::SelectionChangedSignalType mSelectionChangedSignal;
Toolkit::DevelTextEditor::SelectionClearedSignalType mSelectionClearedSignal;
+ Toolkit::DevelTextEditor::SelectionStartedSignalType mSelectionStartedSignal;
InputMethodContext mInputMethodContext;
Text::ControllerPtr mController;
Actor mRenderableActor;
Actor mActiveLayer;
+ Actor mCursorLayer;
Actor mBackgroundActor;
CallbackBase* mIdleCallback;
uint32_t mOldSelectionStart;
uint32_t mOldSelectionEnd;
+ bool mSelectionStarted : 1; ///< If true, emits SelectionStartedSignal at the end of OnRelayout().
+
struct PropertyHandler;
/**
* @brief This structure is to connect TextEditor with Accessible functions.
*/
- struct AccessibleImpl : public DevelControl::AccessibleImpl,
- public virtual Dali::Accessibility::Text,
+ struct AccessibleImpl : public DevelControl::ControlAccessible,
public virtual Dali::Accessibility::EditableText,
public virtual Dali::Accessibility::Hypertext
{
- using DevelControl::AccessibleImpl::AccessibleImpl;
+ using DevelControl::ControlAccessible::ControlAccessible;
/**
* @copydoc Dali::Accessibility::Accessible::GetName()
*/
- std::string GetName() override;
+ std::string GetName() const override;
/**
* @copydoc Dali::Accessibility::Text::GetText()
*/
- std::string GetText(size_t startOffset, size_t endOffset) override;
+ std::string GetText(size_t startOffset, size_t endOffset) const override;
/**
* @copydoc Dali::Accessibility::Text::GetCharacterCount()
*/
- size_t GetCharacterCount() override;
+ size_t GetCharacterCount() const override;
/**
* @copydoc Dali::Accessibility::Text::GetCursorOffset()
*/
- size_t GetCursorOffset() override;
+ size_t GetCursorOffset() const override;
/**
* @copydoc Dali::Accessibility::Text::SetCursorOffset()
/**
* @copydoc Dali::Accessibility::Text::GetTextAtOffset()
*/
- Accessibility::Range GetTextAtOffset(size_t offset, Accessibility::TextBoundary boundary) override;
+ Accessibility::Range GetTextAtOffset(size_t offset, Accessibility::TextBoundary boundary) const override;
/**
* @copydoc Dali::Accessibility::Text::GetRangeOfSelection()
*/
- Accessibility::Range GetRangeOfSelection(size_t selectionIndex) override;
+ Accessibility::Range GetRangeOfSelection(size_t selectionIndex) const override;
/**
* @copydoc Dali::Accessibility::Text::RemoveSelection()