1 #ifndef DALI_TOOLKIT_TEXT_CONTROLLER_EVENT_HANDLER_H
2 #define DALI_TOOLKIT_TEXT_CONTROLLER_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/devel-api/adaptor-framework/input-method-context.h>
23 #include <dali/public-api/events/gesture-enumerations.h>
24 #include <dali/public-api/events/key-event.h>
25 #include <dali/public-api/math/vector2.h>
28 #include <dali-toolkit/devel-api/controls/text-controls/text-selection-popup.h>
29 #include <dali-toolkit/internal/text/decorator/text-decorator.h>
30 #include <dali-toolkit/internal/text/text-controller.h>
38 struct Controller::EventHandler
40 static void KeyboardFocusGainEvent(Controller& controller);
41 static void KeyboardFocusLostEvent(Controller& controller);
42 static bool KeyEvent(Controller& controller, const Dali::KeyEvent& keyEvent);
43 static void AnchorEvent(Controller& controller, float x, float y);
44 static void TapEvent(Controller& controller, unsigned int tapCount, float x, float y);
45 static void PanEvent(Controller& controller, GestureState state, const Vector2& displacement);
46 static void LongPressEvent(Controller& controller, GestureState state, float x, float y);
47 static void SelectEvent(Controller& controller, float x, float y, SelectionType selectType);
48 static void SelectEvent(Controller& controller, const uint32_t start, const uint32_t end, SelectionType selectType);
49 static void ProcessModifyEvents(Controller& controller);
50 static void TextReplacedEvent(Controller& controller);
51 static void TextInsertedEvent(Controller& controller);
52 static void TextDeletedEvent(Controller& controller);
53 static bool DeleteEvent(Controller& controller, int keyCode);
55 static InputMethodContext::CallbackData OnInputMethodContextEvent(Controller& controller,
56 InputMethodContext& inputMethodContext,
57 const InputMethodContext::EventData& inputMethodContextEvent);
59 static void PasteClipboardItemEvent(Controller& controller);
60 static void DecorationEvent(Controller& controller, HandleType handleType, HandleState state, float x, float y);
61 static void TextPopupButtonTouched(Controller& controller, Dali::Toolkit::TextSelectionPopup::Buttons button);
66 } // namespace Toolkit
70 #endif // DALI_TOOLKIT_TEXT_CONTROLLER_EVENT_HANDLER_H