ModelView implementation.
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / rendering / text-typesetter.h
1 #ifndef DALI_TOOLKIT_TEXT_TYPESETTER_H
2 #define DALI_TOOLKIT_TEXT_TYPESETTER_H
3
4 /*
5  * Copyright (c) 2016 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/public-api/common/intrusive-ptr.h>
23 #include <dali/public-api/object/ref-object.h>
24
25 namespace Dali
26 {
27
28 namespace Toolkit
29 {
30
31 namespace Text
32 {
33
34 class ModelInterface;
35 class ViewModel;
36 class Typesetter;
37
38 typedef IntrusivePtr<Typesetter> TypesetterPtr;
39
40 /**
41  * @brief This class is responsible of controlling the data flow of the text's rendering process.
42  */
43 class Typesetter : public RefObject
44 {
45 public: // Constructor.
46   /**
47    * @brief Creates a Typesetter instance.
48    *
49    * The typesetter composes the final text retrieving the glyphs and the
50    * styles from the text's model.
51    *
52    * @param[in] model Pointer to the text's data model.
53    */
54   static TypesetterPtr New( const ModelInterface* const model );
55
56 public:
57   /**
58    * @brief Retrieves the pointer to the view model.
59    *
60    * @return A pointer to the view model.
61    */
62   ViewModel* GetViewModel();
63
64 private:
65   /**
66    * @brief Private constructor.
67    *
68    * @param[in] model Pointer to the text's data model.
69    */
70   Typesetter( const ModelInterface* const model );
71
72   // Declared private and left undefined to avoid copies.
73   Typesetter( const Typesetter& handle );
74
75   // Declared private and left undefined to avoid copies.
76   Typesetter& operator=( const Typesetter& handle );
77
78 protected:
79
80   /**
81    * @brief A reference counted object may only be deleted by calling Unreference().
82    *
83    * Destroys the visual model.
84    */
85   virtual ~Typesetter();
86
87 private:
88    ViewModel* mModel;
89 };
90
91 } // namespace Text
92
93 } // namespace Toolkit
94
95 } // namespace Dali
96
97 #endif // DALI_TOOLKIT_TEXT_TYPESETTER_H