-#ifndef __DALI_TOOLKIT_INTERNAL_TEXT_EDITOR_H__
-#define __DALI_TOOLKIT_INTERNAL_TEXT_EDITOR_H__
+#ifndef DALI_TOOLKIT_INTERNAL_TEXT_EDITOR_H
+#define DALI_TOOLKIT_INTERNAL_TEXT_EDITOR_H
/*
* Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
*/
+// EXTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/clipboard-event-notifier.h>
+
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali-toolkit/devel-api/controls/text-controls/text-editor.h>
-#include <dali-toolkit/internal/text/clipping/text-clipper.h>
+#include <dali-toolkit/public-api/controls/text-controls/text-editor.h>
#include <dali-toolkit/internal/text/decorator/text-decorator.h>
#include <dali-toolkit/internal/text/text-control-interface.h>
+#include <dali-toolkit/internal/text/text-editable-control-interface.h>
#include <dali-toolkit/internal/text/text-controller.h>
#include <dali-toolkit/internal/text/rendering/text-renderer.h>
-// EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/clipboard-event-notifier.h>
-
namespace Dali
{
/**
* @brief A control which renders a long text string with styles.
*/
-class TextEditor : public Control, public Text::ControlInterface
+class TextEditor : public Control, public Text::ControlInterface, public Text::EditableControlInterface
{
public:
*/
Toolkit::TextEditor::TextChangedSignalType& TextChangedSignal();
+ /**
+ * @copydoc TextEditor::TextChangedSignal()
+ */
+ Toolkit::TextEditor::InputStyleChangedSignalType& InputStyleChangedSignal();
+
private: // From Control
/**
// From ControlInterface
/**
- * @copydoc Text::ControlInterface::AddDecoration()
- */
- virtual void AddDecoration( Actor& actor, bool needsClipping );
-
- /**
* @copydoc Text::ControlInterface::RequestTextRelayout()
*/
virtual void RequestTextRelayout();
+// From EditableControlInterface
+
/**
* @copydoc Text::ControlInterface::TextChanged()
*/
*/
virtual void MaxLengthReached();
+ /**
+ * @copydoc Text::ControlInterface::InputStyleChanged()
+ */
+ virtual void InputStyleChanged( Text::InputStyle::Mask inputStyleMask );
+
+ /**
+ * @copydoc Text::ControlInterface::AddDecoration()
+ */
+ virtual void AddDecoration( Actor& actor, bool needsClipping );
+
private: // Implementation
/**
void GetHandleImagePropertyValue( Property::Value& value, Text::HandleType handleType, Text::HandleImageType handleImageType );
/**
- * @brief Enable or disable clipping.
- *
- * @param[in] clipping True if clipping should be enabled.
- * @param[in] size The area to clip within.
- */
- void EnableClipping( bool clipping, const Vector2& size );
-
- /**
* @brief Callback when keyboard is shown/hidden.
*
* @param[in] keyboardShown True if keyboard is shown.
* @brief Callback when TextEditor is touched
*
* @param[in] actor TextEditor touched
- * @param[in] event TouchEvent information
+ * @param[in] touch Touch information
+ */
+ bool OnTouched( Actor actor, const TouchData& touch );
+
+ /**
+ * @brief Callbacks called on idle.
+ *
+ * If there are notifications of change of input style on the queue, Toolkit::TextEditor::InputStyleChangedSignal() are emitted.
*/
- bool OnTouched( Actor actor, const TouchEvent& event );
+ void OnIdleSignal();
/**
* Construct a new TextEditor.
/**
* @brief Render view, create and attach actor(s) to this text editor.
*/
- void RenderText();
+ void RenderText( Text::Controller::UpdateTextType updateTextType );
// Connection needed to re-render text, when a text editor returns to the stage.
void OnStageConnect( Dali::Actor actor );
// Signals
Toolkit::TextEditor::TextChangedSignalType mTextChangedSignal;
+ Toolkit::TextEditor::InputStyleChangedSignalType mInputStyleChangedSignal;
Text::ControllerPtr mController;
Text::RendererPtr mRenderer;
Text::DecoratorPtr mDecorator;
- Text::ClipperPtr mClipper;
+ Toolkit::Control mStencil;
std::vector<Actor> mClippingDecorationActors; ///< Decoration actors which need clipping.
Actor mRenderableActor;
+ CallbackBase* mIdleCallback;
+ float mAlignmentOffset;
int mRenderingBackend;
bool mHasBeenStaged:1;
};
} // namespace Dali
-#endif // __DALI_TOOLKIT_INTERNAL_TEXT_EDITOR_H__
+#endif // DALI_TOOLKIT_INTERNAL_TEXT_EDITOR_H