}
StyleMonitor::StyleMonitor(Integration::PlatformAbstraction& platformAbstraction)
-: mPlatformAbstraction(platformAbstraction)
+: mPlatformAbstraction(platformAbstraction),
+ mDefaultFontSize(0u)
{
}
void StyleMonitor::StyleChanged(StyleChange styleChange)
{
- if (styleChange.defaultFontChange || styleChange.defaultFontSizeChange)
+ if ( styleChange.defaultFontChange )
{
- //mPlatformAbstraction.UpdateDefaultsFromDevice();
+ mPlatformAbstraction.GetDefaultFontDescription( mDefaultFontFamily, mDefaultFontStyle );
+ }
+ if ( styleChange.defaultFontSizeChange )
+ {
+ mDefaultFontSize = mPlatformAbstraction.GetDefaultFontSize();
}
EmitStyleChangeSignal(styleChange);
std::string StyleMonitor::GetDefaultFontFamily() const
{
- //return mPlatformAbstraction.GetDefaultFontFamily();
- return std::string();
+ return mDefaultFontFamily;
+}
+
+std::string StyleMonitor::GetDefaultFontStyle() const
+{
+ return mDefaultFontStyle;
}
-float StyleMonitor::GetDefaultFontSize() const
+unsigned int StyleMonitor::GetDefaultFontSize() const
{
- //return mPlatformAbstraction.GetDefaultFontSize();
- return float();
+ return mDefaultFontSize;
}
const std::string& StyleMonitor::GetTheme() const
std::string GetDefaultFontFamily() const;
/**
+ * @copydoc Dali::StyleMonitor::GetDefaultFontStyle() const
+ */
+ std::string GetDefaultFontStyle() const;
+
+ /**
* @copydoc Dali::StyleMonitor::GetDefaultFontSize() const
*/
- float GetDefaultFontSize() const;
+ unsigned int GetDefaultFontSize() const;
/**
* @copydoc Dali::StyleMonitor::GetTheme() const
private:
- Dali::StyleMonitor::StyleChangeSignalType mStyleChangeSignal; ///< Emitted when the style changes
+ Dali::StyleMonitor::StyleChangeSignalType mStyleChangeSignal; ///< Emitted when the style changes
- Integration::PlatformAbstraction& mPlatformAbstraction; ///< Reference to the PlatformAbstraction (for retrieving defaults)
- std::string mUserDefinedThemeFilePath;///< String containing the user defined theme file path
+ Integration::PlatformAbstraction& mPlatformAbstraction; ///< Reference to the PlatformAbstraction (for retrieving defaults)
+ std::string mDefaultFontFamily; ///< The default font family
+ std::string mDefaultFontStyle; ///< The default font style
+ std::string mUserDefinedThemeFilePath; ///< String containing the user defined theme file path
+ unsigned int mDefaultFontSize; ///< The default accessibility font size e.g. 0 is smallest
};
} // namespace Adaptor
return GetImplementation(*this).GetDefaultFontFamily();
}
-float StyleMonitor::GetDefaultFontSize() const
+int StyleMonitor::GetDefaultFontSize() const
{
return GetImplementation(*this).GetDefaultFontSize();
}
std::string GetDefaultFontFamily() const;
/**
- * @brief Retrieves the default font size
+ * @brief Retrieves the default font style.
+ * @return The default font style.
+ */
+ std::string GetDefaultFontStyle() const;
+
+ /**
+ * @brief Retrieves the default font size.
+ *
+ * This is an accessibility size, which is mapped to a UI Control specific point-size in stylesheets.
+ * For example if zero the smallest size, this could potentially map to TextLabel point-size 8.
* @return The default font size.
*/
- float GetDefaultFontSize() const;
+ int GetDefaultFontSize() const;
/**
* @brief Retrieves the user defined Theme.
#include "resource-loader/resource-loader.h"
#include "dynamics/dynamics-factory.h"
+#include "slp-font-configuration-parser.h"
#include "image-loaders/image-loader.h"
namespace Dali
namespace
{
+const std::string FONT_CONFIGURATION_FILE( FONT_CONFIGURATION_FILE_PATH ); ///< Default font configuration file
const unsigned int NANOSECS_TO_MICROSECS( 1000 ); ///< 1000 nanoseconds = 1 microsecond
}
}
}
+void SlpPlatformAbstraction::GetDefaultFontDescription( std::string& fontFamily, std::string& fontStyle ) const
+{
+ FontConfigurationParser::Parse(FONT_CONFIGURATION_FILE, fontFamily, fontStyle);
+}
+
+int SlpPlatformAbstraction::GetDefaultFontSize() const
+{
+ int fontSize( 0 );
+
+#ifndef DALI_PROFILE_UBUNTU
+ vconf_get_int( VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, &fontSize );
+#endif // DALI_PROFILE_UBUNTU
+
+ return fontSize;
+}
+
void SlpPlatformAbstraction::GetClosestImageSize( const std::string& filename,
const ImageAttributes& attributes,
Vector2& closestSize )
virtual void JoinLoaderThreads();
/**
+ * @copydoc PlatformAbstraction::GetDefaultFontDescription()
+ */
+ virtual void GetDefaultFontDescription( std::string& family, std::string& style ) const;
+
+ /**
+ * @copydoc PlatformAbstraction::GetDefaultFontSize()
+ */
+ virtual int GetDefaultFontSize() const;
+
+ /**
* @copydoc PlatformAbstraction::SetDpi()
*/
virtual void SetDpi (unsigned int DpiHorizontal, unsigned int DpiVertical);