utc-Dali-Text-Typesetter.cpp
utc-Dali-Text-ViewModel.cpp
utc-Dali-TextField-internal.cpp
+ utc-Dali-TextEditor-internal.cpp
utc-Dali-TextSelectionPopup-internal.cpp
utc-Dali-TextureManager.cpp
utc-Dali-Visuals-internal.cpp
--- /dev/null
+/*
+ * Copyright (c) 2020 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <iostream>
+#include <stdlib.h>
+
+#include <dali-toolkit-test-suite-utils.h>
+#include <dali-toolkit/dali-toolkit.h>
+
+#include <dali-toolkit/internal/controls/text-controls/text-editor-impl.h>
+#include <dali-toolkit/internal/text/text-controller.h>
+#include <dali-toolkit/internal/text/text-controller-impl.h>
+
+using namespace Dali;
+using namespace Toolkit;
+using namespace Text;
+
+int UtcDaliTextEditorSelectText(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline( "UtcDaliTextEditorSelectText" );
+
+ // Create a text editor
+ TextEditor textEditor = TextEditor::New();
+ textEditor.SetProperty( Actor::Property::SIZE, Vector2( 400.f, 60.f ) );
+ textEditor.SetProperty( TextEditor::Property::TEXT, "Hello World" );
+
+ // Add the text editor to the stage
+ application.GetScene().Add( textEditor );
+
+ application.SendNotification();
+ application.Render();
+
+ Toolkit::Internal::TextEditor& textEditorImpl = GetImpl( textEditor );
+
+ application.SendNotification();
+ application.Render();
+
+ // Highlight the whole text
+ textEditorImpl.SelectWholeText();
+
+ application.SendNotification();
+ application.Render();
+
+ std::string selectedText = textEditorImpl.GetSelectedText();
+ DALI_TEST_CHECK( selectedText == "Hello World" );
+
+ // Select None
+ textEditorImpl.SelectNone();
+
+ application.SendNotification();
+ application.Render();
+
+ selectedText = textEditorImpl.GetSelectedText();
+ DALI_TEST_CHECK( selectedText == "" );
+
+ END_TEST;
+}
END_TEST;
}
+
+int UtcDaliTextFieldSelectText(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline( "UtcDaliTextFieldSelectText" );
+
+ // Create a text field
+ TextField textField = TextField::New();
+ textField.SetProperty( Actor::Property::SIZE, Vector2( 400.f, 60.f ) );
+ textField.SetProperty( TextField::Property::TEXT, "Hello World" );
+
+ // Add the text field to the stage
+ application.GetScene().Add( textField );
+
+ application.SendNotification();
+ application.Render();
+
+ Toolkit::Internal::TextField& textFieldImpl = GetImpl( textField );
+
+ application.SendNotification();
+ application.Render();
+
+ // Highlight the whole text
+ textFieldImpl.SelectWholeText();
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_CHECK( textFieldImpl.GetSelectedText() == "Hello World" );
+
+ // Select None
+ textFieldImpl.SelectNone();
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_CHECK( textFieldImpl.GetSelectedText() == "" );
+
+ END_TEST;
+}
END_TEST;
}
+int UtcDaliTextEditorSelectWholeText(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliTextEditorSelectWholeText ");
+
+ TextEditor textEditor = TextEditor::New();
+
+ application.GetScene().Add( textEditor );
+
+ textEditor.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) );
+ textEditor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ textEditor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+
+ // Avoid a crash when core load gl resources.
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( 1u, textEditor.GetChildCount(), TEST_LOCATION );
+
+ DevelTextEditor::SelectWholeText( textEditor );
+
+ application.SendNotification();
+ application.Render();
+
+ // Nothing should have been selected. The number of children is still 1
+ DALI_TEST_EQUALS( 1u, textEditor.GetChildCount(), TEST_LOCATION );
+
+ textEditor.SetProperty( TextEditor::Property::TEXT, "Hello world" );
+
+ application.SendNotification();
+ application.Render();
+
+ DevelTextEditor::SelectWholeText( textEditor );
+
+ application.SendNotification();
+ application.Render();
+
+ // Should be 2 children, the stencil and the layer
+ DALI_TEST_EQUALS( 2u, textEditor.GetChildCount(), TEST_LOCATION );
+
+ // The offscreen root actor should have two actors: the renderer and the highlight actor.
+ Actor stencil = textEditor.GetChildAt( 0u );
+
+ // The highlight actor is drawn first, so is the first actor in the list
+ Renderer highlight = stencil.GetChildAt( 0u ).GetRendererAt( 0u );
+ DALI_TEST_CHECK( highlight );
+
+ END_TEST;
+}
+
+int UtcDaliTextEditorSelectNone(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliTextEditorSelectWholeText ");
+
+ TextEditor textEditor = TextEditor::New();
+
+ application.GetScene().Add( textEditor );
+
+ textEditor.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) );
+ textEditor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ textEditor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+
+ // Avoid a crash when core load gl resources.
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+
+ application.SendNotification();
+ application.Render();
+
+ textEditor.SetProperty( TextEditor::Property::TEXT, "Hello world" );
+
+ application.SendNotification();
+ application.Render();
+
+ // Nothing is selected
+ std::string selectedText = textEditor.GetProperty( DevelTextEditor::Property::SELECTED_TEXT ).Get<std::string>();
+ DALI_TEST_EQUALS( "", selectedText, TEST_LOCATION );
+
+ DevelTextEditor::SelectWholeText( textEditor );
+
+ application.SendNotification();
+ application.Render();
+
+ // whole text is selected
+ selectedText = textEditor.GetProperty( DevelTextEditor::Property::SELECTED_TEXT ).Get<std::string>();
+ DALI_TEST_EQUALS( "Hello world", selectedText, TEST_LOCATION );
+
+ DevelTextEditor::SelectNone( textEditor );
+
+ application.SendNotification();
+ application.Render();
+
+ // Nothing is selected
+ selectedText = textEditor.GetProperty( DevelTextEditor::Property::SELECTED_TEXT ).Get<std::string>();
+ DALI_TEST_EQUALS( "", selectedText, TEST_LOCATION );
+
+ END_TEST;
+}
+
int UtcDaliTextEditorSelectRange(void)
{
ToolkitTestApplication application;
textEditor.SetProperty( DevelTextEditor::Property::SELECTED_TEXT_START, 0 );
textEditor.SetProperty( DevelTextEditor::Property::SELECTED_TEXT_END, 5 );
+ // Hello is selected
+ std::string selectedText = textEditor.GetProperty( DevelTextEditor::Property::SELECTED_TEXT ).Get<std::string>();
+ DALI_TEST_EQUALS( "Hello", selectedText, TEST_LOCATION );
+
DALI_TEST_EQUALS( textEditor.GetProperty( DevelTextEditor::Property::SELECTED_TEXT_START ).Get<int>(), 0, TEST_LOCATION );
DALI_TEST_EQUALS( textEditor.GetProperty( DevelTextEditor::Property::SELECTED_TEXT_END ).Get<int>(), 5, TEST_LOCATION );
return GetImpl(textEditor).MaxLengthReachedSignal();
}
+void SelectWholeText(TextEditor textEditor)
+{
+ GetImpl(textEditor).SelectWholeText();
+}
+
+void SelectNone(TextEditor textEditor)
+{
+ GetImpl(textEditor).SelectNone();
+}
+
} // namespace DevelTextEditor
} // namespace Toolkit
LINE_WRAP_MODE = Dali::Toolkit::TextEditor::Property::LINE_WRAP_MODE,
/**
- * @brief The text to display when the TextEditor is empty and inactive.
- * @details Name "placeholderText", type Property::STRING.
- */
+ * @brief The text to display when the TextEditor is empty and inactive.
+ * @details Name "placeholderText", type Property::STRING.
+ */
PLACEHOLDER_TEXT,
/**
- * @brief The placeholder-text color.
- * @details Name "placeholderTextColor", type Property::VECTOR4.
- */
+ * @brief The placeholder-text color.
+ * @details Name "placeholderTextColor", type Property::VECTOR4.
+ */
PLACEHOLDER_TEXT_COLOR,
/**
- * @brief Enables Text selection using Shift key.
- * @details Name "enableShiftSelection", type Property::BOOLEAN.
- */
+ * @brief Enables Text selection using Shift key.
+ * @details Name "enableShiftSelection", type Property::BOOLEAN.
+ */
ENABLE_SHIFT_SELECTION,
/**
- * @brief Enables the grab handles for text selection.
- * @details Name "enableGrabHandle", type Property::BOOLEAN.
- * @note The default value is true, which means the grab handles are enabled by default.
- */
+ * @brief Enables the grab handles for text selection.
+ * @details Name "enableGrabHandle", type Property::BOOLEAN.
+ * @note The default value is true, which means the grab handles are enabled by default.
+ */
ENABLE_GRAB_HANDLE,
/**
- * @brief Modifies the default text alignment to match the direction of the system language.
- * @details Name "matchSystemLanguageDirection", type (Property::BOOLEAN), Read/Write
- * @note The default value is false
- */
+ * @brief Modifies the default text alignment to match the direction of the system language.
+ * @details Name "matchSystemLanguageDirection", type (Property::BOOLEAN), Read/Write
+ * @note The default value is false
+ */
MATCH_SYSTEM_LANGUAGE_DIRECTION,
/**
- * @brief The type or rendering e.g. bitmap-based.
- * @details Name "renderingBackend", type Property::INTEGER.
- */
+ * @brief The type or rendering e.g. bitmap-based.
+ * @details Name "renderingBackend", type Property::INTEGER.
+ */
RENDERING_BACKEND,
/**
/**
* @brief The Editable state of control.
- * @details Name "editable", type Property::BOOL.
+ * @details Name "enableEditing", type Property::BOOLEAN.
*/
ENABLE_EDITING,
+
+ /**
+ * @brief The selected text in UTF-8 format.
+ * @details Name "selectedText", type Property::STRING.
+ * @note This property is read-only.
+ */
+ SELECTED_TEXT,
};
} // namespace Property
*/
DALI_TOOLKIT_API MaxLengthReachedSignalType& MaxLengthReachedSignal(TextEditor textEditor);
+/**
+ * @brief Select the whole text of TextEditor.
+ *
+ * @param[in] textEditor The instance of TextEditor.
+ */
+DALI_TOOLKIT_API void SelectWholeText(TextEditor textEditor);
+
+/**
+ * @brief Unselect the whole text of TextEditor.
+ *
+ * @param[in] textEditor The instance of TextEditor.
+ */
+DALI_TOOLKIT_API void SelectNone(TextEditor textEditor);
+
} // namespace DevelTextEditor
} // namespace Toolkit
ELLIPSIS = Dali::Toolkit::TextField::Property::ELLIPSIS,
/**
- * @brief Enables Text selection using Shift key.
- * @details Name "enableShiftSelection", type Property::BOOLEAN.
- */
+ * @brief Enables Text selection using Shift key.
+ * @details Name "enableShiftSelection", type Property::BOOLEAN.
+ */
ENABLE_SHIFT_SELECTION = ELLIPSIS + 1,
/**
- * @brief Enables the grab handles for text selection.
- * @details Name "enableGrabHandle", type Property::BOOLEAN.
- * @note The default value is true, which means the grab handles are enabled by default.
- */
+ * @brief Enables the grab handles for text selection.
+ * @details Name "enableGrabHandle", type Property::BOOLEAN.
+ * @note The default value is true, which means the grab handles are enabled by default.
+ */
ENABLE_GRAB_HANDLE = ELLIPSIS + 2,
/**
- * @brief Modifies the default text alignment to match the direction of the system language.
- * @details Name "matchSystemLanguageDirection", type (Property::BOOLEAN), Read/Write
- * @note The default value is false
- */
+ * @brief Modifies the default text alignment to match the direction of the system language.
+ * @details Name "matchSystemLanguageDirection", type (Property::BOOLEAN), Read/Write
+ * @note The default value is false
+ */
MATCH_SYSTEM_LANGUAGE_DIRECTION = ELLIPSIS + 3,
/**
- * @brief Enables the grab handle popup for text selection.
- * @details Name "enableGrabHandlePopup", type Property::BOOLEAN.
- * @note The default value is true, which means the grab handle popup is enabled by default.
- */
+ * @brief Enables the grab handle popup for text selection.
+ * @details Name "enableGrabHandlePopup", type Property::BOOLEAN.
+ * @note The default value is true, which means the grab handle popup is enabled by default.
+ */
ENABLE_GRAB_HANDLE_POPUP = ELLIPSIS + 4,
/**
- * @brief The default text background parameters.
- * @details Name "textBackground", type Property::VECTOR4.
- * @note Use "textBackground" as property name to avoid conflict with Control's "background" property.
- * @note The default value is Color::TRANSPARENT.
- */
+ * @brief The default text background parameters.
+ * @details Name "textBackground", type Property::VECTOR4.
+ * @note Use "textBackground" as property name to avoid conflict with Control's "background" property.
+ * @note The default value is Color::TRANSPARENT.
+ */
BACKGROUND = ELLIPSIS + 5,
/**
- * @brief The selected text in UTF-8 format.
- * @details Name "selectedText", type Property::STRING.
- * @note This property is read-only.
- */
+ * @brief The selected text in UTF-8 format.
+ * @details Name "selectedText", type Property::STRING.
+ * @note This property is read-only.
+ */
SELECTED_TEXT = ELLIPSIS + 6,
/**
- * @brief The type or rendering e.g. bitmap-based.
- * @details Name "renderingBackend", type Property::INTEGER.
- */
+ * @brief The type or rendering e.g. bitmap-based.
+ * @details Name "renderingBackend", type Property::INTEGER.
+ */
RENDERING_BACKEND = ELLIPSIS + 7,
/**
/**
* @brief The Editable state of control.
- * @details Name "editable", type Property::BOOL.
+ * @details Name "enableEditing", type Property::BOOLEAN.
*/
ENABLE_EDITING,
DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "selectedTextStart", INTEGER, SELECTED_TEXT_START )
DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "selectedTextEnd", INTEGER, SELECTED_TEXT_END )
DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "enableEditing", BOOLEAN, ENABLE_EDITING )
+DALI_DEVEL_PROPERTY_REGISTRATION_READ_ONLY( Toolkit, TextEditor, "selectedText", STRING, SELECTED_TEXT )
DALI_SIGNAL_REGISTRATION( Toolkit, TextEditor, "textChanged", SIGNAL_TEXT_CHANGED )
DALI_SIGNAL_REGISTRATION( Toolkit, TextEditor, "inputStyleChanged", SIGNAL_INPUT_STYLE_CHANGED )
}
case Toolkit::DevelTextEditor::Property::SELECTED_TEXT_START:
{
- if( impl.mController )
- {
- uint32_t start = static_cast<uint32_t>(value.Get< int >());
- DALI_LOG_INFO( gLogFilter, Debug::General, "TextEditor %p SELECTED_TEXT_START %d\n", impl.mController.Get(), start );
- impl.SetTextSelectionRange( &start, nullptr );
- }
+ uint32_t start = static_cast<uint32_t>(value.Get< int >());
+ DALI_LOG_INFO( gLogFilter, Debug::General, "TextEditor %p SELECTED_TEXT_START %d\n", impl.mController.Get(), start );
+ impl.SetTextSelectionRange( &start, nullptr );
break;
}
case Toolkit::DevelTextEditor::Property::SELECTED_TEXT_END:
{
- if( impl.mController )
- {
- uint32_t end = static_cast<uint32_t>(value.Get< int >());
- DALI_LOG_INFO( gLogFilter, Debug::General, "TextEditor %p SELECTED_TEXT_END %d\n", impl.mController.Get(), end );
- impl.SetTextSelectionRange( nullptr, &end );
- }
+ uint32_t end = static_cast<uint32_t>(value.Get< int >());
+ DALI_LOG_INFO( gLogFilter, Debug::General, "TextEditor %p SELECTED_TEXT_END %d\n", impl.mController.Get(), end );
+ impl.SetTextSelectionRange( nullptr, &end );
break;
}
case Toolkit::DevelTextEditor::Property::ENABLE_EDITING:
value = impl.mController->GetMaximumNumberOfCharacters();
break;
}
+ case Toolkit::DevelTextEditor::Property::SELECTED_TEXT:
+ {
+ value = impl.mController->GetSelectedText( );
+ break;
+ }
case Toolkit::DevelTextEditor::Property::SELECTED_TEXT_START:
{
Uint32Pair range = impl.GetTextSelectionRange();
return value;
}
+void TextEditor::SelectWholeText()
+{
+ if( mController && mController->IsShowingRealText() )
+ {
+ mController->SelectWholeText();
+ SetKeyInputFocus();
+ }
+}
+
+void TextEditor::SelectNone()
+{
+ if( mController && mController->IsShowingRealText() )
+ {
+ mController->SelectNone();
+ }
+}
+
+string TextEditor::GetSelectedText() const
+{
+ string selectedText = "";
+ if( mController && mController->IsShowingRealText() )
+ {
+ selectedText = mController->GetSelectedText( );
+ }
+ return selectedText;
+}
+
InputMethodContext TextEditor::GetInputMethodContext()
{
return mInputMethodContext;
Uint32Pair GetTextSelectionRange() const override;
/**
+ * @copydoc Text::SelectableControlInterface::SelectWholeText()
+ */
+ void SelectWholeText() override;
+
+ /**
+ * @copydoc Text::SelectableControlInterface::SelectNone()
+ */
+ void SelectNone() override;
+
+ /**
+ * @copydoc Text::SelectableControlInterface::GetSelectedText()
+ */
+ string GetSelectedText() const override;
+
+ /**
* @copydoc Text::EditableControlInterface::IsEditable()
*/
bool IsEditable() const override;
}
case Toolkit::DevelTextField::Property::SELECTED_TEXT_START:
{
- if( impl.mController )
- {
- uint32_t start = static_cast<uint32_t>(value.Get< int >());
- DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p SELECTED_TEXT_START %d\n", impl.mController.Get(), start );
- impl.SetTextSelectionRange( &start, nullptr );
- }
+ uint32_t start = static_cast<uint32_t>(value.Get< int >());
+ DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p SELECTED_TEXT_START %d\n", impl.mController.Get(), start );
+ impl.SetTextSelectionRange( &start, nullptr );
break;
}
case Toolkit::DevelTextField::Property::SELECTED_TEXT_END:
{
- if( impl.mController )
- {
- uint32_t end = static_cast<uint32_t>(value.Get< int >());
- DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p SELECTED_TEXT_END %d\n", impl.mController.Get(), end );
- impl.SetTextSelectionRange( nullptr, &end );
- }
+ uint32_t end = static_cast<uint32_t>(value.Get< int >());
+ DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p SELECTED_TEXT_END %d\n", impl.mController.Get(), end );
+ impl.SetTextSelectionRange( nullptr, &end );
break;
}
case Toolkit::DevelTextField::Property::ENABLE_EDITING:
{
if( mController && mController->IsShowingRealText() )
{
- mController->SelectEvent( 0.f, 0.f, SelectionType::ALL );
+ mController->SelectWholeText();
SetKeyInputFocus();
}
}
{
if( mController && mController->IsShowingRealText() )
{
- mController->SelectEvent( 0.f, 0.f, SelectionType::NONE );
- SetKeyInputFocus();
+ mController->SelectNone();
+ }
+}
+
+string TextField::GetSelectedText() const
+{
+ string selectedText = "";
+ if( mController && mController->IsShowingRealText() )
+ {
+ selectedText = mController->GetSelectedText( );
}
+ return selectedText;
}
void TextField::SetTextSelectionRange(const uint32_t *start, const uint32_t *end)
*/
Toolkit::TextField::InputStyleChangedSignalType& InputStyleChangedSignal();
- /**
- * @brief Called to select the whole texts.
- */
- void SelectWholeText();
-
- /**
- * @brief Called to unselect the whole texts.
- */
- void SelectNone();
-
private: // From Control
/**
Uint32Pair GetTextSelectionRange() const override;
/**
+ * @copydoc Text::SelectableControlInterface::SelectWholeText()
+ */
+ void SelectWholeText() override;
+
+ /**
+ * @copydoc Text::SelectableControlInterface::SelectNone()
+ */
+ void SelectNone() override;
+
+ /**
+ * @copydoc Text::SelectableControlInterface::GetSelectedText()
+ */
+ string GetSelectedText() const override;
+
+ /**
* @copydoc Text::EditableControlInterface::IsEditable()
*/
bool IsEditable() const override;
return mImpl->GetTextSelectionRange();
}
+void Controller::SelectWholeText()
+{
+ SelectEvent( 0.f, 0.f, SelectionType::ALL );
+}
+
+void Controller::SelectNone()
+{
+ SelectEvent( 0.f, 0.f, SelectionType::NONE );
+}
+
+string Controller::GetSelectedText() const
+{
+ string text;
+ if( EventData::SELECTING == mImpl->mEventData->mState )
+ {
+ mImpl->RetrieveSelection( text, false );
+ }
+ return text;
+}
+
InputMethodContext::CallbackData Controller::OnInputMethodContextEvent( InputMethodContext& inputMethodContext, const InputMethodContext::EventData& inputMethodContextEvent )
{
// Whether the text needs to be relaid-out.
return textRemoved;
}
-std::string Controller::GetSelectedText()
-{
- std::string text;
- if( EventData::SELECTING == mImpl->mEventData->mState )
- {
- mImpl->RetrieveSelection( text, false );
- }
- return text;
-}
-
// private : Relayout.
bool Controller::DoRelayout( const Size& size,
Uint32Pair GetTextSelectionRange() const;
/**
+ * @copydoc Text::SelectableControlInterface::SelectWholeText()
+ */
+ void SelectWholeText();
+
+ /**
+ * @copydoc Text::SelectableControlInterface::SelectNone()
+ */
+ void SelectNone();
+
+ /**
+ * @copydoc Text::SelectableControlInterface::GetSelectedText()
+ */
+ string GetSelectedText() const;
+
+ /**
* @copydoc Text::EditableControlInterface::IsEditable()
*/
virtual bool IsEditable() const;
*/
Actor CreateBackgroundActor();
- /**
- * @brief Retrive Selected text.
- *
- * @return The seleced text.
- */
- std::string GetSelectedText();
-
protected: // Inherit from Text::Decorator::ControllerInterface.
/**
{
using Uint32Pair = std::pair<uint32_t,uint32_t>;
+using string = std::string;
namespace Text
{
* @return pair contains start and end positions.
*/
virtual Uint32Pair GetTextSelectionRange() const = 0;
+
+ /**
+ * @brief Called to select the whole texts.
+ */
+ virtual void SelectWholeText() = 0;
+
+ /**
+ * @brief Called to unselect the whole texts.
+ */
+ virtual void SelectNone() = 0;
+
+ /**
+ * @brief Retrive Selected text.
+ * @return The seletced text.
+ */
+ virtual string GetSelectedText() const = 0;
};
} // namespace Text