Dali 3D User Interface Engine
style-monitor-impl.h
Go to the documentation of this file.
1 #ifndef __DALI_INTERNAL_STYLE_MONITOR_H__
2 #define __DALI_INTERNAL_STYLE_MONITOR_H__
3 
4 /*
5  * Copyright (c) 2014 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 // EXTERNAL INCLUDES
25 #include <dali/devel-api/text-abstraction/font-client.h>
26 
27 // INTERNAL INCLUDES
28 #include <style-monitor.h>
29 
30 namespace Dali
31 {
32 
33 namespace Internal
34 {
35 
36 namespace Adaptor
37 {
38 
43 class StyleMonitor : public BaseObject
44 {
45 public:
46 
47  // Creation & Destruction
48 
53  StyleMonitor(Integration::PlatformAbstraction& platformAbstraction);
54 
59  static Dali::StyleMonitor Get();
60 
61  // Style Change Notifications
62 
67  void StyleChanged( StyleChange::Type styleChange );
68 
69  // Style Information
70 
74  std::string GetDefaultFontFamily() const;
75 
79  std::string GetDefaultFontStyle() const;
80 
84  int GetDefaultFontSize() const;
85 
89  const std::string& GetTheme() const;
90 
94  void SetTheme(const std::string& themeFilePath);
95 
99  bool LoadThemeFile( const std::string& filename, std::string& output );
100 
101  // Signals
102 
107 
108 protected:
109 
113  virtual ~StyleMonitor();
114 
115 private:
116 
121  inline void EmitStyleChangeSignal( StyleChange::Type styleChange );
122 
123 private:
124 
126 
128 
129  TextAbstraction::FontClient mFontClient;
130  std::string mDefaultFontFamily;
131  std::string mDefaultFontStyle;
134 };
135 
136 } // namespace Adaptor
137 
138 } // namespace Internal
139 
140 // Additional Helpers for public-api forwarding methods
141 
143 {
144  DALI_ASSERT_ALWAYS(monitor && "Monitor handle is empty");
145  BaseObject& handle = monitor.GetBaseObject();
146  return static_cast<Internal::Adaptor::StyleMonitor&>(handle);
147 }
148 
150 {
151  DALI_ASSERT_ALWAYS(monitor && "Monitor handle is empty");
152  const BaseObject& handle = monitor.GetBaseObject();
153  return static_cast<const Internal::Adaptor::StyleMonitor&>(handle);
154 }
155 
156 } // namespace Dali
157 
158 #endif // __DALI_INTERNAL_STYLE_MONITOR_H__
Dali Docs Home
Read more about Dali