TextSelectionPopup buttons can be enabled from TextController
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / decorator / text-decorator.cpp
index b2fcda0..6bc65c5 100644 (file)
@@ -211,6 +211,7 @@ struct Decorator::Impl : public ConnectionTracker
 
   Impl( ControllerInterface& controller )
   : mController( controller ),
+    mEnabledPopupButtons( TextSelectionPopup::NONE ),
     mBoundingBox( Rect<int>() ),
     mHighlightColor( LIGHT_BLUE ),
     mActiveCursor( ACTIVE_CURSOR_NONE ),
@@ -393,7 +394,7 @@ struct Decorator::Impl : public ConnectionTracker
     {
       if ( !mCopyPastePopup )
       {
-        mCopyPastePopup = TextSelectionPopup::New();
+        mCopyPastePopup = TextSelectionPopup::New( mEnabledPopupButtons );
 #ifdef DECORATOR_DEBUG
         mCopyPastePopup.SetName("mCopyPastePopup");
 #endif
@@ -1065,6 +1066,7 @@ struct Decorator::Impl : public ConnectionTracker
   ImageActor          mSecondaryCursor;
   MeshActor           mHighlightMeshActor;        ///< Mesh Actor to display highlight
   TextSelectionPopup  mCopyPastePopup;
+  TextSelectionPopup::Buttons mEnabledPopupButtons; /// Bit mask of currently enabled Popup buttons
 
   Image               mHandleImages[HANDLE_TYPE_COUNT][HANDLE_IMAGE_TYPE_COUNT];
   Image               mCursorImage;
@@ -1292,6 +1294,16 @@ bool Decorator::IsPopupActive() const
   return mImpl->mActiveCopyPastePopup ;
 }
 
+void Decorator::SetEnabledPopupButtons( TextSelectionPopup::Buttons& enabledButtonsBitMask )
+{
+   mImpl->mEnabledPopupButtons = enabledButtonsBitMask;
+}
+
+TextSelectionPopup::Buttons& Decorator::GetEnabledPopupButtons()
+{
+  return mImpl->mEnabledPopupButtons;
+}
+
 /** Scroll **/
 
 void Decorator::SetScrollThreshold( float threshold )