X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Ftext-controls%2Ftext-field-impl.h;h=b788d809bd7fc44ea3911c000bae04df0a1e57e3;hp=e2759803b0527eac04d07f1a8395354771f08a51;hb=b1e8521ad77e7b4e62b59613b2edef64429130e9;hpb=d15b9def82b922ae3013ea250e4f6fe260417a79 diff --git a/dali-toolkit/internal/controls/text-controls/text-field-impl.h b/dali-toolkit/internal/controls/text-controls/text-field-impl.h old mode 100644 new mode 100755 index e275980..b788d80 --- a/dali-toolkit/internal/controls/text-controls/text-field-impl.h +++ b/dali-toolkit/internal/controls/text-controls/text-field-impl.h @@ -1,8 +1,8 @@ -#ifndef __DALI_TOOLKIT_INTERNAL_TEXT_FIELD_H__ -#define __DALI_TOOLKIT_INTERNAL_TEXT_FIELD_H__ +#ifndef DALI_TOOLKIT_INTERNAL_TEXT_FIELD_H +#define DALI_TOOLKIT_INTERNAL_TEXT_FIELD_H /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,18 +18,19 @@ * */ +// EXTERNAL INCLUDES +#include +#include + // INTERNAL INCLUDES #include #include -#include #include #include +#include #include #include -// EXTERNAL INCLUDES -#include - namespace Dali { @@ -38,11 +39,10 @@ namespace Toolkit namespace Internal { - /** * @brief A control which renders a short text string. */ -class TextField : public Control, public Text::ControlInterface +class TextField : public Control, public Text::ControlInterface, public Text::EditableControlInterface { public: @@ -72,6 +72,11 @@ public: static Property::Value GetProperty( BaseObject* object, Property::Index index ); /** + * @copydoc Dali::Toollkit::TextField::GetInputMethodContext() + */ + InputMethodContext GetInputMethodContext(); + + /** * Connects a callback function with the object's signals. * @param[in] object The object providing the signal. * @param[in] tracker Used to disconnect the signal. @@ -92,6 +97,21 @@ public: */ Toolkit::TextField::MaxLengthReachedSignalType& MaxLengthReachedSignal(); + /** + * @copydoc TextField::TextChangedSignal() + */ + Toolkit::TextField::InputStyleChangedSignalType& InputStyleChangedSignal(); + + /** + * @brief Called to select the whole texts. + */ + void SelectWholeText(); + + /** + * @brief Called to unselect the whole texts. + */ + void SelectNone(); + private: // From Control /** @@ -145,25 +165,24 @@ private: // From Control virtual void OnLongPress( const LongPressGesture& gesture ); /** - * @copydoc Control::OnStageConnection() + * @copydoc Control::OnSceneConnection() */ - virtual void OnStageConnection( int depth ); + virtual void OnSceneConnection( int depth ); /** * @copydoc Dali::CustomActorImpl::OnKeyEvent(const KeyEvent&) */ virtual bool OnKeyEvent(const KeyEvent& event); - /** - * @copydoc Text::ControlInterface::AddDecoration() - */ - virtual void AddDecoration( Actor& actor, bool needsClipping ); +// From ControlInterface /** * @copydoc Text::ControlInterface::RequestTextRelayout() */ virtual void RequestTextRelayout(); +// From EditableControlInterface + /** * @copydoc Text::ControlInterface::TextChanged() */ @@ -175,9 +194,21 @@ private: // From Control virtual void MaxLengthReached(); /** - * @copydoc Dali::Toolkit::Text::Controller::(ImfManager& imfManager, const ImfManager::ImfEventData& imfEvent) + * @copydoc Text::ControlInterface::InputStyleChanged() + */ + virtual void InputStyleChanged( Text::InputStyle::Mask inputStyleMask ); + + /** + * @copydoc Text::ControlInterface::AddDecoration() + */ + virtual void AddDecoration( Actor& actor, bool needsClipping ); + +private: // Implementation + + /** + * @copydoc Dali::Toolkit::Text::Controller::(InputMethodContext& inputMethodContext, const InputMethodContext::EventData& inputMethodContextEvent) */ - ImfManager::ImfCallbackData OnImfEvent( ImfManager& imfManager, const ImfManager::ImfEventData& imfEvent ); + InputMethodContext::CallbackData OnInputMethodContextEvent( InputMethodContext& inputMethodContext, const InputMethodContext::EventData& inputMethodContextEvent ); /** * @brief Callback when Clipboard signals an item should be pasted @@ -185,15 +216,18 @@ private: // From Control */ void OnClipboardTextSelected( ClipboardEventNotifier& clipboard ); -private: // Implementation + /** + * @brief Get a Property Map for the image used for the required Handle Image + * @param[out] value the returned image property + * @param[in] handleType the type of handle + * @param[in] handleImageType the type of image for the given handleType + */ + 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 ); + void EnableClipping(); /** * @brief Callback when keyboard is shown/hidden. @@ -203,12 +237,19 @@ private: // Implementation void KeyboardStatusChanged( bool keyboardShown ); /** - * @brief Callback when Textfield is touched + * @brief Callback when TextField is touched * * @param[in] actor TextField touched - * @param[in] event TouchEvent information + * @param[in] touch Touch information */ - bool OnTouched( Actor actor, const TouchEvent& event ); + bool OnTouched( Actor actor, const TouchEvent& touch ); + + /** + * @brief Callbacks called on idle. + * + * If there are notifications of change of input style on the queue, Toolkit::TextField::InputStyleChangedSignal() are emitted. + */ + void OnIdleSignal(); /** * Construct a new TextField. @@ -227,25 +268,36 @@ private: // Implementation /** * @brief Render view, create and attach actor(s) to this Text Field. */ - void RenderText(); + void RenderText( Text::Controller::UpdateTextType updateTextType ); + + // Connection needed to re-render text, when a Text Field returns to the scene. + void OnSceneConnect( Dali::Actor actor ); + +public: // For UTC only - // Connection needed to re-render text, when a Text Field returns to the stage. - void OnStageConnect( Dali::Actor actor ); + Text::ControllerPtr GetTextController() { return mController; } private: // Data // Signals Toolkit::TextField::TextChangedSignalType mTextChangedSignal; Toolkit::TextField::MaxLengthReachedSignalType mMaxLengthReachedSignal; + Toolkit::TextField::InputStyleChangedSignalType mInputStyleChangedSignal; + InputMethodContext mInputMethodContext; Text::ControllerPtr mController; Text::RendererPtr mRenderer; Text::DecoratorPtr mDecorator; - Text::ClipperPtr mClipper; ///< For EXCEED_POLICY_CLIP + Toolkit::Control mStencil; ///< For EXCEED_POLICY_CLIP std::vector mClippingDecorationActors; ///< Decoration actors which need clipping. + Dali::InputMethodOptions mInputMethodOptions; Actor mRenderableActor; + Actor mActiveLayer; + Actor mBackgroundActor; + CallbackBase* mIdleCallback; + float mAlignmentOffset; int mRenderingBackend; int mExceedPolicy; bool mHasBeenStaged:1; @@ -277,4 +329,4 @@ inline const Toolkit::Internal::TextField& GetImpl( const Toolkit::TextField& te } // namespace Dali -#endif // __DALI_TOOLKIT_INTERNAL_TEXT_FIELD_H__ +#endif // DALI_TOOLKIT_INTERNAL_TEXT_FIELD_H