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=643c8b83ab53bb3e4ffd56d3c230bb0be75caa1d;hb=2cf32ac170f397aacce527efd34909b3fd62efda;hpb=9526fca4abb513608cbd7fa15df39c4a69c12e0d diff --git a/dali-toolkit/internal/text/text-controller.cpp b/dali-toolkit/internal/text/text-controller.cpp index 643c8b8..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. @@ -164,7 +164,7 @@ void Controller::SetAutoScrollEnabled( bool enable ) } else { - DALI_LOG_WARNING( "Attempted AutoScrolling on a non SINGLE_LINE_BOX, request ignored" ); + DALI_LOG_WARNING( "Attempted AutoScrolling on a non SINGLE_LINE_BOX, request ignored\n" ); mImpl->mAutoScrollEnabled = false; } } @@ -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 ) @@ -572,7 +567,7 @@ float Controller::GetDefaultPointSize() const void Controller::UpdateAfterFontChange( const std::string& newDefaultFont ) { - DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::UpdateAfterFontChange"); + DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::UpdateAfterFontChange\n"); if( !mImpl->mFontDefaults->familyDefined ) // If user defined font then should not update when system font changes { @@ -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 ) @@ -1980,7 +1992,7 @@ void Controller::KeyboardFocusGainEvent() mImpl->ChangeState( EventData::EDITING ); mImpl->mEventData->mUpdateCursorPosition = true; //If editing started without tap event, cursor update must be triggered. } - + mImpl->NotifyImfMultiLineStatus(); if( mImpl->IsShowingPlaceholderText() ) { // Show alternative placeholder-text when editing @@ -2172,7 +2184,7 @@ void Controller::InsertText( const std::string& text, Controller::InsertType typ { if( !mImpl->mEventData->mPreEditFlag ) { - DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Entered PreEdit state" ); + DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Entered PreEdit state\n" ); // Record the start of the pre-edit text mImpl->mEventData->mPreEditStartPosition = mImpl->mEventData->mPrimaryCursorPosition;