#include <dali/devel-api/text-abstraction/font-client.h>
// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/controls/text-controls/placeholder-properties.h>
#include <dali-toolkit/internal/text/bidirectional-support.h>
#include <dali-toolkit/internal/text/character-set-conversion.h>
#include <dali-toolkit/internal/text/layouts/layout-parameters.h>
const std::string EMPTY_STRING("");
-const char * const PLACEHOLDER_TEXT = "placeholderText";
-const char * const PLACEHOLDER_TEXT_FOCUSED = "placeholderTextFocused";
-const char * const PLACEHOLDER_COLOR = "placeholderColor";
-const char * const PLACEHOLDER_FONT_FAMILY = "placeholderFontFamily";
-const char * const PLACEHOLDER_FONT_STYLE = "placeholderFontStyle";
-const char * const PLACEHOLDER_POINT_SIZE = "placeholderPointSize";
-const char * const PLACEHOLDER_PIXEL_SIZE = "placeholderPixelSize";
-const char * const PLACEHOLDER_ELLIPSIS = "placeholderEllipsis";
+const char * const PLACEHOLDER_TEXT = "text";
+const char * const PLACEHOLDER_TEXT_FOCUSED = "textFocused";
+const char * const PLACEHOLDER_COLOR = "color";
+const char * const PLACEHOLDER_FONT_FAMILY = "fontFamily";
+const char * const PLACEHOLDER_FONT_STYLE = "fontStyle";
+const char * const PLACEHOLDER_POINT_SIZE = "pointSize";
+const char * const PLACEHOLDER_PIXEL_SIZE = "pixelSize";
+const char * const PLACEHOLDER_ELLIPSIS = "ellipsis";
float ConvertToEven( float value )
{
return Layout::Engine::MULTI_LINE_BOX == mImpl->mLayoutEngine.GetLayout();
}
-void Controller::SetHorizontalAlignment( Layout::HorizontalAlignment alignment )
+void Controller::SetHorizontalAlignment( Text::HorizontalAlignment::Type alignment )
{
if( alignment != mImpl->mModel->mHorizontalAlignment )
{
}
}
-Layout::HorizontalAlignment Controller::GetHorizontalAlignment() const
+Text::HorizontalAlignment::Type Controller::GetHorizontalAlignment() const
{
return mImpl->mModel->mHorizontalAlignment;
}
-void Controller::SetVerticalAlignment( Layout::VerticalAlignment alignment )
+void Controller::SetVerticalAlignment( VerticalAlignment::Type alignment )
{
if( alignment != mImpl->mModel->mVerticalAlignment )
{
}
}
-Layout::VerticalAlignment Controller::GetVerticalAlignment() const
+VerticalAlignment::Type Controller::GetVerticalAlignment() const
{
return mImpl->mModel->mVerticalAlignment;
}
-void Controller::SetLineWrapMode( Layout::LineWrap::Mode lineWrapMode )
+void Controller::SetLineWrapMode( Text::LineWrap::Mode lineWrapMode )
{
if( lineWrapMode != mImpl->mModel->mLineWrapMode )
{
}
}
-Layout::LineWrap::Mode Controller::GetLineWrapMode() const
+Text::LineWrap::Mode Controller::GetLineWrapMode() const
{
return mImpl->mModel->mLineWrapMode;
}
Property::Key& key = keyValue.first;
Property::Value& value = keyValue.second;
- if( key == PLACEHOLDER_TEXT )
+ if( key == Toolkit::Text::PlaceHolder::Property::TEXT || key == PLACEHOLDER_TEXT )
{
std::string text = "";
value.Get( text );
SetPlaceholderText( Controller::PLACEHOLDER_TYPE_INACTIVE, text );
}
- else if( key == PLACEHOLDER_TEXT_FOCUSED )
+ else if( key == Toolkit::Text::PlaceHolder::Property::TEXT_FOCUSED || key == PLACEHOLDER_TEXT_FOCUSED )
{
std::string text = "";
value.Get( text );
SetPlaceholderText( Controller::PLACEHOLDER_TYPE_ACTIVE, text );
}
- else if( key == PLACEHOLDER_COLOR )
+ else if( key == Toolkit::Text::PlaceHolder::Property::COLOR || key == PLACEHOLDER_COLOR )
{
Vector4 textColor;
value.Get( textColor );
SetPlaceholderTextColor( textColor );
}
}
- else if( key == PLACEHOLDER_FONT_FAMILY )
+ else if( key == Toolkit::Text::PlaceHolder::Property::FONT_FAMILY || key == PLACEHOLDER_FONT_FAMILY )
{
std::string fontFamily = "";
value.Get( fontFamily );
SetPlaceholderFontFamily( fontFamily );
}
- else if( key == PLACEHOLDER_FONT_STYLE )
+ else if( key == Toolkit::Text::PlaceHolder::Property::FONT_STYLE || key == PLACEHOLDER_FONT_STYLE )
{
SetFontStyleProperty( this, value, Text::FontStyle::PLACEHOLDER );
}
- else if( key == PLACEHOLDER_POINT_SIZE )
+ else if( key == Toolkit::Text::PlaceHolder::Property::POINT_SIZE || key == PLACEHOLDER_POINT_SIZE )
{
float pointSize;
value.Get( pointSize );
SetPlaceholderTextFontSize( pointSize, Text::Controller::POINT_SIZE );
}
}
- else if( key == PLACEHOLDER_PIXEL_SIZE )
+ else if( key == Toolkit::Text::PlaceHolder::Property::PIXEL_SIZE || key == PLACEHOLDER_PIXEL_SIZE )
{
float pixelSize;
value.Get( pixelSize );
SetPlaceholderTextFontSize( pixelSize, Text::Controller::PIXEL_SIZE );
}
}
- else if( key == PLACEHOLDER_ELLIPSIS )
+ else if( key == Toolkit::Text::PlaceHolder::Property::ELLIPSIS || key == PLACEHOLDER_ELLIPSIS )
{
bool ellipsis;
value.Get( ellipsis );
{
if( !mImpl->mEventData->mPlaceholderTextActive.empty() )
{
- map[ PLACEHOLDER_TEXT_FOCUSED ] = mImpl->mEventData->mPlaceholderTextActive;
+ map[ Text::PlaceHolder::Property::TEXT_FOCUSED ] = mImpl->mEventData->mPlaceholderTextActive;
}
if( !mImpl->mEventData->mPlaceholderTextInactive.empty() )
{
- map[ PLACEHOLDER_TEXT ] = mImpl->mEventData->mPlaceholderTextInactive;
+ map[ Text::PlaceHolder::Property::TEXT ] = mImpl->mEventData->mPlaceholderTextInactive;
}
- map[ PLACEHOLDER_COLOR ] = mImpl->mEventData->mPlaceholderTextColor;
- map[ PLACEHOLDER_FONT_FAMILY ] = GetPlaceholderFontFamily();
+ map[ Text::PlaceHolder::Property::COLOR ] = mImpl->mEventData->mPlaceholderTextColor;
+ map[ Text::PlaceHolder::Property::FONT_FAMILY ] = GetPlaceholderFontFamily();
Property::Value fontStyleMapGet;
GetFontStyleProperty( this, fontStyleMapGet, Text::FontStyle::PLACEHOLDER );
- map[ PLACEHOLDER_FONT_STYLE ] = fontStyleMapGet;
+ map[ Text::PlaceHolder::Property::FONT_STYLE ] = fontStyleMapGet;
// Choose font size : POINT_SIZE or PIXEL_SIZE
if( !mImpl->mEventData->mIsPlaceholderPixelSize )
{
- map[ PLACEHOLDER_POINT_SIZE ] = GetPlaceholderTextFontSize( Text::Controller::POINT_SIZE );
+ map[ Text::PlaceHolder::Property::POINT_SIZE ] = GetPlaceholderTextFontSize( Text::Controller::POINT_SIZE );
}
else
{
- map[ PLACEHOLDER_PIXEL_SIZE ] = GetPlaceholderTextFontSize( Text::Controller::PIXEL_SIZE );
+ map[ Text::PlaceHolder::Property::PIXEL_SIZE ] = GetPlaceholderTextFontSize( Text::Controller::PIXEL_SIZE );
}
if( mImpl->mEventData->mPlaceholderEllipsisFlag )
{
- map[ PLACEHOLDER_ELLIPSIS ] = IsPlaceholderTextElideEnabled();
+ map[ Text::PlaceHolder::Property::ELLIPSIS ] = IsPlaceholderTextElideEnabled();
}
}
}
switch( mImpl->mModel->mVerticalAlignment )
{
- case Layout::VERTICAL_ALIGN_TOP:
+ case VerticalAlignment::TOP:
{
mImpl->mModel->mScrollPosition.y = 0.f;
break;
}
- case Layout::VERTICAL_ALIGN_CENTER:
+ case VerticalAlignment::CENTER:
{
mImpl->mModel->mScrollPosition.y = floorf( 0.5f * ( controlSize.height - layoutSize.height ) ); // try to avoid pixel alignment.
break;
}
- case Layout::VERTICAL_ALIGN_BOTTOM:
+ case VerticalAlignment::BOTTOM:
{
mImpl->mModel->mScrollPosition.y = controlSize.height - layoutSize.height;
break;