1 #ifndef DALI_TOOLKIT_TEXT_CONTROLLER_IMPL_EVENT_HANDLER_H
2 #define DALI_TOOLKIT_TEXT_CONTROLLER_IMPL_EVENT_HANDLER_H
5 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali-toolkit/internal/text/text-controller-impl.h>
31 * Contains all the event handling methods for Text::Controller::Impl
33 struct ControllerImplEventHandler
36 * @brief Processes input events
38 * @param[in] impl A reference to Controller::Impl
39 * @return True if the decorator has been updated
41 static bool ProcessInputEvents(Controller::Impl& impl);
44 * @brief Called by Controller::Impl when a cursor key event is received.
46 * @param controllerImpl A reference to Controller::Impl
47 * @param event The event
49 static void OnCursorKeyEvent(Controller::Impl& controllerImpl, const Event& event);
52 * @brief Called by Controller::Impl when a tap event is received.
54 * @param controllerImpl A reference to Controller::Impl
55 * @param event The event
57 static void OnTapEvent(Controller::Impl& controllerImpl, const Event& event);
60 * @brief Called by Controller::Impl when a pan event is received.
62 * @param controllerImpl A reference to Controller::Impl
63 * @param event The event
65 static void OnPanEvent(Controller::Impl& controllerImpl, const Event& event);
68 * @brief Called by Controller::Impl when a long press event is received.
70 * @param controllerImpl A reference to Controller::Impl
71 * @param event The event
73 static void OnLongPressEvent(Controller::Impl& controllerImpl, const Event& event);
76 * @brief Called by Controller::Impl when a handle event is received.
78 * @param controllerImpl A reference to Controller::Impl
79 * @param event The event
81 static void OnHandleEvent(Controller::Impl& controllerImpl, const Event& event);
84 * @brief Called by Controller::Impl when a select event is received.
86 * @param controllerImpl A reference to Controller::Impl
87 * @param event The event
89 static void OnSelectEvent(Controller::Impl& controllerImpl, const Event& event);
92 * @brief Called by Controller::Impl when a select all event is received.
94 * @param controllerImpl A reference to Controller::Impl
95 * @param event The event
97 static void OnSelectAllEvent(Controller::Impl& controllerImpl);
100 * @brief Called by Controller::Impl when a select none event is received.
102 * @param controllerImpl A reference to Controller::Impl
103 * @param event The event
105 static void OnSelectNoneEvent(Controller::Impl& controllerImpl);
108 * @brief Called by Controller::Impl when a select range event is received.
110 * @param controllerImpl A reference to Controller::Impl
111 * @param event The event
113 static void OnSelectRangeEvent(Controller::Impl& controllerImpl, const Event& event);
117 * @brief Called by OnHandleEvent when we are in the Pressed state.
119 * @param impl A reference to Controller::Impl
120 * @param event The event
121 * @param isSmoothHandlePanEnabled Whether smooth handle pan is enabled
123 static void OnHandlePressed(Controller::Impl& impl, const Event& event, const bool isSmoothHandlePanEnabled);
126 * @brief Called by OnHandleEvent when we are in the Released state.
128 * @param impl A reference to Controller::Impl
129 * @param event The event
130 * @param isSmoothHandlePanEnabled Whether smooth handle pan is enabled
131 * @param handleStopScrolling Whether we should handle stop scrolling or not
133 static void OnHandleReleased(Controller::Impl& impl, const Event& event, const bool isSmoothHandlePanEnabled, const bool handleStopScrolling);
136 * @brief Called by OnHandleEvent when we are in the Scrolling state.
138 * @param impl A reference to Controller::Impl
139 * @param event The event
140 * @param isSmoothHandlePanEnabled Whether smooth handle pan is enabled
142 static void OnHandleScrolling(Controller::Impl& impl, const Event& event, const bool isSmoothHandlePanEnabled);
147 } // namespace Toolkit
151 #endif // DALI_TOOLKIT_TEXT_CONTROLLER_IMPL_EVENT_HANDLER_H