Dali 3D User Interface Engine
dummy-control.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 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 #include "dummy-control.h"
19 
21 
22 namespace Dali
23 {
24 
25 namespace Toolkit
26 {
27 
29 {
30 }
31 
33 : Control( control )
34 {
35 }
36 
38 {
39 }
40 
42 {
43  return Control::DownCast<DummyControl, DummyControlImpl>(handle);
44 }
45 
47 {
48  Control::operator=( control );
49  return *this;
50 }
51 
52 // Used to test signal connections
54 {
55  mCustomSlot1Called = true;
56 }
57 
59 {
61  DummyControl control( *impl );
62  impl->Initialize();
63  return control;
64 }
65 
67 : Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_HOVER_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS ) ),
68  mCustomSlot1Called(false)
69 {
70 }
71 
72 
74 {
75 }
76 
78 {
80  DummyControl control( *impl );
81  impl->Initialize();
82  return control;
83 }
84 
85 
88  initializeCalled(false),
89  activatedCalled(false),
90  themeChangeCalled( false ),
91  fontChangeCalled( false ),
92  pinchCalled(false),
93  panCalled(false),
94  tapCalled(false),
95  longPressCalled(false),
96  stageConnectionCalled(false),
97  stageDisconnectionCalled(false),
98  childAddCalled(false),
99  childRemoveCalled(false),
100  sizeSetCalled(false),
101  sizeAnimationCalled(false),
102  touchEventCalled(false),
103  hoverEventCalled(false),
104  wheelEventCalled(false),
105  keyEventCalled(false),
106  keyInputFocusGained(false),
107  keyInputFocusLost(false)
108 {
109 }
110 
112 
113 
117 {
120 }
129 void DummyControlImplOverride::OnSizeSet(const Vector3& targetSize) { sizeSetCalled = true; }
131 bool DummyControlImplOverride::OnTouchEvent(const TouchEvent& event) { touchEventCalled = true; return false; }
132 bool DummyControlImplOverride::OnHoverEvent(const HoverEvent& event) { hoverEventCalled = true; return false; }
133 bool DummyControlImplOverride::OnWheelEvent(const WheelEvent& event) { wheelEventCalled = true; return false; }
134 bool DummyControlImplOverride::OnKeyEvent(const KeyEvent& event) { keyEventCalled = true; return false;}
137 
139 {
140  DummyControl control;
141 
142  if (override)
143  {
144  control = DummyControlImplOverride::New();
145  }
146  else
147  {
148  control = DummyControlImpl::New();
149  }
150 
151  return control;
152 }
153 
155 : Control( implementation )
156 {
157 }
158 
160 : Control( internal )
161 {
162  VerifyCustomActorPointer<DummyControlImpl>(internal);
163 }
164 
165 } // namespace Toolkit
166 
167 } // namespace Dali
Dali Docs Home
Read more about Dali