1 #ifndef __DALI_TOOLKIT_TOOLKIT_STYLE_MONITOR_H__
2 #define __DALI_TOOLKIT_TOOLKIT_STYLE_MONITOR_H__
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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.
24 #include <dali/public-api/adaptor-framework/common/style-monitor.h>
38 * This creates a stubbed StyleMonitor so that internal Toolkit Adaptor calls work.
39 * Furthermore, it provides an interface to see if certain methods were invoked.
41 class ToolkitStyleMonitor
45 static const std::string DEFAULT_FONT_FAMILY;
46 static const float DEFAULT_FONT_SIZE;
48 public: // Construction & Destruction
50 ToolkitStyleMonitor();
51 ~ToolkitStyleMonitor();
55 StyleMonitor GetStyleMonitor();
57 public: // Signal Emissions
59 void EmitSignalStyleChange(StyleChange styleChange);
61 public: // TEST FUNCTIONS
63 // Enumeration of Adaptor methods
66 GetDefaultFontFamilyType,
67 GetDefaultFontSizeType,
68 SignalStyleChangeType,
73 mFunctionsCalled.Reset();
76 bool WasCalled(TestFuncEnum func)
80 case GetDefaultFontFamilyType: return mFunctionsCalled.GetDefaultFontFamily;
81 case GetDefaultFontSizeType: return mFunctionsCalled.GetDefaultFontSize;
82 case SignalStyleChangeType: return mFunctionsCalled.SignalStyleChange;
87 void ResetCallStatistics(TestFuncEnum func)
91 case GetDefaultFontFamilyType: mFunctionsCalled.GetDefaultFontFamily = false; break;
92 case GetDefaultFontSizeType: mFunctionsCalled.GetDefaultFontSize = false; break;
93 case SignalStyleChangeType: mFunctionsCalled.SignalStyleChange = false; break;
102 : GetDefaultFontFamily(false),
103 GetDefaultFontSize(false),
104 SignalStyleChange(false)
110 GetDefaultFontFamily = false;
111 GetDefaultFontSize = false;
112 SignalStyleChange = false;
115 bool GetDefaultFontFamily;
116 bool GetDefaultFontSize;
117 bool SignalStyleChange;
120 TestFunctions mFunctionsCalled;
122 // The StyleMonitor stub
123 Internal::Adaptor::StyleMonitor* mStyleMonitorStub;
124 friend class Internal::Adaptor::StyleMonitor;
125 StyleMonitor mStyleMonitor; // Hold a handle ourselves.
130 #endif // __DALI_TOOLKIT_TOOLKIT_STYLE_MONITOR_H__