[dali_2.3.20] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / text-controls / text-editor-impl.h
1 #ifndef DALI_TOOLKIT_INTERNAL_TEXT_EDITOR_H
2 #define DALI_TOOLKIT_INTERNAL_TEXT_EDITOR_H
3
4 /*
5  * Copyright (c) 2024 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <dali/devel-api/adaptor-framework/accessibility.h>
23 #include <dali/devel-api/adaptor-framework/input-method-context.h>
24 #include <dali/devel-api/atspi-interfaces/editable-text.h>
25 #include <dali/devel-api/atspi-interfaces/hypertext.h>
26 #include <dali/devel-api/atspi-interfaces/text.h>
27 #include <dali/public-api/animation/animation.h>
28
29 // INTERNAL INCLUDES
30 #include <dali-toolkit/devel-api/controls/control-devel.h>
31 #include <dali-toolkit/devel-api/controls/scroll-bar/scroll-bar.h>
32 #include <dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h>
33 #include <dali-toolkit/internal/controls/control/control-data-impl.h>
34 #include <dali-toolkit/internal/controls/text-controls/common-text-utils.h>
35 #include <dali-toolkit/internal/text/controller/text-controller.h>
36 #include <dali-toolkit/internal/text/decorator/text-decorator.h>
37 #include <dali-toolkit/internal/text/rendering/text-renderer.h>
38 #include <dali-toolkit/internal/text/text-anchor-control-interface.h>
39 #include <dali-toolkit/internal/text/text-control-interface.h>
40 #include <dali-toolkit/internal/text/text-editable-control-interface.h>
41 #include <dali-toolkit/internal/text/text-selectable-control-interface.h>
42 #include <dali-toolkit/internal/text/text-vertical-scroller.h>
43 #include <dali-toolkit/public-api/controls/control-impl.h>
44 #include <dali-toolkit/public-api/controls/text-controls/text-editor.h>
45
46 namespace Dali
47 {
48 namespace Toolkit
49 {
50 namespace Internal
51 {
52 /**
53  * @brief A control which renders a long text string with styles.
54  */
55 class TextEditor : public Control, public Text::ControlInterface, public Text::EditableControlInterface, public Text::SelectableControlInterface, public Text::AnchorControlInterface
56 {
57 public:
58   /**
59    * @copydoc Dali::Toollkit::TextEditor::New()
60    * @param[in] additionalBehaviour custom behavior flags for this TextEditor. Default is CONTROL_BEHAVIOUR_DEFAULT
61    */
62   static Toolkit::TextEditor New(ControlBehaviour additionalBehaviour = ControlBehaviour::CONTROL_BEHAVIOUR_DEFAULT);
63
64   // Properties
65
66   /**
67    * @brief Called when a property of an object of this type is set.
68    *
69    * @param[in] object The object whose property is set.
70    * @param[in] index The property index.
71    * @param[in] value The new property value.
72    */
73   static void SetProperty(BaseObject* object, Property::Index index, const Property::Value& value);
74
75   /**
76    * @brief Called to retrieve a property of an object of this type.
77    *
78    * @param[in] object The object whose property is to be retrieved.
79    * @param[in] index The property index.
80    * @return The current value of the property.
81    */
82   static Property::Value GetProperty(BaseObject* object, Property::Index index);
83
84   /**
85    * @copydoc Dali::Toollkit::TextEditor::GetInputMethodContext()
86    */
87   InputMethodContext GetInputMethodContext();
88
89   /**
90    * @copydoc Dali::Toollkit::TextEditor::MaxLengthReachedSignal()
91    */
92   DevelTextEditor::MaxLengthReachedSignalType& MaxLengthReachedSignal();
93
94   /**
95    * @copydoc Dali::Toollkit::TextEditor::AnchorClickedSignal()
96    */
97   DevelTextEditor::AnchorClickedSignalType& AnchorClickedSignal();
98
99   /**
100    * @copydoc Dali::Toollkit::TextEditor::CursorPositionChangedSignal()
101    */
102   DevelTextEditor::CursorPositionChangedSignalType& CursorPositionChangedSignal();
103
104   /**
105    * @copydoc Dali::Toollkit::TextEditor::InputFilteredSignal()
106    */
107   DevelTextEditor::InputFilteredSignalType& InputFilteredSignal();
108
109   /**
110    * @copydoc Dali::Toollkit::TextEditor::SelectionChangedSignal()
111    */
112   DevelTextEditor::SelectionChangedSignalType& SelectionChangedSignal();
113
114   /**
115    * @copydoc Dali::Toollkit::TextEditor::SelectionClearedSignal()
116    */
117   DevelTextEditor::SelectionClearedSignalType& SelectionClearedSignal();
118
119   /**
120    * @copydoc Dali::Toollkit::TextEditor::SelectionStartedSignal()
121    */
122   DevelTextEditor::SelectionStartedSignalType& SelectionStartedSignal();
123
124   /**
125    * Connects a callback function with the object's signals.
126    * @param[in] object The object providing the signal.
127    * @param[in] tracker Used to disconnect the signal.
128    * @param[in] signalName The signal to connect to.
129    * @param[in] functor A newly allocated FunctorDelegate.
130    * @return True if the signal was connected.
131    * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
132    */
133   static bool DoConnectSignal(BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor);
134
135   /**
136    * @brief Gets text controller
137    *
138    * @return The text controller
139    */
140   Text::ControllerPtr GetTextController();
141
142   /**
143    * @copydoc TextEditor::TextChangedSignal()
144    */
145   Toolkit::TextEditor::TextChangedSignalType& TextChangedSignal();
146
147   /**
148    * @copydoc TextEditor::TextChangedSignal()
149    */
150   Toolkit::TextEditor::InputStyleChangedSignalType& InputStyleChangedSignal();
151
152   /**
153    * @copydoc TextEditor::ScrollStateChangedSignal()
154    */
155   Toolkit::TextEditor::ScrollStateChangedSignalType& ScrollStateChangedSignal();
156
157 private: // From Control
158   /**
159    * @copydoc Control::OnInitialize()
160    */
161   void OnInitialize() override;
162
163   /**
164    * @copydoc Toolkit::Internal::Control::CreateAccessibleObject()
165    */
166   DevelControl::ControlAccessible* CreateAccessibleObject() override;
167
168   /**
169    * @copydoc Control::OnStyleChange()
170    */
171   void OnStyleChange(Toolkit::StyleManager styleManager, StyleChange::Type change) override;
172
173   /**
174    * @copydoc Control::GetNaturalSize()
175    */
176   Vector3 GetNaturalSize() override;
177
178   /**
179    * @copydoc Control::GetHeightForWidth()
180    */
181   float GetHeightForWidth(float width) override;
182
183   /**
184    * @copydoc Control::OnInitialize()
185    */
186   void OnRelayout(const Vector2& size, RelayoutContainer& container) override;
187
188   /**
189    * @copydoc Control::OnKeyInputFocusGained()
190    */
191   void OnKeyInputFocusGained() override;
192
193   /**
194    * @copydoc Control::OnKeyInputFocusLost()
195    */
196   void OnKeyInputFocusLost() override;
197
198   /**
199    * @copydoc Control::OnAccessibilityActivated()
200    */
201   bool OnAccessibilityActivated() override;
202
203   /**
204    * @copydoc Control::OnTap()
205    */
206   void OnTap(const TapGesture& tap) override;
207
208   /**
209    * @copydoc Control::OnPan()
210    */
211   void OnPan(const PanGesture& gesture) override;
212
213   /**
214    * @copydoc Control::OnLongPress()
215    */
216   void OnLongPress(const LongPressGesture& gesture) override;
217
218   /**
219    * @copydoc Control::OnSceneConnection()
220    */
221   void OnSceneConnection(int depth) override;
222
223   /**
224    * @copydoc Control::OnPropertySet()
225    */
226   void OnPropertySet(Property::Index index, const Property::Value& propertyValue) override;
227
228   /**
229    * @copydoc Dali::CustomActorImpl::OnKeyEvent(const KeyEvent&)
230    */
231   bool OnKeyEvent(const KeyEvent& event) override;
232
233   // From ControlInterface
234
235   /**
236    * @copydoc Text::ControlInterface::RequestTextRelayout()
237    */
238   void RequestTextRelayout() override;
239
240   // From EditableControlInterface
241
242   /**
243    * @copydoc Text::EditableControlInterface::TextChanged()
244    */
245   void TextInserted(unsigned int position, unsigned int length, const std::string& content) override;
246
247   /**
248    * @copydoc Text::EditableControlInterface::TextDeleted()
249    */
250   void TextDeleted(unsigned int position, unsigned int length, const std::string& content) override;
251
252   /**
253    * @copydoc Text::EditableControlInterface::CursorPositionChanged()
254    */
255   void CursorPositionChanged(unsigned int oldPosition, unsigned int newPosition) override;
256
257   /**
258    * @copydoc Text::EditableControlInterface::TextChanged()
259    */
260   void TextChanged(bool immediate) override;
261
262   /**
263    * @copydoc Text::EditableControlInterface::MaxLengthReached()
264    */
265   void MaxLengthReached() override;
266
267   /**
268    * @copydoc Text::EditableControlInterface::InputStyleChanged()
269    */
270   void InputStyleChanged(Text::InputStyle::Mask inputStyleMask) override;
271
272   /**
273    * @copydoc Text::SelectableControlInterface::SelectionChanged()
274    */
275   void SelectionChanged(uint32_t oldStart, uint32_t oldEnd, uint32_t newStart, uint32_t newEnd) override;
276
277   /**
278    * @copydoc Text::EditableControlInterface::AddDecoration()
279    */
280   void AddDecoration(Actor& actor, Toolkit::Text::DecorationType type, bool needsClipping) override;
281
282   /**
283    * @copydoc Text::EditableControlInterface::InputFiltered()
284    */
285   void InputFiltered(Toolkit::InputFilter::Property::Type type) override;
286
287   /**
288    * @copydoc Text::EditableControlInterface::GetControlBackgroundColor()
289    */
290   void GetControlBackgroundColor(Vector4& color) const override;
291
292   // From SelectableControlInterface
293 public:
294   /**
295    * @copydoc Text::SelectableControlInterface::SetTextSelectionRange()
296    */
297   void SetTextSelectionRange(const uint32_t* start, const uint32_t* end) override;
298
299   /**
300    * @copydoc Text::SelectableControlInterface::GetTextSelectionRange()
301    */
302   Uint32Pair GetTextSelectionRange() const override;
303
304   /**
305    * @copydoc Text::SelectableControlInterface::SelectWholeText()
306    */
307   void SelectWholeText() override;
308
309   /**
310    * @copydoc Text::SelectableControlInterface::SelectNone()
311    */
312   void SelectNone() override;
313
314   /**
315    * @copydoc Text::SelectableControlInterface::SelectText()
316    */
317   void SelectText(const uint32_t start, const uint32_t end) override;
318
319   /**
320    * @copydoc Dali::Toolkit::DevelTextEditor::ScrollBy()
321    */
322   void ScrollBy(Vector2 Scroll);
323
324   /**
325    * @brief Get Horizontal scroll position of TextEditor.
326    *
327    * @return Horizontal scroll position (in pixels) of TextEditor.
328    */
329   float GetHorizontalScrollPosition();
330
331   /**
332    * @brief Get Vertical scroll position of TextEditor.
333    *
334    * @return Vertical scroll position (in pixels) of TextEditor.
335    */
336   float GetVerticalScrollPosition();
337
338   /**
339    * @brief Get the rendered size of a specific text range.
340    * if the requested text is at multilines, multiple sizes will be returned for each text located in a separate line.
341    * if a line contains characters with different directions, multiple sizes will be returned for each block of contiguous characters with the same direction.
342    *
343    * @param[in] startIndex start index of the text requested to calculate size for.
344    * @param[in] endIndex end index(included) of the text requested to calculate size for.
345    * @return list of sizes of the reuested text.
346    */
347   Vector<Vector2> GetTextSize(const uint32_t startIndex, const uint32_t endIndex) const;
348
349   /**
350    * @brief Get the top/left rendered position of a specific text range.
351    * if the requested text is at multilines, multiple positions will be returned for each text located in a separate line.
352    * if a line contains characters with different directions, multiple positions will be returned for each block of contiguous characters with the same direction.
353    *
354    * @param[in] startIndex start index of the text requested to get position to.
355    * @param[in] endIndex end index(included) of the text requested to get position to.
356    * @return list of positions of the requested text.
357    */
358   Vector<Vector2> GetTextPosition(const uint32_t startIndex, const uint32_t endIndex) const;
359
360   /**
361    * @brief Get the line bounding rectangle.
362    * if the requested index is out of range or the line is not yet rendered, a rect of {0, 0, 0, 0} is returned.
363    *
364    * @param[in] lineIndex line index to which we want to calculate the geometry for.
365    * @return bounding rectangle.
366    */
367   Rect<float> GetLineBoundingRectangle(const uint32_t lineIndex) const;
368
369   /**
370    * @brief Get the character bounding rectangle.
371    * If the text is not yet rendered or the index > text.Count(); a rect of {0, 0, 0, 0} is returned.
372    *
373    * @param[in] charIndex character index to which we want to calculate the geometry for.
374    * @return bounding rectangle.
375    */
376   Rect<float> GetCharacterBoundingRectangle(const uint32_t charIndex) const;
377
378   /**
379    * @brief Get the character index.
380    * If the text is not yet rendered or the text is empty, -1 is returned.
381    *
382    * @param[in] visualX visual x position.
383    * @param[in] visualY visual y position.
384    * @return character index.
385    */
386   int GetCharacterIndexAtPosition(float visualX, float visualY) const;
387
388   /**
389    * @brief Gets the bounding box of a specific text range.
390    *
391    * @param[in] startIndex start index of the text requested to get bounding box to.
392    * @param[in] endIndex end index(included) of the text requested to get bounding box to.
393    * @return bounding box of the requested text.
394    */
395   Rect<> GetTextBoundingRectangle(uint32_t startIndex, uint32_t endIndex) const;
396
397   /**
398    * @brief Set the @p spannedText into current textEditor
399    * the spanned text contains content (text) and  format (spans with ranges)
400    * the text is copied into text-controller and the spans are applied on ranges
401    *
402    * @param[in] spannedText the text with spans.
403    */
404   void SetSpannedText(const Text::Spanned& spannedText);
405
406   /**
407    * @copydoc Text::SelectableControlInterface::GetSelectedText()
408    */
409   string GetSelectedText() const override;
410
411   /**
412    * @copydoc Text::EditableControlInterface::IsEditable()
413    */
414   bool IsEditable() const override;
415
416   /**
417    * @copydoc Text::EditableControlInterface::SetEditable()
418    */
419   void SetEditable(bool editable) override;
420
421   /**
422    * @copydoc Text::EditableControlInterface::CopyText()
423    */
424   string CopyText() override;
425
426   /**
427    * @copydoc Text::EditableControlInterface::CutText()
428    */
429   string CutText() override;
430
431   /**
432    * @copydoc Text::EditableControlInterface::PasteText()
433    */
434   void PasteText() override;
435
436   // From AnchorControlInterface
437
438   /**
439    * @copydoc Text::AnchorControlInterface::AnchorClicked()
440    */
441   void AnchorClicked(const std::string& href) override;
442
443 private: // Implementation
444   /**
445    * @copydoc Dali::Toolkit::Text::Controller::(InputMethodContext& inputMethodContext, const InputMethodContext::EventData& inputMethodContextEvent)
446    */
447   InputMethodContext::CallbackData OnInputMethodContextEvent(InputMethodContext& inputMethodContext, const InputMethodContext::EventData& inputMethodContextEvent);
448
449   /**
450    * @brief Get a Property Map for the image used for the required Handle Image
451    * @param[out] value the returned image property
452    * @param[in] handleType the type of handle
453    * @param[in] handleImageType the type of image for the given handleType
454    */
455   void GetHandleImagePropertyValue(Property::Value& value, Text::HandleType handleType, Text::HandleImageType handleImageType);
456
457   /**
458    * @brief Callback when keyboard is shown/hidden.
459    *
460    * @param[in] keyboardShown True if keyboard is shown.
461    */
462   void KeyboardStatusChanged(bool keyboardShown);
463
464   /**
465    * @brief update scroll bar position
466    *
467    * If text scroll is occurred, create or update scroll bar position
468    */
469   void UpdateScrollBar();
470
471   /**
472    * @brief Callback when TextEditor is touched
473    *
474    * @param[in] actor TextEditor touched
475    * @param[in] touch Touch information
476    */
477   bool OnTouched(Actor actor, const TouchEvent& touch);
478
479   /**
480    * @brief Callbacks called on idle.
481    *
482    * If there are notifications of change of input style on the queue, Toolkit::TextEditor::InputStyleChangedSignal() are emitted.
483    */
484   void OnIdleSignal();
485
486   /**
487    * @brief Emits CursorPositionChanged signal.
488    */
489   void EmitCursorPositionChangedSignal();
490
491   /**
492    * @brief Emits TextChanged signal.
493    */
494   void EmitTextChangedSignal();
495
496   /**
497    * @brief Emits SelectionChanged signal.
498    */
499   void EmitSelectionChangedSignal();
500
501   /**
502    * @brief Emits SelectionCleared signal.
503    */
504   void EmitSelectionClearedSignal();
505
506   /**
507    * @brief Emits SelectionStarted signal.
508    */
509   void EmitSelectionStartedSignal();
510
511   /**
512    * @brief set RenderActor's position with new scrollPosition
513    *
514    * Apply updated scroll position or start scroll animation if VerticalScrollAnimation is enabled
515    */
516   void ApplyScrollPosition();
517
518   /**
519    * @brief Callback function for ScrollBar indicator animation finished signal
520    *
521    * Emit ScrollBarStateChanged Signal and toggle mScrollStarted flag to false
522    */
523   void OnScrollIndicatorAnimationFinished(Animation& animation);
524
525   /**
526   * @brief Callback function for when the layout is changed.
527   * @param[in] actor The actor whose layoutDirection is changed.
528   * @param[in] type  The layoutDirection.
529   */
530   void OnLayoutDirectionChanged(Actor actor, LayoutDirection::Type type);
531
532   /**
533   * @brief Add a layer for active or cursor.
534   * @param[in] layer The actor in which to store the layer.
535   * @param[in] actor The new layer to add.
536   */
537   void AddLayer(Actor& layer, Actor& actor);
538
539   /**
540    * Construct a new TextEditor.
541    *
542    * @param[in] additionalBehaviour additional behaviour flags for this TextEditor
543    */
544   TextEditor(ControlBehaviour additionalBehaviour);
545
546   /**
547    * A reference counted object may only be deleted by calling Unreference()
548    */
549   virtual ~TextEditor();
550
551   // Undefined copy constructor and assignment operators
552   TextEditor(const TextEditor&);
553   TextEditor& operator=(const TextEditor& rhs);
554
555   /**
556    * @brief Resize actor to the given size.
557    *
558    * @param[in] actor The actor to be resized.
559    * @param[in] size Size to change.
560    */
561   void ResizeActor(Actor& actor, const Vector2& size);
562
563   /**
564    * @brief Render view, create and attach actor(s) to this text editor.
565    */
566   void RenderText(Text::Controller::UpdateTextType updateTextType);
567
568   // Connection needed to re-render text, when a text editor returns to the scene.
569   void OnSceneConnect(Dali::Actor actor);
570
571   // Needed to synchronize TextAnchor actors with Anchor objects in text's logical model
572   void OnAccessibilityStatusChanged();
573
574 private: // Data
575   // Signals
576   Toolkit::TextEditor::TextChangedSignalType                mTextChangedSignal;
577   Toolkit::TextEditor::InputStyleChangedSignalType          mInputStyleChangedSignal;
578   Toolkit::TextEditor::ScrollStateChangedSignalType         mScrollStateChangedSignal;
579   Toolkit::DevelTextEditor::MaxLengthReachedSignalType      mMaxLengthReachedSignal;
580   Toolkit::DevelTextEditor::AnchorClickedSignalType         mAnchorClickedSignal;
581   Toolkit::DevelTextEditor::InputFilteredSignalType         mInputFilteredSignal;
582   Toolkit::DevelTextEditor::CursorPositionChangedSignalType mCursorPositionChangedSignal;
583   Toolkit::DevelTextEditor::SelectionChangedSignalType      mSelectionChangedSignal;
584   Toolkit::DevelTextEditor::SelectionClearedSignalType      mSelectionClearedSignal;
585   Toolkit::DevelTextEditor::SelectionStartedSignalType      mSelectionStartedSignal;
586
587   InputMethodContext               mInputMethodContext;
588   Text::ControllerPtr              mController;
589   Text::RendererPtr                mRenderer;
590   Text::DecoratorPtr               mDecorator;
591   Text::TextVerticalScrollerPtr    mTextVerticalScroller;
592   Toolkit::Control                 mStencil;
593   Toolkit::ScrollBar               mScrollBar;
594   Dali::Animation                  mAnimation; ///< Scroll indicator Show/Hide Animation.
595   Dali::TimePeriod                 mAnimationPeriod;
596   std::vector<Actor>               mClippingDecorationActors; ///< Decoration actors which need clipping.
597   std::vector<Toolkit::TextAnchor> mAnchorActors;
598   Dali::InputMethodOptions         mInputMethodOptions;
599
600   Actor mRenderableActor;
601   Actor mActiveLayer;
602   Actor mCursorLayer;
603   Actor mBackgroundActor;
604
605   float mAlignmentOffset;
606   float mScrollAnimationDuration;
607   float mLineSpacing;
608   int   mRenderingBackend;
609   bool  mHasBeenStaged : 1;
610   bool  mScrollAnimationEnabled : 1;
611   bool  mScrollBarEnabled : 1;
612   bool  mScrollStarted : 1;
613   bool  mTextChanged : 1;           ///< If true, emits TextChangedSignal in next OnRelayout().
614   bool  mCursorPositionChanged : 1; ///< If true, emits CursorPositionChangedSignal at the end of OnRelayout().
615   bool  mSelectionChanged : 1;      ///< If true, emits SelectionChangedSignal at the end of OnRelayout().
616   bool  mSelectionCleared : 1;      ///< If true, emits SelectionClearedSignal at the end of OnRelayout().
617
618   //args for cursor PositionChanged event
619   unsigned int mOldPosition;
620
621   //args for selection changed event
622   uint32_t mOldSelectionStart;
623   uint32_t mOldSelectionEnd;
624
625   bool mSelectionStarted : 1; ///< If true, emits SelectionStartedSignal at the end of OnRelayout().
626
627   struct PropertyHandler;
628
629   /**
630    * @brief This structure is to connect TextEditor with Accessible functions.
631    */
632   class TextEditorAccessible : public EditableTextControlAccessible
633   {
634   public:
635     using EditableTextControlAccessible::EditableTextControlAccessible;
636
637     /**
638      * @copydoc Dali::Accessibility::Accessible::GetName()
639      */
640     std::string GetName() const override;
641
642   protected:
643     /**
644      * @copydoc Dali::Toolkit::Internal::TextControlAccessible::GetTextAnchors()
645      */
646     const std::vector<Toolkit::TextAnchor>& GetTextAnchors() const override;
647
648     /**
649      * @copydoc Dali::Toolkit::Internal::TextControlAccessible::GetTextController()
650      */
651     Toolkit::Text::ControllerPtr GetTextController() const override;
652
653     /**
654      * @copydoc Dali::Toolkit::Internal::EditableTextControlAccessible::RequestTextRelayout()
655      */
656     void RequestTextRelayout() override;
657   };
658 };
659
660 } // namespace Internal
661
662 // Helpers for public-api forwarding methods
663
664 inline Toolkit::Internal::TextEditor& GetImpl(Toolkit::TextEditor& textEditor)
665 {
666   DALI_ASSERT_ALWAYS(textEditor);
667
668   Dali::RefObject& handle = textEditor.GetImplementation();
669
670   return static_cast<Toolkit::Internal::TextEditor&>(handle);
671 }
672
673 inline const Toolkit::Internal::TextEditor& GetImpl(const Toolkit::TextEditor& textEditor)
674 {
675   DALI_ASSERT_ALWAYS(textEditor);
676
677   const Dali::RefObject& handle = textEditor.GetImplementation();
678
679   return static_cast<const Toolkit::Internal::TextEditor&>(handle);
680 }
681
682 } // namespace Toolkit
683
684 } // namespace Dali
685
686 #endif // DALI_TOOLKIT_INTERNAL_TEXT_EDITOR_H