Change cursor parent from Layer to Actor
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / text-controls / text-selection-popup-impl.cpp
index f35dd4b..6631898 100644 (file)
@@ -35,6 +35,7 @@
 #include <dali-toolkit/public-api/controls/text-controls/text-label.h>
 #include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
 #include <dali-toolkit/devel-api/controls/control-devel.h>
+#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
 #include <dali-toolkit/devel-api/controls/text-controls/text-selection-popup-callback-interface.h>
 #include <dali-toolkit/public-api/visuals/color-visual-properties.h>
 #include <dali-toolkit/public-api/visuals/text-visual-properties.h>
@@ -343,7 +344,7 @@ void TextSelectionPopup::EnableButtons( Toolkit::TextSelectionPopup::Buttons but
   mButtonsChanged = true;
 }
 
-void TextSelectionPopup::RaiseAbove( Layer target )
+void TextSelectionPopup::RaiseAbove( Actor target )
 {
   if( mToolbar )
   {
@@ -494,7 +495,7 @@ void TextSelectionPopup::SetDimensionToCustomise( const PopupCustomisations& set
   } // switch
 }
 
-Size TextSelectionPopup::GetDimensionToCustomise( const PopupCustomisations& settingToCustomise )
+Size TextSelectionPopup::GetDimensionToCustomise( const PopupCustomisations& settingToCustomise ) const
 {
   switch( settingToCustomise )
   {
@@ -567,48 +568,49 @@ void TextSelectionPopup::SetButtonImage( Toolkit::TextSelectionPopup::Buttons bu
    } // switch
 }
 
-std::string TextSelectionPopup::GetButtonImage( Toolkit::TextSelectionPopup::Buttons button )
+const std::string& TextSelectionPopup::GetButtonImage( Toolkit::TextSelectionPopup::Buttons button ) const
 {
-  std::string buttonImageUrl;
   switch ( button )
   {
-    case Toolkit::TextSelectionPopup::CLIPBOARD :
+    case Toolkit::TextSelectionPopup::CLIPBOARD:
     {
-      buttonImageUrl = mClipboardIconImage;
+      return mClipboardIconImage;
       break;
     }
-    case Toolkit::TextSelectionPopup::CUT :
+    case Toolkit::TextSelectionPopup::CUT:
     {
-      buttonImageUrl = mCutIconImage;
+      return mCutIconImage;
       break;
     }
-    case Toolkit::TextSelectionPopup::COPY :
+    case Toolkit::TextSelectionPopup::COPY:
     {
-      buttonImageUrl = mCopyIconImage;
+      return mCopyIconImage;
       break;
     }
-    case Toolkit::TextSelectionPopup::PASTE :
+    case Toolkit::TextSelectionPopup::PASTE:
     {
-      buttonImageUrl = mPasteIconImage;
+      return mPasteIconImage;
       break;
     }
-    case Toolkit::TextSelectionPopup::SELECT :
+    case Toolkit::TextSelectionPopup::SELECT:
     {
-      buttonImageUrl = mSelectIconImage;
+      return mSelectIconImage;
       break;
     }
-    case Toolkit::TextSelectionPopup::SELECT_ALL :
+    case Toolkit::TextSelectionPopup::SELECT_ALL:
     {
-      buttonImageUrl = mSelectAllIconImage;
+      return mSelectAllIconImage;
       break;
     }
-    default :
+    case Toolkit::TextSelectionPopup::NONE:
     {
-      DALI_ASSERT_DEBUG( "TextSelectionPopup GetPopupImage Unknown Button" );
+      break;
     }
   } // switch
 
-  return buttonImageUrl;
+  DALI_ASSERT_DEBUG( "TextSelectionPopup GetPopupImage Unknown Button" );
+  static std::string empty;
+  return empty;
 }
 
 void TextSelectionPopup::SetPressedImage( const std::string& filename )
@@ -700,11 +702,11 @@ std::string TextSelectionPopup::GetPressedImage() const
    if( showIcons )
    {
      option.SetProperty( Toolkit::PushButton::Property::ICON_PADDING, Vector4( 10.0f, 10.0f, 10.0f, 10.0f ) );
-     option.SetProperty( Toolkit::PushButton::Property::ICON_ALIGNMENT, "TOP" );
+     option.SetProperty( Toolkit::DevelButton::Property::LABEL_RELATIVE_ALIGNMENT, "BOTTOM" );
 
      // TODO: This is temporarily disabled until the text-selection-popup image API is changed to strings.
-     //option.SetProperty( Toolkit::PushButton::Property::SELECTED_ICON, button.icon );
-     //option.SetProperty( Toolkit::PushButton::Property::UNSELECTED_ICON, button.icon );
+     //option.SetProperty(  Toolkit::Button::Property::SELECTED_VISUAL, button.icon );
+     //option.SetProperty(  Toolkit::Button::Property::UNSELECTED_VISUAL, button.icon );
    }
 
    // 3. Set the normal option image (blank / Transparent).
@@ -740,7 +742,7 @@ std::string TextSelectionPopup::GetPressedImage() const
    }
  }
 
- std::size_t TextSelectionPopup::GetNumberOfEnabledOptions()
+ std::size_t TextSelectionPopup::GetNumberOfEnabledOptions() const
  {
    std::size_t numberOfOptions = 0u;
    for( std::vector<ButtonRequirement>::const_iterator it = mOrderListOfButtons.begin(), endIt = mOrderListOfButtons.end(); ( it != endIt ); ++it )