// Properties registered without macro to use specific member variables.
const PropertyRegistration Control::Impl::PROPERTY_1( typeRegistration, "styleName", Toolkit::Control::Property::STYLE_NAME, Property::STRING, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
-const PropertyRegistration Control::Impl::PROPERTY_2( typeRegistration, "backgroundColor", Toolkit::Control::Property::BACKGROUND_COLOR, Property::VECTOR4, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
-const PropertyRegistration Control::Impl::PROPERTY_3( typeRegistration, "backgroundImage", Toolkit::Control::Property::BACKGROUND_IMAGE, Property::MAP, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
+const PropertyRegistration Control::Impl::PROPERTY_2( typeRegistration, "reservedProperty01", Toolkit::Control::Property::RESERVED_PROPERTY_01, Property::VECTOR4, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
+const PropertyRegistration Control::Impl::PROPERTY_3( typeRegistration, "reservedProperty02", Toolkit::Control::Property::RESERVED_PROPERTY_02, Property::MAP, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
const PropertyRegistration Control::Impl::PROPERTY_4( typeRegistration, "keyInputFocus", Toolkit::Control::Property::KEY_INPUT_FOCUS, Property::BOOLEAN, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
const PropertyRegistration Control::Impl::PROPERTY_5( typeRegistration, "background", Toolkit::Control::Property::BACKGROUND, Property::MAP, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
const PropertyRegistration Control::Impl::PROPERTY_6( typeRegistration, "margin", Toolkit::Control::Property::MARGIN, Property::EXTENTS, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
const PropertyRegistration Control::Impl::PROPERTY_12( typeRegistration, "rightFocusableActorId", Toolkit::DevelControl::Property::RIGHT_FOCUSABLE_ACTOR_ID,Property::INTEGER, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
const PropertyRegistration Control::Impl::PROPERTY_13( typeRegistration, "upFocusableActorId", Toolkit::DevelControl::Property::UP_FOCUSABLE_ACTOR_ID, Property::INTEGER, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
const PropertyRegistration Control::Impl::PROPERTY_14( typeRegistration, "downFocusableActorId", Toolkit::DevelControl::Property::DOWN_FOCUSABLE_ACTOR_ID, Property::INTEGER, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
+const PropertyRegistration Control::Impl::PROPERTY_15( typeRegistration, "shadow", Toolkit::DevelControl::Property::SHADOW, Property::MAP, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
+
Control::Impl::Impl( Control& controlImpl )
: mControlImpl( controlImpl ),
mLongPressGestureDetector(),
mTooltip( NULL ),
mInputMethodContext(),
- mAutofillItem(),
- mAutofillContainer(),
mFlags( Control::ControlBehaviour( CONTROL_BEHAVIOUR_DEFAULT ) ),
mIsKeyboardNavigationSupported( false ),
- mIsKeyboardFocusGroup( false ),
- mIsAutofillEnabled( false )
+ mIsKeyboardFocusGroup( false )
{
}
}
break;
- case Toolkit::Control::Property::BACKGROUND_COLOR:
- {
- DALI_LOG_WARNING( "BACKGROUND_COLOR property is deprecated. Use BACKGROUND property instead\n" );
- controlImpl.SetBackgroundColor( value.Get< Vector4 >() );
- break;
- }
-
- case Toolkit::Control::Property::BACKGROUND_IMAGE:
- {
- DALI_LOG_WARNING( "BACKGROUND_IMAGE property is deprecated. Use BACKGROUND property instead\n" );
- Image image = Scripting::NewImage( value );
- if ( image )
- {
- controlImpl.SetBackgroundImage( image );
- }
- else
- {
- // An empty image means the background is no longer required
- controlImpl.ClearBackground();
- }
- break;
- }
-
case Toolkit::Control::Property::KEY_INPUT_FOCUS:
{
if ( value.Get< bool >() )
break;
}
+ case Toolkit::DevelControl::Property::SHADOW:
+ {
+ const Property::Map* map = value.GetMap();
+ if( map && !map->Empty() )
+ {
+ controlImpl.mImpl->SetShadow( *map );
+ }
+ else
+ {
+ // The shadow is an empty property map, so we should clear the shadow
+ controlImpl.mImpl->ClearShadow();
+ }
+ break;
+ }
+
}
}
}
break;
}
- case Toolkit::Control::Property::BACKGROUND_COLOR:
- {
- DALI_LOG_WARNING( "BACKGROUND_COLOR property is deprecated. Use BACKGROUND property instead\n" );
- value = controlImpl.GetBackgroundColor();
- break;
- }
-
- case Toolkit::Control::Property::BACKGROUND_IMAGE:
- {
- DALI_LOG_WARNING( "BACKGROUND_IMAGE property is deprecated. Use BACKGROUND property instead\n" );
- Property::Map map;
- Toolkit::Visual::Base visual = controlImpl.mImpl->GetVisual( Toolkit::Control::Property::BACKGROUND );
- if( visual )
- {
- visual.CreatePropertyMap( map );
- }
- value = map;
- break;
- }
-
case Toolkit::Control::Property::KEY_INPUT_FOCUS:
{
value = controlImpl.HasKeyInputFocus();
value = map;
break;
}
+
+ case Toolkit::DevelControl::Property::SHADOW:
+ {
+ Property::Map map;
+ Toolkit::Visual::Base visual = controlImpl.mImpl->GetVisual( Toolkit::DevelControl::Property::SHADOW );
+ if( visual )
+ {
+ visual.CreatePropertyMap( map );
+ }
+
+ value = map;
+ break;
+ }
}
}
return mVisualEventSignal;
}
-void Control::Impl::SetAutofillEnabled( bool autofillEnabled )
-{
- mIsAutofillEnabled = autofillEnabled;
-}
-
-bool Control::Impl::IsAutofillEnabled()
+void Control::Impl::SetShadow( const Property::Map& map )
{
- return mIsAutofillEnabled;
-}
+ Toolkit::Visual::Base visual = Toolkit::VisualFactory::Get().CreateVisual( map );
+ visual.SetName("shadow");
-void Control::Impl::SetAutofillItemHandle( Dali::AutofillItem item )
-{
- mAutofillItem = item;
-}
+ if( visual )
+ {
+ mControlImpl.mImpl->RegisterVisual( Toolkit::DevelControl::Property::SHADOW, visual, DepthIndex::BACKGROUND_EFFECT );
-Dali::AutofillItem Control::Impl::GetAutofillItemHandle()
-{
- return mAutofillItem;
+ mControlImpl.RelayoutRequest();
+ }
}
-void Control::Impl::SetAutofillContainer( Toolkit::AutofillContainer container )
+void Control::Impl::ClearShadow()
{
- mAutofillContainer = container;
-}
+ mControlImpl.mImpl->UnregisterVisual( Toolkit::DevelControl::Property::SHADOW );
-Toolkit::AutofillContainer Control::Impl::GetAutofillContainer()
-{
- return mAutofillContainer;
+ // Trigger a size negotiation request that may be needed when unregistering a visual.
+ mControlImpl.RelayoutRequest();
}
} // namespace Internal