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;
31 class ControlRenderer;
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 void RegisterVisual( Property::Index index, Toolkit::Visual::Base visual);
75 void RegisterVisual( Property::Index index, Toolkit::Visual::Base visual, bool enabled );
76 void UnregisterVisual( Property::Index index );
77 void EnableVisual( Property::Index index, bool enabled );
78 bool IsVisualEnabled( Property::Index indepx );
80 Toolkit::Visual::Base GetVisual( Property::Index index );
81 Animation CreateTransition( const Toolkit::TransitionData& transition );
83 // Used to test signal connections
84 void CustomSlot1( Actor actor );
86 bool mCustomSlot1Called;
92 virtual ~DummyControlImpl();
96 * Cannot create an instance of Internal::Control, so use this dummy class for the implementation.
97 * This class DOES override Internal::Control's behaviour.
99 class DummyControlImplOverride : public DummyControlImpl
103 static DummyControl New();
107 DummyControlImplOverride();
109 virtual ~DummyControlImplOverride();
111 private: // From Internal::Control
113 virtual void OnInitialize();
114 virtual bool OnAccessibilityActivated();
115 virtual bool OnAccessibilityTouch( const TouchEvent& touchEvent );
116 virtual bool OnAccessibilityValueChange( bool isIncrease );
118 virtual void OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change );
119 virtual void OnPinch(const PinchGesture& pinch);
120 virtual void OnPan(const PanGesture& pan);
121 virtual void OnTap(const TapGesture& tap);
122 virtual void OnLongPress(const LongPressGesture& longPress);
124 private: // From CustomActorImpl
126 virtual void OnStageConnection( int depth );
127 virtual void OnStageDisconnection();
128 virtual void OnChildAdd(Actor& child);
129 virtual void OnChildRemove(Actor& child);
130 virtual void OnSizeSet(const Vector3& targetSize);
131 virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize);
132 virtual bool OnTouchEvent(const TouchEvent& event);
133 virtual bool OnHoverEvent(const HoverEvent& event);
134 virtual bool OnWheelEvent(const WheelEvent& event);
135 virtual bool OnKeyEvent(const KeyEvent& event);
136 virtual void OnKeyInputFocusGained();
137 virtual void OnKeyInputFocusLost();
141 bool initializeCalled;
142 bool activatedCalled;
143 bool onAccTouchedCalled;
144 bool onAccValueChangeCalled;
145 bool themeChangeCalled;
146 bool fontChangeCalled;
150 bool longPressCalled;
151 bool stageConnectionCalled;
152 bool stageDisconnectionCalled;
154 bool childRemoveCalled;
156 bool sizeAnimationCalled;
157 bool touchEventCalled;
158 bool hoverEventCalled;
159 bool wheelEventCalled;
161 bool keyInputFocusGained;
162 bool keyInputFocusLost;
165 } // namespace Toolkit
169 #endif // __DALI_TOOLKIT_TEST_DUMMY_CONTROL_H__