// EXTERNAL INCLUDES
#include <dali/public-api/object/type-registry.h>
+#include <fstream>
+#include <sstream>
// INTERNAL INCLUDES
#include <adaptor-impl.h>
EmitStyleChangeSignal(styleChange);
}
+bool StyleMonitor::LoadThemeFile( const std::string& filename, std::string& output )
+{
+ bool retval( false );
+ std::ifstream in( filename.c_str(), std::ios::in );
+ if( in )
+ {
+ std::stringstream buffer;
+ buffer << in.rdbuf();
+
+ output = buffer.str();
+
+ in.close();
+ retval = true;
+ }
+ return retval;
+}
+
Dali::StyleMonitor::StyleChangeSignalType& StyleMonitor::StyleChangeSignal()
{
return mStyleChangeSignal;
*/
void SetTheme(const std::string& themeFilePath);
+ /**
+ * @copydoc Dali::StyleMonitor::LoadThemeFile()
+ */
+ bool LoadThemeFile( const std::string& filename, std::string& output );
+
// Signals
/**
return GetImplementation(*this).SetTheme(themFilePath);
}
+bool StyleMonitor::LoadThemeFile( const std::string& filename, std::string& output )
+{
+ return GetImplementation(*this).LoadThemeFile( filename, output );
+}
+
StyleMonitor::StyleChangeSignalType& StyleMonitor::StyleChangeSignal()
{
return GetImplementation(*this).StyleChangeSignal();
*/
void SetTheme(const std::string& themeFilePath);
+ /**
+ * @brief Utility to load a theme file
+ * @param filename of the theme
+ * @param output to write the contents to
+ * @return true if the load is successful
+ */
+ bool LoadThemeFile( const std::string& filename, std::string& output );
+
public: // Signals
/**