// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control.h>
#include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali-toolkit/devel-api/styling/style-manager.h>
+#include <dali-toolkit/public-api/styling/style-manager.h>
#include <dali-toolkit/internal/feedback/feedback-style.h>
namespace
}
StyleManager::StyleManager()
-: mOrientationDegrees( 0 ), // Portrait
- mDefaultFontSize( -1 ),
+: mDefaultFontSize( -1 ),
mDefaultFontFamily(""),
mFeedbackStyle( NULL )
{
delete mFeedbackStyle;
}
-void StyleManager::SetOrientationValue( int orientation )
+void StyleManager::ApplyTheme( const std::string& themeFile )
{
- if( orientation != mOrientationDegrees )
- {
- mOrientationDegrees = orientation;
- // TODO: if orientation changed, apply the new style to all controls
- // dont want to really do the whole load from file again if the bundle contains both portrait & landscape
- SetTheme( mThemeFile );
- }
-}
-
-int StyleManager::GetOrientationValue()
-{
- return mOrientationDegrees;
-}
-
-void StyleManager::SetOrientation( Orientation orientation )
-{
- if( mOrientation )
- {
- mOrientation.ChangedSignal().Disconnect( this, &StyleManager::OnOrientationChanged );
- }
-
- OnOrientationChanged( orientation );
-
- if( mOrientation )
- {
- mOrientation.ChangedSignal().Connect( this, &StyleManager::OnOrientationChanged );
- }
+ SetTheme( themeFile );
}
-Orientation StyleManager::GetOrientation()
+void StyleManager::ApplyDefaultTheme()
{
- return mOrientation;
+ std::string empty;
+ SetTheme( empty );
}
-std::string StyleManager::GetDefaultFontFamily() const
+const std::string& StyleManager::GetDefaultFontFamily() const
{
return mDefaultFontFamily;
}
return false;
}
-void StyleManager::RequestThemeChange( const std::string& themeFile )
-{
- SetTheme( themeFile );
-}
-
-void StyleManager::RequestDefaultTheme()
-{
- std::string empty;
- SetTheme( empty );
-}
-
void StyleManager::ApplyThemeStyle( Toolkit::Control control )
{
if( !mThemeBuilder )
{
- RequestDefaultTheme();
+ ApplyDefaultTheme();
}
if( mThemeBuilder )
void StyleManager::CollectQualifiers( StringList& qualifiersOut )
{
// Append the relevant qualifier for orientation
- int orientation = mOrientationDegrees;
-
- if( mOrientation )
- {
- orientation = mOrientation.GetDegrees();
- }
-
+ int orientation = 0; // Get the orientation from the system
switch( orientation )
{
case 90:
}
}
-void StyleManager::OnOrientationChanged( Orientation orientation )
-{
- mOrientation = orientation;
- // TODO: if orientation changed, apply the new style to all controls
- // dont want to really do the whole load from file again if the bundle contains both portrait & landscape
- SetTheme( mThemeFile );
-}
-
-
Toolkit::Builder StyleManager::FindCachedBuilder( const std::string& key )
{
BuilderMap::iterator builderIt = mBuilderCache.find( key );