ImageVisual Action::Reload added
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit-internal / dali-toolkit-test-utils / dummy-visual.cpp
1 /*
2  * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 #include "dummy-visual.h"
19
20 #include <dali-toolkit/internal/visuals/visual-factory-cache.h>
21
22 namespace Dali
23 {
24
25 namespace Toolkit
26 {
27
28 namespace Internal
29 {
30
31 typedef IntrusivePtr<VisualFactoryCache> VisualFactoryCachePtr;
32
33 DummyVisualPtr DummyVisual::New( const Property::Map& properties )
34 {
35   VisualFactoryCachePtr factoryCache = new VisualFactoryCache;
36
37   DummyVisualPtr dummyVisualPtr( new DummyVisual( *( factoryCache.Get() ) ) );
38
39   return dummyVisualPtr;
40 }
41
42 DummyVisual::DummyVisual( VisualFactoryCache& factoryCache )
43 : Visual::Base( factoryCache ),
44   mActionCounter( 0 )
45 {
46 }
47
48 void DummyVisual::DoCreatePropertyMap( Property::Map& map ) const
49 {
50   // Implement if required
51 }
52
53 void DummyVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
54 {
55   // Implement if required
56 }
57
58 void DummyVisual::DoSetProperties( const Property::Map& propertyMap )
59 {
60   // Implement if required
61 }
62
63 void DummyVisual::OnSetTransform()
64 {
65   // Implement if required
66 }
67
68 void DummyVisual::DoSetOnStage( Actor& actor )
69 {
70   // Implement if required
71 }
72
73 void DummyVisual::OnDoAction( const Property::Index actionName, const Property::Value& attributes )
74 {
75   if ( DummyVisual::TEST_ACTION == actionName )
76   {
77     mActionCounter++;  // GetActionCounter can be used to test for this.
78   }
79   // Further Actions can be added here
80 }
81
82 unsigned int DummyVisual::GetActionCounter() const
83 {
84   return mActionCounter;
85 }
86
87 void DummyVisual::ResetActionCounter()
88 {
89   mActionCounter = 0;
90 }
91
92 } // Internal
93
94 } // namespace Toolkit
95
96 } // namespace Dali