Changed 'virtual' function override declarations to 'override' in automated-tests.
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit-internal / dali-toolkit-test-utils / dummy-visual.h
1 #ifndef DALI_TOOLKIT_TEST_DUMMY_VISUAL_H
2 #define DALI_TOOLKIT_TEST_DUMMY_VISUAL_H
3
4 /*
5  * Copyright (c) 2019 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali-toolkit/dali-toolkit.h>
23 #include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
24 #include <dali-toolkit/devel-api/visual-factory/visual-base.h>
25
26 #include <dali-toolkit/internal/visuals/visual-base-impl.h>
27
28 // EXTERNAL INCLUDES
29 #include <dali/public-api/common/intrusive-ptr.h>
30
31 namespace Dali
32 {
33
34 namespace Toolkit
35 {
36
37 namespace Internal
38 {
39
40 class DummyVisual;
41
42 typedef IntrusivePtr< DummyVisual > DummyVisualPtr;
43
44 /**
45  * Dummy Visual that can be used for testing
46  * Cannot create an instance of an existing Visual, so use this dummy class for the implementation.
47  */
48 class DummyVisual : public Visual::Base
49 {
50 public:
51
52   // Actions that the dummy visual can perform.  These actions are called through the Visual::Base::DoAction API.
53   enum Type
54   {
55     TEST_ACTION = 0,  ///< Updates the action counter
56   };
57
58 public:
59
60   // Constructor for DummyVisual
61   static DummyVisualPtr New( const Property::Map& properties );
62
63   // Prevent default methods being used.
64   DummyVisual( const DummyVisual& dummyVisual ) = delete;
65   DummyVisual( const DummyVisual&& dummyVisual ) = delete;
66   DummyVisual& operator=( const DummyVisual& dummyVisual ) = delete;
67   DummyVisual& operator=( const DummyVisual&& dummyVisual ) = delete;
68
69   // Get the Action counter, action counter incremented with every successful Action
70   unsigned int GetActionCounter() const;
71   // Reset the Action counter to 0;
72   void ResetActionCounter();
73
74 protected:
75
76   DummyVisual( VisualFactoryCache& factoryCache );
77
78   void DoCreatePropertyMap( Property::Map& map ) const override;
79   void DoCreateInstancePropertyMap( Property::Map& map ) const override;
80   void DoSetProperties( const Property::Map& propertyMap ) override;
81   void OnSetTransform() override;
82   void DoSetOnScene( Actor& actor ) override;
83   void OnDoAction( const Property::Index actionName, const Property::Value& attributes ) override;
84
85 private:
86   unsigned int mActionCounter;
87
88 };
89
90
91 } // Internal
92
93 } // namespace Toolkit
94
95 } // namespace Dali
96
97 #endif // DALI_TOOLKIT_TEST_DUMMY_VISUAL_H