1 #ifndef __DALI_TOOLKIT_TEST_DUMMY_CONTROL_H__
2 #define __DALI_TOOLKIT_TEST_DUMMY_CONTROL_H__
5 * Copyright (c) 2014 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/dali-toolkit.h>
30 class DummyControlImpl;
33 * Control does not have a New method so use this dummy class for the handle.
35 class DummyControl : public Control
40 DummyControl(const DummyControl& control);
41 virtual ~DummyControl();
43 static DummyControl New( bool override = false );
45 static DummyControl DownCast( BaseHandle handle );
48 DummyControl& operator=(const DummyControl& control);
50 // Used to test signal connections
51 void CustomSlot1( Actor actor, const Vector3& value );
55 bool mCustomSlot1Called;
56 Vector3 mCustomSlot1Value;
58 public: // Not intended for application developers
60 DummyControl( DummyControlImpl& implementation );
61 DummyControl( Dali::Internal::CustomActor* internal );
65 * Cannot create an instance of ControlImpl, so use this dummy class for the implementation.
66 * This class does not override any of ControlImpl's behaviour.
68 class DummyControlImpl : public ControlImpl
72 static DummyControl New();
75 inline void EnableGestureDetection(Gesture::Type type) { ControlImpl::EnableGestureDetection(type); }
76 inline void DisableGestureDetection(Gesture::Type type) { ControlImpl::DisableGestureDetection(type); }
77 inline PinchGestureDetector GetPinchGestureDetector() const { return ControlImpl::GetPinchGestureDetector(); }
78 inline PanGestureDetector GetPanGestureDetector() const { return ControlImpl::GetPanGestureDetector(); }
79 inline TapGestureDetector GetTapGestureDetector() const { return ControlImpl::GetTapGestureDetector(); }
80 inline LongPressGestureDetector GetLongPressGestureDetector() const { return ControlImpl::GetLongPressGestureDetector(); }
86 virtual ~DummyControlImpl();
90 * Cannot create an instance of ControlImpl, so use this dummy class for the implementation.
91 * This class DOES override ControlImpl's behaviour.
93 class DummyControlImplOverride : public DummyControlImpl
97 static DummyControl New();
101 DummyControlImplOverride();
103 virtual ~DummyControlImplOverride();
105 private: // From ControlImpl
107 virtual void OnInitialize();
108 virtual void OnStyleChange(StyleChange change);
109 virtual void OnPinch(PinchGesture pinch);
110 virtual void OnPan(PanGesture pan);
111 virtual void OnTap(TapGesture tap);
112 virtual void OnLongPress(LongPressGesture longPress);
114 private: // From CustomActorImpl
116 virtual void OnStageConnection();
117 virtual void OnStageDisconnection();
118 virtual void OnChildAdd(Actor& child);
119 virtual void OnChildRemove(Actor& child);
120 virtual void OnSizeSet(const Vector3& targetSize);
121 virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize);
122 virtual bool OnTouchEvent(const TouchEvent& event);
123 virtual bool OnMouseWheelEvent(const MouseWheelEvent& event);
124 virtual bool OnKeyEvent(const KeyEvent& event);
125 virtual void OnKeyInputFocusGained();
126 virtual void OnKeyInputFocusLost();
130 bool initializeCalled;
131 bool styleChangeCalled;
135 bool longPressCalled;
136 bool stageConnectionCalled;
137 bool stageDisconnectionCalled;
139 bool childRemoveCalled;
141 bool sizeAnimationCalled;
142 bool touchEventCalled;
143 bool mouseWheelEventCalled;
145 bool keyInputFocusGained;
146 bool keyInputFocusLost;
149 } // namespace Toolkit
153 #endif // __DALI_TOOLKIT_TEST_DUMMY_CONTROL_H__