[Tizen] Add WheelEventGeneratedSignal and add clockwise value
[platform/core/uifw/dali-adaptor.git] / dali / integration-api / adaptor-framework / scene-holder.cpp
1 /*
2  * Copyright (c) 2022 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali/integration-api/adaptor-framework/scene-holder.h>
20
21 // EXTERNAL INCLUDES
22 #include <dali/integration-api/events/key-event-integ.h>
23 #include <dali/integration-api/events/touch-event-integ.h>
24 #include <dali/integration-api/events/wheel-event-integ.h>
25 #include <dali/public-api/events/wheel-event.h>
26
27 // INTERNAL INCLUDES
28 #include <dali/integration-api/adaptor-framework/scene-holder-impl.h>
29 #include <dali/public-api/actors/layer.h>
30
31 namespace Dali
32 {
33 namespace Integration
34 {
35 SceneHolder::SceneHolder()
36 {
37 }
38
39 SceneHolder::~SceneHolder()
40 {
41 }
42
43 SceneHolder::SceneHolder(const SceneHolder& handle)
44 : BaseHandle(handle)
45 {
46 }
47
48 SceneHolder::SceneHolder(Internal::Adaptor::SceneHolder* internal)
49 : BaseHandle(internal)
50 {
51 }
52
53 SceneHolder& SceneHolder::operator=(const SceneHolder& rhs)
54 {
55   BaseHandle::operator=(rhs);
56   return *this;
57 }
58
59 void SceneHolder::Add(Actor actor)
60 {
61   GetImplementation(*this).Add(actor);
62 }
63
64 void SceneHolder::Remove(Actor actor)
65 {
66   GetImplementation(*this).Remove(actor);
67 }
68
69 Layer SceneHolder::GetRootLayer() const
70 {
71   return GetImplementation(*this).GetRootLayer();
72 }
73
74 void SceneHolder::SetBackgroundColor(Vector4 color)
75 {
76   GetImplementation(*this).SetBackgroundColor(color);
77 }
78
79 Vector4 SceneHolder::GetBackgroundColor() const
80 {
81   return GetImplementation(*this).GetBackgroundColor();
82 }
83
84 Any SceneHolder::GetNativeHandle() const
85 {
86   return GetImplementation(*this).GetNativeHandle();
87 }
88
89 void SceneHolder::FeedTouchPoint(Dali::TouchPoint& point, int timeStamp)
90 {
91   Integration::Point convertedPoint(point);
92   GetImplementation(*this).FeedTouchPoint(convertedPoint, timeStamp);
93 }
94
95 void SceneHolder::FeedWheelEvent(Dali::WheelEvent& wheelEvent)
96 {
97   Integration::WheelEvent event(static_cast<Integration::WheelEvent::Type>(wheelEvent.GetType()), wheelEvent.GetDirection(), wheelEvent.GetModifiers(), wheelEvent.GetPoint(), wheelEvent.GetDelta(), wheelEvent.GetTime());
98   GetImplementation(*this).FeedWheelEvent(event);
99 }
100
101 void SceneHolder::FeedKeyEvent(Dali::KeyEvent& keyEvent)
102 {
103   Integration::KeyEvent event(keyEvent.GetKeyName(), keyEvent.GetLogicalKey(), keyEvent.GetKeyString(), keyEvent.GetKeyCode(), keyEvent.GetKeyModifier(), keyEvent.GetTime(), static_cast<Integration::KeyEvent::State>(keyEvent.GetState()), keyEvent.GetCompose(), keyEvent.GetDeviceName(), keyEvent.GetDeviceClass(), keyEvent.GetDeviceSubclass());
104   GetImplementation(*this).FeedKeyEvent(event);
105 }
106
107 SceneHolder SceneHolder::Get(Actor actor)
108 {
109   return Internal::Adaptor::SceneHolder::Get(actor);
110 }
111
112 SceneHolder::KeyEventSignalType& SceneHolder::KeyEventSignal()
113 {
114   return GetImplementation(*this).KeyEventSignal();
115 }
116
117 SceneHolder::KeyEventGeneratedSignalType& SceneHolder::KeyEventGeneratedSignal()
118 {
119   return GetImplementation(*this).KeyEventGeneratedSignal();
120 }
121
122 SceneHolder::TouchEventSignalType& SceneHolder::TouchedSignal()
123 {
124   return GetImplementation(*this).TouchedSignal();
125 }
126
127 SceneHolder::WheelEventSignalType& SceneHolder::WheelEventSignal()
128 {
129   return GetImplementation(*this).WheelEventSignal();
130 }
131
132 SceneHolder::WheelEventGeneratedSignalType& SceneHolder::WheelEventGeneratedSignal()
133 {
134   return GetImplementation(*this).WheelEventGeneratedSignal();
135 }
136
137 } // namespace Integration
138
139 } // namespace Dali