Purge underscored header file barriers
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / dummy-control.h
index 7791006..1f32459 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_TEST_DUMMY_CONTROL_H__
-#define __DALI_TOOLKIT_TEST_DUMMY_CONTROL_H__
+#ifndef DALI_TOOLKIT_TEST_DUMMY_CONTROL_H
+#define DALI_TOOLKIT_TEST_DUMMY_CONTROL_H
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,6 +21,9 @@
 // INTERNAL INCLUDES
 #include <dali-toolkit/dali-toolkit.h>
 
+// EXTERNAL INCLUDES
+#include <functional>
+
 namespace Dali
 {
 
@@ -28,6 +31,12 @@ namespace Toolkit
 {
 
 class DummyControlImpl;
+class TransitionData;
+
+namespace Visual
+{
+class Base;
+}
 
 /**
  * Control does not have a New method so use this dummy class for the handle.
@@ -35,6 +44,23 @@ class DummyControlImpl;
 class DummyControl : public Control
 {
 public:
+  enum PropertyRange
+  {
+    PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1, ///< @SINCE_1_0.0
+    PROPERTY_END_INDEX =   PROPERTY_START_INDEX + 1000              ///< Reserve property index
+  };
+
+  struct Property
+  {
+    enum Type
+    {
+      TEST_VISUAL = PROPERTY_START_INDEX,
+      TEST_VISUAL2,
+      FOREGROUND_VISUAL,
+      FOCUS_VISUAL,
+      LABEL_VISUAL
+    };
+  };
 
   DummyControl();
   DummyControl(const DummyControl& control);
@@ -57,7 +83,7 @@ public: // Not intended for application developers
  * Cannot create an instance of Internal::Control, so use this dummy class for the implementation.
  * This class does not override any of Internal::Control's behaviour.
  */
-class DummyControlImpl : public Internal::Control
+class DummyControlImpl : public Toolkit::Internal::Control
 {
 public:
 
@@ -71,10 +97,26 @@ public:
   inline TapGestureDetector GetTapGestureDetector() const { return Internal::Control::GetTapGestureDetector(); }
   inline LongPressGestureDetector GetLongPressGestureDetector() const { return Internal::Control::GetLongPressGestureDetector(); }
 
+  void RegisterVisual( Property::Index index, Toolkit::Visual::Base visual);
+  void RegisterVisual( Property::Index index, Toolkit::Visual::Base visual, bool enabled );
+  void UnregisterVisual( Property::Index index );
+  void EnableVisual( Property::Index index, bool enabled );
+  bool IsVisualEnabled( Property::Index index );
+  int GetVisualCount();
+  Toolkit::Visual::Base GetVisual( Property::Index index );
+  Animation CreateTransition( const Toolkit::TransitionData& transition );
+  void DoAction( Dali::Property::Index index, Dali::Property::Index action, const Dali::Property::Value attributes );
+
+  static void SetProperty( BaseObject* object, Dali::Property::Index index, const Dali::Property::Value& value );
+
+  static Property::Value GetProperty( BaseObject* object, Dali::Property::Index propertyIndex );
+
   // Used to test signal connections
   void CustomSlot1( Actor actor );
 
   bool mCustomSlot1Called;
+  typedef std::vector<Property::Index> VisualIndices;
+  VisualIndices mRegisteredVisualIndices;
 
 protected:
 
@@ -83,35 +125,48 @@ protected:
   virtual ~DummyControlImpl();
 };
 
+namespace Impl
+{
+
 /**
  * Cannot create an instance of Internal::Control, so use this dummy class for the implementation.
  * This class DOES override Internal::Control's behaviour.
  */
-class DummyControlImplOverride : public DummyControlImpl
+class DummyControl : public Toolkit::DummyControlImpl
 {
 public:
 
-  static DummyControl New();
+  typedef std::function<void( Size )> RelayoutCallbackFunc;
+
+  static Toolkit::DummyControl New();
+
+  void SetLayout( Property::Index visualIndex, Property::Map& map );
+
+  void SetRelayoutCallback( RelayoutCallbackFunc callback );
 
 private:
 
-  DummyControlImplOverride();
+  DummyControl();
 
-  virtual ~DummyControlImplOverride();
+  virtual ~DummyControl();
 
 private: // From Internal::Control
 
   virtual void OnInitialize();
-  virtual void OnActivated();
+  virtual bool OnAccessibilityActivated();
+  virtual bool OnAccessibilityTouch( const TouchEvent& touchEvent );
+  virtual bool OnAccessibilityValueChange( bool isIncrease );
+
   virtual void OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change );
   virtual void OnPinch(const PinchGesture& pinch);
   virtual void OnPan(const PanGesture& pan);
   virtual void OnTap(const TapGesture& tap);
   virtual void OnLongPress(const LongPressGesture& longPress);
+  virtual Vector3 GetNaturalSize();
 
 private: // From CustomActorImpl
 
-  virtual void OnStageConnection();
+  virtual void OnStageConnection( int depth );
   virtual void OnStageDisconnection();
   virtual void OnChildAdd(Actor& child);
   virtual void OnChildRemove(Actor& child);
@@ -119,15 +174,21 @@ private: // From CustomActorImpl
   virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize);
   virtual bool OnTouchEvent(const TouchEvent& event);
   virtual bool OnHoverEvent(const HoverEvent& event);
-  virtual bool OnMouseWheelEvent(const MouseWheelEvent& event);
+  virtual bool OnWheelEvent(const WheelEvent& event);
   virtual bool OnKeyEvent(const KeyEvent& event);
   virtual void OnKeyInputFocusGained();
   virtual void OnKeyInputFocusLost();
+  virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
+
+  DALI_INTERNAL DummyControl( const DummyControl& );
+  DALI_INTERNAL DummyControl& operator=( const DummyControl& );
 
 public:
 
   bool initializeCalled;
   bool activatedCalled;
+  bool onAccTouchedCalled;
+  bool onAccValueChangeCalled;
   bool themeChangeCalled;
   bool fontChangeCalled;
   bool pinchCalled;
@@ -142,14 +203,22 @@ public:
   bool sizeAnimationCalled;
   bool touchEventCalled;
   bool hoverEventCalled;
-  bool mouseWheelEventCalled;
+  bool wheelEventCalled;
   bool keyEventCalled;
   bool keyInputFocusGained;
   bool keyInputFocusLost;
+  static int constructorCount;
+  static int destructorCount;
+
+  Property::Map mLayouts;
+  RelayoutCallbackFunc mRelayoutCallback;
+
 };
 
+} // namespace Impl
+
 } // namespace Toolkit
 
 } // namespace Dali
 
-#endif // __DALI_TOOLKIT_TEST_DUMMY_CONTROL_H__
+#endif // DALI_TOOLKIT_TEST_DUMMY_CONTROL_H