092ac58e714192b3861ab5ac6825ceef6c528837
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / text-controller-event-handler.h
1 #ifndef DALI_TOOLKIT_TEXT_CONTROLLER_EVENT_HANDLER_H
2 #define DALI_TOOLKIT_TEXT_CONTROLLER_EVENT_HANDLER_H
3
4 /*
5  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // EXTERNAL INCLUDES
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>
26
27 // INTERNAL INCLUDES
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>
31
32 namespace Dali
33 {
34 namespace Toolkit
35 {
36 namespace Text
37 {
38 struct Controller::EventHandler
39 {
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 ProcessModifyEvents(Controller& controller);
49   static void TextReplacedEvent(Controller& controller);
50   static void TextInsertedEvent(Controller& controller);
51   static void TextDeletedEvent(Controller& controller);
52   static bool DeleteEvent(Controller& controller, int keyCode);
53
54   static InputMethodContext::CallbackData OnInputMethodContextEvent(Controller&                          controller,
55                                                                     InputMethodContext&                  inputMethodContext,
56                                                                     const InputMethodContext::EventData& inputMethodContextEvent);
57
58   static void PasteClipboardItemEvent(Controller& controller);
59   static void DecorationEvent(Controller& controller, HandleType handleType, HandleState state, float x, float y);
60   static void TextPopupButtonTouched(Controller& controller, Dali::Toolkit::TextSelectionPopup::Buttons button);
61 };
62
63 } // namespace Text
64
65 } // namespace Toolkit
66
67 } // namespace Dali
68
69 #endif // DALI_TOOLKIT_TEXT_CONTROLLER_EVENT_HANDLER_H