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 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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
25 #include <dali/public-api/adaptor-framework/common/style-monitor.h>
39 * This creates a stubbed StyleMonitor so that internal Toolkit Adaptor calls work.
40 * Furthermore, it provides an interface to see if certain methods were invoked.
42 class ToolkitStyleMonitor
46 static const std::string DEFAULT_FONT_FAMILY;
47 static const float DEFAULT_FONT_SIZE;
49 public: // Construction & Destruction
51 ToolkitStyleMonitor();
52 ~ToolkitStyleMonitor();
56 StyleMonitor GetStyleMonitor();
58 public: // Signal Emissions
60 void EmitSignalStyleChange(StyleChange styleChange);
62 public: // TEST FUNCTIONS
64 // Enumeration of Adaptor methods
67 GetDefaultFontFamilyType,
68 GetDefaultFontSizeType,
69 SignalStyleChangeType,
74 mFunctionsCalled.Reset();
77 bool WasCalled(TestFuncEnum func)
81 case GetDefaultFontFamilyType: return mFunctionsCalled.GetDefaultFontFamily;
82 case GetDefaultFontSizeType: return mFunctionsCalled.GetDefaultFontSize;
83 case SignalStyleChangeType: return mFunctionsCalled.SignalStyleChange;
88 void ResetCallStatistics(TestFuncEnum func)
92 case GetDefaultFontFamilyType: mFunctionsCalled.GetDefaultFontFamily = false; break;
93 case GetDefaultFontSizeType: mFunctionsCalled.GetDefaultFontSize = false; break;
94 case SignalStyleChangeType: mFunctionsCalled.SignalStyleChange = false; break;
103 : GetDefaultFontFamily(false),
104 GetDefaultFontSize(false),
105 SignalStyleChange(false)
111 GetDefaultFontFamily = false;
112 GetDefaultFontSize = false;
113 SignalStyleChange = false;
116 bool GetDefaultFontFamily;
117 bool GetDefaultFontSize;
118 bool SignalStyleChange;
121 TestFunctions mFunctionsCalled;
123 // The StyleMonitor stub
124 Internal::Adaptor::StyleMonitor* mStyleMonitorStub;
125 friend class Internal::Adaptor::StyleMonitor;
126 StyleMonitor mStyleMonitor; // Hold a handle ourselves.
131 #endif // __DALI_TOOLKIT_TOOLKIT_STYLE_MONITOR_H__