X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-controller-event-handler.h;h=00288901322d9d248953c1f18c3e28724c58f58a;hp=51d16481cebd1df85b180952b644fc4a97bc4aa8;hb=528ee21711fc507b20ddb031cf6b1d71f1f44e75;hpb=177ce5376e3786645b92fccdaed7b904053ef7f6 diff --git a/dali-toolkit/internal/text/text-controller-event-handler.h b/dali-toolkit/internal/text/text-controller-event-handler.h index 51d1648..0028890 100644 --- a/dali-toolkit/internal/text/text-controller-event-handler.h +++ b/dali-toolkit/internal/text/text-controller-event-handler.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_TEXT_CONTROLLER_EVENT_HANDLER_H /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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. @@ -19,10 +19,10 @@ */ // EXTERNAL INCLUDES +#include #include #include #include -#include // INTERNAL INCLUDES #include @@ -31,28 +31,94 @@ namespace Dali { - namespace Toolkit { - namespace Text { - struct Controller::EventHandler { + /// @copydoc Text::Controller::KeyboardFocusGainEvent + /// @param[in] controller A reference to the controller class static void KeyboardFocusGainEvent(Controller& controller); + + /// @copydoc Text::Controller::KeyboardFocusLostEvent + /// @param[in] controller A reference to the controller class static void KeyboardFocusLostEvent(Controller& controller); + + /// @copydoc Text::Controller::KeyEvent + /// @param[in] controller A reference to the controller class static bool KeyEvent(Controller& controller, const Dali::KeyEvent& keyEvent); + + /// @copydoc Text::Controller::AnchorEvent + /// @param[in] controller A reference to the controller class + static void AnchorEvent(Controller& controller, float x, float y); + + /// @copydoc Text::Controller::TapEvent + /// @param[in] controller A reference to the controller class static void TapEvent(Controller& controller, unsigned int tapCount, float x, float y); + + /// @copydoc Text::Controller::PanEvent + /// @param[in] controller A reference to the controller class static void PanEvent(Controller& controller, GestureState state, const Vector2& displacement); + + /// @copydoc Text::Controller::LongPressEvent + /// @param[in] controller A reference to the controller class static void LongPressEvent(Controller& controller, GestureState state, float x, float y); + + /// @copydoc Text::Controller::SelectEvent + /// @param[in] controller A reference to the controller class static void SelectEvent(Controller& controller, float x, float y, SelectionType selectType); + + /** + * @brief Creates a selection event with a selection index. + * + * It could be called from the SelectText(). + * The start and end parameters are passed through the event. + * + * @param[in] controller A reference to the controller class + * @param[in] start The start selection position. + * @param[in] end The end selection position. + * @param[in] selection type like the range. + */ + static void SelectEvent(Controller& controller, const uint32_t start, const uint32_t end, SelectionType selectType); + + /** + * @brief Process queued events which modify the model. + * @param[in] controller A reference to the controller class + */ static void ProcessModifyEvents(Controller& controller); + + /** + * @brief Used to process an event queued from SetText() + * @param[in] controller A reference to the controller class + */ static void TextReplacedEvent(Controller& controller); + + /** + * @brief Used to process an event queued from key events etc. + * @param[in] controller A reference to the controller class + */ static void TextInsertedEvent(Controller& controller); + + /** + * @brief Used to process an event queued from backspace key etc. + * @param[in] controller A reference to the controller class + */ static void TextDeletedEvent(Controller& controller); + + /** + * @brief Helper to KeyEvent() to handle the backspace or delete key case. + * + * @param[in] controller A reference to the controller class + * @param[in] keyCode The keycode for the key pressed + * @return True if a character was deleted. + */ static bool DeleteEvent(Controller& controller, int keyCode); - static InputMethodContext::CallbackData OnInputMethodContextEvent(Controller& controller, InputMethodContext& inputMethodContext, const InputMethodContext::EventData& inputMethodContextEvent); + + static InputMethodContext::CallbackData OnInputMethodContextEvent(Controller& controller, + InputMethodContext& inputMethodContext, + const InputMethodContext::EventData& inputMethodContextEvent); + static void PasteClipboardItemEvent(Controller& controller); static void DecorationEvent(Controller& controller, HandleType handleType, HandleState state, float x, float y); static void TextPopupButtonTouched(Controller& controller, Dali::Toolkit::TextSelectionPopup::Buttons button);