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);
43 static DummyControl New( bool override = false );
45 static DummyControl DownCast( BaseHandle handle );
48 DummyControl& operator=(const DummyControl& control);
50 public: // Not intended for application developers
52 DummyControl( DummyControlImpl& implementation );
53 DummyControl( Dali::Internal::CustomActor* internal );
57 * Cannot create an instance of Internal::Control, so use this dummy class for the implementation.
58 * This class does not override any of Internal::Control's behaviour.
60 class DummyControlImpl : public Internal::Control
64 static DummyControl New();
67 inline void EnableGestureDetection(Gesture::Type type) { Internal::Control::EnableGestureDetection(type); }
68 inline void DisableGestureDetection(Gesture::Type type) { Internal::Control::DisableGestureDetection(type); }
69 inline PinchGestureDetector GetPinchGestureDetector() const { return Internal::Control::GetPinchGestureDetector(); }
70 inline PanGestureDetector GetPanGestureDetector() const { return Internal::Control::GetPanGestureDetector(); }
71 inline TapGestureDetector GetTapGestureDetector() const { return Internal::Control::GetTapGestureDetector(); }
72 inline LongPressGestureDetector GetLongPressGestureDetector() const { return Internal::Control::GetLongPressGestureDetector(); }
74 // Used to test signal connections
75 void CustomSlot1( Actor actor );
77 bool mCustomSlot1Called;
83 virtual ~DummyControlImpl();
87 * Cannot create an instance of Internal::Control, so use this dummy class for the implementation.
88 * This class DOES override Internal::Control's behaviour.
90 class DummyControlImplOverride : public DummyControlImpl
94 static DummyControl New();
98 DummyControlImplOverride();
100 virtual ~DummyControlImplOverride();
102 private: // From Internal::Control
104 virtual void OnInitialize();
105 virtual bool OnAccessibilityActivated();
106 virtual bool OnAccessibilityTouch( const TouchEvent& touchEvent );
107 virtual bool OnAccessibilityValueChange( bool isIncrease );
109 virtual void OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change );
110 virtual void OnPinch(const PinchGesture& pinch);
111 virtual void OnPan(const PanGesture& pan);
112 virtual void OnTap(const TapGesture& tap);
113 virtual void OnLongPress(const LongPressGesture& longPress);
115 private: // From CustomActorImpl
117 virtual void OnStageConnection( int depth );
118 virtual void OnStageDisconnection();
119 virtual void OnChildAdd(Actor& child);
120 virtual void OnChildRemove(Actor& child);
121 virtual void OnSizeSet(const Vector3& targetSize);
122 virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize);
123 virtual bool OnTouchEvent(const TouchEvent& event);
124 virtual bool OnHoverEvent(const HoverEvent& event);
125 virtual bool OnWheelEvent(const WheelEvent& event);
126 virtual bool OnKeyEvent(const KeyEvent& event);
127 virtual void OnKeyInputFocusGained();
128 virtual void OnKeyInputFocusLost();
132 bool initializeCalled;
133 bool activatedCalled;
134 bool onAccTouchedCalled;
135 bool onAccValueChangeCalled;
136 bool themeChangeCalled;
137 bool fontChangeCalled;
141 bool longPressCalled;
142 bool stageConnectionCalled;
143 bool stageDisconnectionCalled;
145 bool childRemoveCalled;
147 bool sizeAnimationCalled;
148 bool touchEventCalled;
149 bool hoverEventCalled;
150 bool wheelEventCalled;
152 bool keyInputFocusGained;
153 bool keyInputFocusLost;
156 } // namespace Toolkit
160 #endif // __DALI_TOOLKIT_TEST_DUMMY_CONTROL_H__