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.
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))
{
}