X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-controller.cpp;h=0b0b77dfaa21b52098d72e1c300b66fcd5b67c80;hp=c0f6d686933ff4c37bff575a382b287fadfff261;hb=2cf32ac170f397aacce527efd34909b3fd62efda;hpb=c38ef089812a54c956c8ae5857c6fe369e1da005 diff --git a/dali-toolkit/internal/text/text-controller.cpp b/dali-toolkit/internal/text/text-controller.cpp index c0f6d68..0b0b77d 100644 --- a/dali-toolkit/internal/text/text-controller.cpp +++ b/dali-toolkit/internal/text/text-controller.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -428,7 +428,7 @@ void Controller::SetDefaultFontFamily( const std::string& defaultFontFamily ) mImpl->mFontDefaults->mFontDescription.family = defaultFontFamily; DALI_LOG_INFO( gLogFilter, Debug::General, "Controller::SetDefaultFontFamily %s\n", defaultFontFamily.c_str()); - mImpl->mFontDefaults->familyDefined = true; + mImpl->mFontDefaults->familyDefined = !defaultFontFamily.empty(); // Clear the font-specific data ClearFontData(); @@ -446,26 +446,6 @@ const std::string& Controller::GetDefaultFontFamily() const return EMPTY_STRING; } -void Controller::SetDefaultFontStyle( const std::string& style ) -{ - if( NULL == mImpl->mFontDefaults ) - { - mImpl->mFontDefaults = new FontDefaults(); - } - - mImpl->mFontDefaults->mFontStyle = style; -} - -const std::string& Controller::GetDefaultFontStyle() const -{ - if( NULL != mImpl->mFontDefaults ) - { - return mImpl->mFontDefaults->mFontStyle; - } - - return EMPTY_STRING; -} - void Controller::SetDefaultFontWeight( FontWeight weight ) { if( NULL == mImpl->mFontDefaults ) @@ -482,6 +462,11 @@ void Controller::SetDefaultFontWeight( FontWeight weight ) mImpl->RequestRelayout(); } +bool Controller::IsDefaultFontWeightDefined() const +{ + return mImpl->mFontDefaults->weightDefined; +} + FontWeight Controller::GetDefaultFontWeight() const { if( NULL != mImpl->mFontDefaults ) @@ -508,6 +493,11 @@ void Controller::SetDefaultFontWidth( FontWidth width ) mImpl->RequestRelayout(); } +bool Controller::IsDefaultFontWidthDefined() const +{ + return mImpl->mFontDefaults->widthDefined; +} + FontWidth Controller::GetDefaultFontWidth() const { if( NULL != mImpl->mFontDefaults ) @@ -534,6 +524,11 @@ void Controller::SetDefaultFontSlant( FontSlant slant ) mImpl->RequestRelayout(); } +bool Controller::IsDefaultFontSlantDefined() const +{ + return mImpl->mFontDefaults->slantDefined; +} + FontSlant Controller::GetDefaultFontSlant() const { if( NULL != mImpl->mFontDefaults ) @@ -955,25 +950,6 @@ const std::string& Controller::GetInputFontFamily() const return GetDefaultFontFamily(); } -void Controller::SetInputFontStyle( const std::string& fontStyle ) -{ - if( NULL != mImpl->mEventData ) - { - mImpl->mEventData->mInputStyle.fontStyle = fontStyle; - } -} - -const std::string& Controller::GetInputFontStyle() const -{ - if( NULL != mImpl->mEventData ) - { - return mImpl->mEventData->mInputStyle.fontStyle; - } - - // Return the default font's style if there is no EventData. - return GetDefaultFontStyle(); -} - void Controller::SetInputFontWeight( FontWeight weight ) { if( NULL != mImpl->mEventData ) @@ -1018,6 +994,18 @@ void Controller::SetInputFontWeight( FontWeight weight ) } } +bool Controller::IsInputFontWeightDefined() const +{ + bool defined = false; + + if( NULL != mImpl->mEventData ) + { + defined = mImpl->mEventData->mInputStyle.weightDefined; + } + + return defined; +} + FontWeight Controller::GetInputFontWeight() const { if( NULL != mImpl->mEventData ) @@ -1072,6 +1060,18 @@ void Controller::SetInputFontWidth( FontWidth width ) } } +bool Controller::IsInputFontWidthDefined() const +{ + bool defined = false; + + if( NULL != mImpl->mEventData ) + { + defined = mImpl->mEventData->mInputStyle.widthDefined; + } + + return defined; +} + FontWidth Controller::GetInputFontWidth() const { if( NULL != mImpl->mEventData ) @@ -1126,6 +1126,18 @@ void Controller::SetInputFontSlant( FontSlant slant ) } } +bool Controller::IsInputFontSlantDefined() const +{ + bool defined = false; + + if( NULL != mImpl->mEventData ) + { + defined = mImpl->mEventData->mInputStyle.slantDefined; + } + + return defined; +} + FontSlant Controller::GetInputFontSlant() const { if( NULL != mImpl->mEventData )