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 Flora License, Version 1.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://floralicense.org/license/
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.
21 #include <dali-toolkit/dali-toolkit.h>
29 class DummyControlImpl;
32 * Control does not have a New method so use this dummy class for the handle.
34 class DummyControl : public Control
39 DummyControl(const DummyControl& control);
40 virtual ~DummyControl();
42 static DummyControl New( bool override = false );
44 static DummyControl DownCast( BaseHandle handle );
47 DummyControl& operator=(const DummyControl& control);
49 // Used to test signal connections
50 void CustomSlot1( Actor actor, const Vector3& value );
54 bool mCustomSlot1Called;
55 Vector3 mCustomSlot1Value;
57 public: // Not intended for application developers
59 DummyControl( DummyControlImpl& implementation );
60 DummyControl( Dali::Internal::CustomActor* internal );
64 * Cannot create an instance of Internal::Control, so use this dummy class for the implementation.
65 * This class does not override any of Internal::Control's behaviour.
67 class DummyControlImpl : public Internal::Control
71 static DummyControl New();
74 inline void EnableGestureDetection(Gesture::Type type) { Internal::Control::EnableGestureDetection(type); }
75 inline void DisableGestureDetection(Gesture::Type type) { Internal::Control::DisableGestureDetection(type); }
76 inline PinchGestureDetector GetPinchGestureDetector() const { return Internal::Control::GetPinchGestureDetector(); }
77 inline PanGestureDetector GetPanGestureDetector() const { return Internal::Control::GetPanGestureDetector(); }
78 inline TapGestureDetector GetTapGestureDetector() const { return Internal::Control::GetTapGestureDetector(); }
79 inline LongPressGestureDetector GetLongPressGestureDetector() const { return Internal::Control::GetLongPressGestureDetector(); }
85 virtual ~DummyControlImpl();
89 * Cannot create an instance of Internal::Control, so use this dummy class for the implementation.
90 * This class DOES override Internal::Control's behaviour.
92 class DummyControlImplOverride : public DummyControlImpl
96 static DummyControl New();
100 DummyControlImplOverride();
102 virtual ~DummyControlImplOverride();
104 private: // From Internal::Control
106 virtual void OnInitialize();
107 virtual void OnStyleChange(StyleChange change);
108 virtual void OnPinch(PinchGesture pinch);
109 virtual void OnPan(PanGesture pan);
110 virtual void OnTap(TapGesture tap);
111 virtual void OnLongPress(LongPressGesture longPress);
113 private: // From CustomActorImpl
115 virtual void OnStageConnection();
116 virtual void OnStageDisconnection();
117 virtual void OnChildAdd(Actor& child);
118 virtual void OnChildRemove(Actor& child);
119 virtual void OnSizeSet(const Vector3& targetSize);
120 virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize);
121 virtual bool OnTouchEvent(const TouchEvent& event);
122 virtual bool OnMouseWheelEvent(const MouseWheelEvent& event);
123 virtual bool OnKeyEvent(const KeyEvent& event);
124 virtual void OnKeyInputFocusGained();
125 virtual void OnKeyInputFocusLost();
129 bool initializeCalled;
130 bool styleChangeCalled;
134 bool longPressCalled;
135 bool stageConnectionCalled;
136 bool stageDisconnectionCalled;
138 bool childRemoveCalled;
140 bool sizeAnimationCalled;
141 bool touchEventCalled;
142 bool mouseWheelEventCalled;
144 bool keyInputFocusGained;
145 bool keyInputFocusLost;
148 } // namespace Toolkit
152 #endif // __DALI_TOOLKIT_TEST_DUMMY_CONTROL_H__