#include <limits>
// INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/text/text-enumerations-devel.h>
#include <dali-toolkit/internal/text/text-controller-event-handler.h>
#include <dali-toolkit/internal/text/text-controller-impl.h>
#include <dali-toolkit/internal/text/text-controller-input-font-handler.h>
ControllerPtr Controller::New(ControlInterface* controlInterface,
EditableControlInterface* editableControlInterface,
- SelectableControlInterface* selectableControlInterface)
+ SelectableControlInterface* selectableControlInterface,
+ AnchorControlInterface* anchorControlInterface)
{
return ControllerPtr(new Controller(controlInterface,
editableControlInterface,
- selectableControlInterface));
+ selectableControlInterface,
+ anchorControlInterface));
}
// public : Configure the text controller.
GetText(text);
SetText(text);
}
+
+ mImpl->mModel->mVisualModel->SetMarkupProcessorEnabled(enable);
}
bool Controller::IsMarkupProcessorEnabled() const
{
if(lineWrapMode != mImpl->mModel->mLineWrapMode)
{
- // Set the text wrap mode.
- mImpl->mModel->mLineWrapMode = lineWrapMode;
-
// Update Text layout for applying wrap mode
- mImpl->mOperationsPending = static_cast<OperationsMask>(mImpl->mOperationsPending |
+ mImpl->mOperationsPending = static_cast<OperationsMask>(mImpl->mOperationsPending |
ALIGN |
LAYOUT |
UPDATE_LAYOUT_SIZE |
REORDER);
+
+ if((mImpl->mModel->mLineWrapMode == (Text::LineWrap::Mode)DevelText::LineWrap::HYPHENATION) || (lineWrapMode == (Text::LineWrap::Mode)DevelText::LineWrap::HYPHENATION) ||
+ (mImpl->mModel->mLineWrapMode == (Text::LineWrap::Mode)DevelText::LineWrap::MIXED) || (lineWrapMode == (Text::LineWrap::Mode)DevelText::LineWrap::MIXED)) // hyphen is treated as line break
+ {
+ mImpl->mOperationsPending = static_cast<OperationsMask>(mImpl->mOperationsPending | GET_LINE_BREAKS);
+ }
+
+ // Set the text wrap mode.
+ mImpl->mModel->mLineWrapMode = lineWrapMode;
+
mImpl->mTextUpdateInfo.mCharacterIndex = 0u;
mImpl->mTextUpdateInfo.mNumberOfCharactersToRemove = mImpl->mTextUpdateInfo.mPreviousNumberOfCharacters;
mImpl->mTextUpdateInfo.mNumberOfCharactersToAdd = mImpl->mModel->mLogicalModel->mText.Count();
return EventHandler::KeyEvent(*this, keyEvent);
}
+void Controller::AnchorEvent(float x, float y)
+{
+ EventHandler::AnchorEvent(*this, x, y);
+}
+
void Controller::TapEvent(unsigned int tapCount, float x, float y)
{
EventHandler::TapEvent(*this, tapCount, x, y);
return TextUpdater::RemoveSelectedText(*this);
}
+void Controller::InsertTextAnchor(int numberOfCharacters,
+ CharacterIndex previousCursorIndex)
+{
+ TextUpdater::InsertTextAnchor(*this, numberOfCharacters, previousCursorIndex);
+}
+
+void Controller::RemoveTextAnchor(int cursorOffset,
+ int numberOfCharacters,
+ CharacterIndex previousCursorIndex)
+{
+ TextUpdater::RemoveTextAnchor(*this, cursorOffset, numberOfCharacters, previousCursorIndex);
+}
+
// private : Relayout.
bool Controller::DoRelayout(const Size& size,
mImpl->mControlInterface = controlInterface;
}
+void Controller::SetAnchorControlInterface(AnchorControlInterface* anchorControlInterface)
+{
+ mImpl->mAnchorControlInterface = anchorControlInterface;
+}
+
bool Controller::ShouldClearFocusOnEscape() const
{
return mImpl->mShouldClearFocusOnEscape;
// private : Private contructors & copy operator.
Controller::Controller()
-: Controller(nullptr, nullptr, nullptr)
+: Controller(nullptr, nullptr, nullptr, nullptr)
{
}
Controller::Controller(ControlInterface* controlInterface)
-: Controller(controlInterface, nullptr, nullptr)
+: Controller(controlInterface, nullptr, nullptr, nullptr)
{
}
Controller::Controller(ControlInterface* controlInterface,
EditableControlInterface* editableControlInterface,
- SelectableControlInterface* selectableControlInterface)
-: mImpl(new Controller::Impl(controlInterface, editableControlInterface, selectableControlInterface))
+ SelectableControlInterface* selectableControlInterface,
+ AnchorControlInterface* anchorControlInterface)
+: mImpl(new Controller::Impl(controlInterface, editableControlInterface, selectableControlInterface, anchorControlInterface))
{
}