X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Fdali-toolkit-test-utils%2Fdummy-control.h;h=d991a82bd2693a4db0cf553b8f593c2ee067a536;hp=a42533019235982f022bcedee7a37fcf3218c07e;hb=d65d27692a440b8fb20b69668c32d365ee822320;hpb=6c664b09beef66ee4e223cf30fb17ecdd6889bf7 diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.h index a425330..d991a82 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.h @@ -2,7 +2,7 @@ #define __DALI_TOOLKIT_TEST_DUMMY_CONTROL_H__ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 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 +// EXTERNAL INCLUDES +#include + 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. @@ -45,7 +54,11 @@ public: { enum Type { - TEST_VISUAL = PROPERTY_START_INDEX + TEST_VISUAL = PROPERTY_START_INDEX, + TEST_VISUAL2, + FOREGROUND_VISUAL, + FOCUS_VISUAL, + LABEL_VISUAL }; }; @@ -70,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: @@ -88,10 +101,11 @@ public: 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 indepx ); - + 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 ); @@ -111,21 +125,30 @@ 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 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 @@ -139,6 +162,7 @@ private: // From Internal::Control virtual void OnPan(const PanGesture& pan); virtual void OnTap(const TapGesture& tap); virtual void OnLongPress(const LongPressGesture& longPress); + virtual Vector3 GetNaturalSize(); private: // From CustomActorImpl @@ -156,6 +180,9 @@ private: // From CustomActorImpl 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; @@ -180,8 +207,16 @@ public: bool keyEventCalled; bool keyInputFocusGained; bool keyInputFocusLost; + static int constructorCount; + static int destructorCount; + + Property::Map mLayouts; + RelayoutCallbackFunc mRelayoutCallback; + }; +} // namespace Impl + } // namespace Toolkit } // namespace Dali