Merge "Support Emoji sequences" into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / text-controls / common-text-utils.h
1 #ifndef DALI_TOOLKIT_INTERNAL_TEXT_CONTROLS_COMMON_TEXT_UTILS_H
2 #define DALI_TOOLKIT_INTERNAL_TEXT_CONTROLS_COMMON_TEXT_UTILS_H
3
4 /*
5  * Copyright (c) 2021 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 #include <dali-toolkit/internal/text/decorator/text-decorator.h>
21 #include <dali-toolkit/internal/text/rendering/text-renderer.h>
22 #include <dali-toolkit/internal/text/text-controller.h>
23 #include <dali-toolkit/public-api/controls/control.h>
24 #include <dali-toolkit/public-api/controls/text-controls/text-editor.h>
25 #include <dali/public-api/actors/actor.h>
26
27 #include <dali/public-api/common/vector-wrapper.h>
28
29 namespace Dali::Toolkit::Internal
30 {
31 class CommonTextUtils
32 {
33 public:
34   /**
35    * Common method to render text, setting up background, foreground actors with decorators/stencil.
36    * @param[in] textActor The TextEditor or TextField
37    * @param[in] renderer pointer to the text renderer
38    * @param[in] controller pointer to the text controller
39    * @param[in] decorator pointer to the text decorator
40    * @param[in] alignmentOffset Alignment offset
41    * @param[in,out] renderableActor Actor for rendering text
42    * @param[in,out] backgroundActor Actor for rendering background
43    * @param[in,out] stencil Clipping actor
44    * @param[in,out] clippingDecorationActors Clipping decoration actors
45    * @param[in] updateTextType How the text has been updated
46    */
47   static void RenderText(
48     Actor                            textActor,
49     Text::RendererPtr                renderer,
50     Text::ControllerPtr              controller,
51     Text::DecoratorPtr               decorator,
52     float                            alignmentOffset,
53     Actor&                           renderableActor,
54     Actor&                           backgroundActor,
55     Toolkit::Control&                stencil,
56     std::vector<Actor>&              clippingDecorationActors,
57     Text::Controller::UpdateTextType updateTextType);
58 };
59
60 } // namespace Dali::Toolkit::Internal
61
62 #endif //DALI_TOOLKIT_INTERNAL_TEXT_CONTROLS_COMMON_TEXT_UTILS_H