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-editor-impl.h;h=3c2cec44da19ea139d913ad547f2bd47c50d49ec;hp=f00d66da4b484b626bc7be8e3d762747babe402a;hb=6a9bd26564f5c34ba105b04cec4111523d294bec;hpb=479693b4fd773eb8888ae401d02b49188293e231 diff --git a/dali-toolkit/internal/controls/text-controls/text-editor-impl.h b/dali-toolkit/internal/controls/text-controls/text-editor-impl.h index f00d66d..3c2cec4 100644 --- a/dali-toolkit/internal/controls/text-controls/text-editor-impl.h +++ b/dali-toolkit/internal/controls/text-controls/text-editor-impl.h @@ -1,8 +1,8 @@ -#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. + * Copyright (c) 2017 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,22 @@ * */ +// EXTERNAL INCLUDES +#include +#include + // INTERNAL INCLUDES +#include #include +#include #include -#include #include #include +#include #include +#include #include -// EXTERNAL INCLUDES -#include - namespace Dali { @@ -42,7 +46,7 @@ namespace Internal /** * @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: @@ -87,6 +91,16 @@ public: */ Toolkit::TextEditor::TextChangedSignalType& TextChangedSignal(); + /** + * @copydoc TextEditor::TextChangedSignal() + */ + Toolkit::TextEditor::InputStyleChangedSignalType& InputStyleChangedSignal(); + + /** + * @copydoc DevelTextEditor::ScrollStateChangedSignal() + */ + Toolkit::DevelTextEditor::ScrollStateChangedSignalType& ScrollStateChangedSignal(); + private: // From Control /** @@ -152,15 +166,12 @@ 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() */ @@ -171,6 +182,16 @@ private: // From Control */ 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 /** @@ -193,27 +214,47 @@ private: // Implementation void GetHandleImagePropertyValue( Property::Value& value, Text::HandleType handleType, Text::HandleImageType handleImageType ); /** - * @brief Enable or disable clipping. + * @brief Callback when keyboard is shown/hidden. * - * @param[in] clipping True if clipping should be enabled. - * @param[in] size The area to clip within. + * @param[in] keyboardShown True if keyboard is shown. */ - void EnableClipping( bool clipping, const Vector2& size ); + void KeyboardStatusChanged( bool keyboardShown ); /** - * @brief Callback when keyboard is shown/hidden. + * @brief update scroll bar position * - * @param[in] keyboardShown True if keyboard is shown. + * If text scroll is occurred, create or update scroll bar position */ - void KeyboardStatusChanged( bool keyboardShown ); + void UpdateScrollBar(); /** * @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 TouchEvent& event ); + 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. + */ + void OnIdleSignal(); + + /** + * @brief set RenderActor's position with new scrollPosition + * + * Apply updated scroll position or start scroll animation if VerticalScrollAnimation is enabled + */ + void ApplyScrollPosition(); + + /** + * @brief Callback function for ScrollBar indicator animation finished signal + * + * Emit ScrollBarStateChanged Signal and toggle mScrollStarted flag to false + */ + void OnScrollIndicatorAnimationFinished( Animation& animation ); /** * Construct a new TextEditor. @@ -232,26 +273,38 @@ private: // Implementation /** * @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 ); private: // Data - // Signals Toolkit::TextEditor::TextChangedSignalType mTextChangedSignal; + Toolkit::TextEditor::InputStyleChangedSignalType mInputStyleChangedSignal; + Toolkit::DevelTextEditor::ScrollStateChangedSignalType mScrollStateChangedSignal; + ImfManager mImfManager; Text::ControllerPtr mController; Text::RendererPtr mRenderer; Text::DecoratorPtr mDecorator; - Text::ClipperPtr mClipper; + Text::TextVerticalScrollerPtr mTextVerticalScroller; + Toolkit::Control mStencil; + Toolkit::ScrollBar mScrollBar; + Dali::Animation mAnimation; ///< Scroll indicator Show/Hide Animation. + Dali::TimePeriod mAnimationPeriod; std::vector mClippingDecorationActors; ///< Decoration actors which need clipping. Actor mRenderableActor; + CallbackBase* mIdleCallback; + float mAlignmentOffset; + float mScrollAnimationDuration; int mRenderingBackend; bool mHasBeenStaged:1; + bool mScrollAnimationEnabled:1; + bool mScrollBarEnabled:1; + bool mScrollStarted:1; }; } // namespace Internal @@ -280,4 +333,4 @@ inline const Toolkit::Internal::TextEditor& GetImpl( const Toolkit::TextEditor& } // namespace Dali -#endif // __DALI_TOOLKIT_INTERNAL_TEXT_EDITOR_H__ +#endif // DALI_TOOLKIT_INTERNAL_TEXT_EDITOR_H