+void Popup::SetTailVisibility( bool visible )
+{
+ mTailVisible = visible;
+ mLayoutDirty = true;
+}
+
+const bool Popup::IsTailVisible() const
+{
+ return mTailVisible;
+}
+
+void Popup::SetTailPosition( Vector3 position )
+{
+ mTailPosition = position;
+ mLayoutDirty = true;
+}
+
+const Vector3& Popup::GetTailPosition() const
+{
+ return mTailPosition;
+}
+
+void Popup::SetAnimationDuration( float duration )
+{
+ mAnimationDuration = duration;
+ mLayoutDirty = true;
+}
+
+float Popup::GetAnimationDuration() const
+{
+ return mAnimationDuration;
+}
+
+void Popup::SetAnimationMode( Toolkit::Popup::AnimationMode animationMode )
+{
+ mAnimationMode = animationMode;
+ mLayoutDirty = true;
+}
+
+Toolkit::Popup::AnimationMode Popup::GetAnimationMode() const
+{
+ return mAnimationMode;
+}
+
+void Popup::SetEntryAnimationData( const Property::Map& map )
+{
+ mEntryAnimationData.Clear();
+ Scripting::NewAnimation( map, mEntryAnimationData );
+}
+
+void Popup::SetExitAnimationData( const Property::Map& map )
+{
+ mExitAnimationData.Clear();
+ Scripting::NewAnimation( map, mExitAnimationData );
+}
+
+void Popup::SetAutoHideDelay( int delay )
+{
+ mAutoHideDelay = delay;
+}
+
+int Popup::GetAutoHideDelay() const
+{
+ return mAutoHideDelay;
+}
+
+void Popup::SetBackingEnabled( bool enabled )
+{
+ mBackingEnabled = enabled;
+ mLayoutDirty = true;
+}
+
+const bool Popup::IsBackingEnabled() const
+{
+ return mBackingEnabled;
+}
+
+void Popup::SetBackingColor( Vector4 color )
+{
+ mBackingColor = color;
+ mBacking.SetBackgroundColor( Vector4( color.r, color.g, color.b, 1.0f ) );
+ mLayoutDirty = true;
+}
+
+const Vector4& Popup::GetBackingColor() const
+{
+ return mBackingColor;
+}
+
+void Popup::SetTailUpImage( std::string image )
+{
+ mTailUpImage = image;
+ mLayoutDirty = true;
+}
+
+const std::string& Popup::GetTailUpImage() const
+{
+ return mTailUpImage;
+}
+
+void Popup::SetTailDownImage( std::string image )
+{
+ mTailDownImage = image;
+ mLayoutDirty = true;
+}
+
+const std::string& Popup::GetTailDownImage() const
+{
+ return mTailDownImage;
+}
+
+void Popup::SetTailLeftImage( std::string image )
+{
+ mTailLeftImage = image;
+ mLayoutDirty = true;
+}
+
+const std::string& Popup::GetTailLeftImage() const
+{
+ return mTailLeftImage;
+}
+
+void Popup::SetTailRightImage( std::string image )
+{
+ mTailRightImage = image;
+ mLayoutDirty = true;
+}
+
+const std::string& Popup::GetTailRightImage() const
+{
+ return mTailRightImage;
+}
+
+void Popup::SetTouchTransparent( bool enabled )
+{
+ mTouchTransparent = enabled;
+}
+
+const bool Popup::IsTouchTransparent() const
+{
+ return mTouchTransparent;
+}
+
+void Popup::SetProperty( BaseObject* object, Property::Index propertyIndex, const Property::Value& value )
+{
+ Toolkit::Popup popup = Toolkit::Popup::DownCast( Dali::BaseHandle( object ) );
+
+ if ( popup )
+ {
+ Popup& popupImpl( GetImpl( popup ) );
+
+ switch ( propertyIndex )
+ {
+ case Toolkit::Popup::Property::TITLE:
+ {
+ Property::Map valueMap;
+ if( value.Get( valueMap ) )
+ {
+ popupImpl.SetTitle( Scripting::NewActor( valueMap ) );
+ }
+ break;
+ }
+ case Toolkit::Popup::Property::CONTENT:
+ {
+ Property::Map valueMap;
+ if( value.Get( valueMap ) )
+ {
+ popupImpl.SetContent( Scripting::NewActor( valueMap ) );
+ }
+ break;
+ }
+ case Toolkit::Popup::Property::FOOTER:
+ {
+ Property::Map valueMap;
+ if( value.Get( valueMap ) )
+ {
+ popupImpl.SetFooter( Scripting::NewActor( valueMap ) );
+ }
+ break;
+ }
+ case Toolkit::Popup::Property::DISPLAY_STATE:
+ {
+ std::string valueString;
+ if( value.Get( valueString ) )
+ {
+ Toolkit::Popup::DisplayState displayState( Toolkit::Popup::HIDDEN );
+ if( Scripting::GetEnumeration< Toolkit::Popup::DisplayState >( valueString.c_str(), DisplayStateTable, DisplayStateTableCount, displayState ) )
+ {
+ popupImpl.SetDisplayState( displayState );
+ }
+ }
+ break;
+ }
+ case Toolkit::Popup::Property::TOUCH_TRANSPARENT:
+ {
+ bool valueBool;
+ if( value.Get( valueBool ) )
+ {
+ popupImpl.SetTouchTransparent( valueBool );
+ }
+ break;
+ }
+ case Toolkit::Popup::Property::TAIL_VISIBILITY:
+ {
+ bool valueBool;
+ if( value.Get( valueBool ) )
+ {
+ popupImpl.SetTailVisibility( valueBool );
+ }
+ break;
+ }
+ case Toolkit::Popup::Property::TAIL_POSITION:
+ {
+ Vector3 valueVector3;
+ if( value.Get( valueVector3 ) )
+ {
+ popupImpl.SetTailPosition( valueVector3 );
+ }
+ break;
+ }
+ case Toolkit::Popup::Property::CONTEXTUAL_MODE:
+ {
+ std::string valueString;
+ if( value.Get( valueString ) )
+ {
+ Toolkit::Popup::ContextualMode contextualMode( Toolkit::Popup::BELOW );
+ if( Scripting::GetEnumeration< Toolkit::Popup::ContextualMode >( valueString.c_str(), ContextualModeTable, ContextualModeTableCount, contextualMode ) )
+ {
+ popupImpl.SetContextualMode( contextualMode );
+ }
+ }
+ break;
+ }
+ case Toolkit::Popup::Property::ANIMATION_DURATION:
+ {
+ float valueFloat;
+ if( value.Get( valueFloat ) )
+ {
+ popupImpl.SetAnimationDuration( valueFloat );
+ }
+ break;
+ }
+ case Toolkit::Popup::Property::ANIMATION_MODE:
+ {
+ std::string valueString;
+ if( value.Get( valueString ) )
+ {
+ Toolkit::Popup::AnimationMode animationMode( Toolkit::Popup::FADE );
+ if( Scripting::GetEnumeration< Toolkit::Popup::AnimationMode >( valueString.c_str(), AnimationModeTable, AnimationModeTableCount, animationMode ) )
+ {
+ popupImpl.SetAnimationMode( animationMode );
+ }
+ }
+ break;
+ }
+ case Toolkit::Popup::Property::ENTRY_ANIMATION:
+ {
+ Property::Map valueMap;
+ if( value.Get( valueMap ) )
+ {
+ popupImpl.SetEntryAnimationData( valueMap );
+ }
+ break;
+ }
+ case Toolkit::Popup::Property::EXIT_ANIMATION:
+ {
+ Property::Map valueMap;
+ if( value.Get( valueMap ) )
+ {
+ popupImpl.SetExitAnimationData( valueMap );
+ }
+ break;
+ }
+ case Toolkit::Popup::Property::AUTO_HIDE_DELAY:
+ {
+ int valueInt;
+ if( value.Get( valueInt ) )
+ {
+ popupImpl.SetAutoHideDelay( valueInt );
+ }
+ break;
+ }
+ case Toolkit::Popup::Property::BACKING_ENABLED:
+ {
+ bool valueBool;
+ if( value.Get( valueBool ) )
+ {
+ popupImpl.SetBackingEnabled( valueBool );
+ }
+ break;
+ }
+ case Toolkit::Popup::Property::BACKING_COLOR:
+ {
+ Vector4 valueVector4;
+ if( value.Get( valueVector4 ) )
+ {
+ popupImpl.SetBackingColor( valueVector4 );
+ }
+ break;
+ }
+ case Toolkit::Popup::Property::POPUP_BACKGROUND_IMAGE:
+ {
+ std::string valueString;
+ if( value.Get( valueString ) )
+ {
+ Image image = ResourceImage::New( valueString );
+ if( image )
+ {
+ Toolkit::ImageView actor = Toolkit::ImageView::New( image );
+ popupImpl.SetPopupBackgroundImage( actor );
+ }
+ }
+ break;
+ }
+ case Toolkit::Popup::Property::TAIL_UP_IMAGE:
+ {
+ std::string valueString;
+ if( value.Get( valueString ) )
+ {
+ popupImpl.SetTailUpImage( valueString );
+ }
+ break;
+ }
+ case Toolkit::Popup::Property::TAIL_DOWN_IMAGE:
+ {
+ std::string valueString;
+ if( value.Get( valueString ) )
+ {
+ popupImpl.SetTailDownImage( valueString );
+ }
+ break;
+ }
+ case Toolkit::Popup::Property::TAIL_LEFT_IMAGE:
+ {
+ std::string valueString;
+ if( value.Get( valueString ) )
+ {
+ popupImpl.SetTailLeftImage( valueString );
+ }
+ break;
+ }
+ case Toolkit::Popup::Property::TAIL_RIGHT_IMAGE:
+ {
+ std::string valueString;
+ if( value.Get( valueString ) )
+ {
+ popupImpl.SetTailRightImage( valueString );
+ }
+ break;
+ }
+ }
+ }
+}
+
+Property::Value Popup::GetProperty( BaseObject* object, Property::Index propertyIndex )
+{
+ Property::Value value;
+
+ Toolkit::Popup popup = Toolkit::Popup::DownCast( Dali::BaseHandle( object ) );
+
+ if ( popup )
+ {
+ Popup& popupImpl( GetImpl( popup ) );
+
+ switch ( propertyIndex )
+ {
+ case Toolkit::Popup::Property::TITLE:
+ {
+ Property::Map map;
+ Scripting::CreatePropertyMap( popupImpl.GetTitle(), map );
+ value = map;
+ break;
+ }
+ case Toolkit::Popup::Property::CONTENT:
+ {
+ Property::Map map;
+ Scripting::CreatePropertyMap( popupImpl.GetContent(), map );
+ value = map;
+ break;
+ }
+ case Toolkit::Popup::Property::FOOTER:
+ {
+ Property::Map map;
+ Scripting::CreatePropertyMap( popupImpl.GetFooter(), map );
+ value = map;
+ break;
+ }
+ case Toolkit::Popup::Property::DISPLAY_STATE:
+ {
+ value = Scripting::GetLinearEnumerationName< Toolkit::Popup::DisplayState >( popupImpl.GetDisplayState(), DisplayStateTable, DisplayStateTableCount );
+ break;
+ }
+ case Toolkit::Popup::Property::TOUCH_TRANSPARENT:
+ {
+ value = popupImpl.IsTouchTransparent();
+ break;
+ }
+ case Toolkit::Popup::Property::TAIL_VISIBILITY:
+ {
+ value = popupImpl.IsTailVisible();
+ break;
+ }
+ case Toolkit::Popup::Property::TAIL_POSITION:
+ {
+ value = popupImpl.GetTailPosition();
+ break;
+ }
+ case Toolkit::Popup::Property::CONTEXTUAL_MODE:
+ {
+ value = Scripting::GetLinearEnumerationName< Toolkit::Popup::ContextualMode >( popupImpl.GetContextualMode(), ContextualModeTable, ContextualModeTableCount );
+ break;
+ }
+ case Toolkit::Popup::Property::ANIMATION_DURATION:
+ {
+ value = popupImpl.GetAnimationDuration();
+ break;
+ }
+ case Toolkit::Popup::Property::ANIMATION_MODE:
+ {
+ value = Scripting::GetLinearEnumerationName< Toolkit::Popup::AnimationMode >( popupImpl.GetAnimationMode(), AnimationModeTable, AnimationModeTableCount );
+ break;
+ }
+ case Toolkit::Popup::Property::ENTRY_ANIMATION:
+ {
+ // Note: Cannot retrieve property map from animation.
+ Property::Map map;
+ value = map;
+ break;
+ }
+ case Toolkit::Popup::Property::EXIT_ANIMATION:
+ {
+ // Note: Cannot retrieve property map from animation.
+ Property::Map map;
+ value = map;
+ break;
+ }
+ case Toolkit::Popup::Property::AUTO_HIDE_DELAY:
+ {
+ value = popupImpl.GetAutoHideDelay();
+ break;
+ }
+ case Toolkit::Popup::Property::BACKING_ENABLED:
+ {
+ value = popupImpl.IsBackingEnabled();
+ break;
+ }
+ case Toolkit::Popup::Property::BACKING_COLOR:
+ {
+ value = popupImpl.GetBackingColor();
+ break;
+ }
+ case Toolkit::Popup::Property::POPUP_BACKGROUND_IMAGE:
+ {
+ ResourceImage image = ResourceImage::DownCast( popupImpl.GetPopupBackgroundImage() );
+ if( image )
+ {
+ value = image.GetUrl();
+ }
+ break;
+ }
+ case Toolkit::Popup::Property::TAIL_UP_IMAGE:
+ {
+ value = popupImpl.GetTailUpImage();
+ break;
+ }
+ case Toolkit::Popup::Property::TAIL_DOWN_IMAGE:
+ {
+ value = popupImpl.GetTailDownImage();
+ break;
+ }
+ case Toolkit::Popup::Property::TAIL_LEFT_IMAGE:
+ {
+ value = popupImpl.GetTailLeftImage();
+ break;
+ }
+ case Toolkit::Popup::Property::TAIL_RIGHT_IMAGE:
+ {
+ value = popupImpl.GetTailRightImage();
+ break;
+ }
+ }
+ }
+
+ return value;
+}
+