Revert "[Tizen] Add DALi Autofill implementation"
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / text-abstraction / font-list.h
1 #ifndef DALI_TEXT_ABSTRACTION_FONT_LIST_H
2 #define DALI_TEXT_ABSTRACTION_FONT_LIST_H
3
4 /*
5  * Copyright (c) 2019 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 <string>
23 #include <iostream>
24 #include <dali/public-api/common/vector-wrapper.h>
25
26 // INTERNAL INCLUDES
27 #include <dali/public-api/dali-adaptor-common.h>
28
29 namespace Dali
30 {
31
32 namespace TextAbstraction
33 {
34 typedef std::string FontPath;
35 typedef std::string FontFamily;
36 typedef std::string FontStyle;
37
38 namespace FontWidth
39 {
40   /**
41    * @brief Enumeration type for the font's width
42    */
43   enum Type
44   {
45     NONE,            ///< Means not defined. Will use what is set as default, currently NORMAL.
46     ULTRA_CONDENSED,
47     EXTRA_CONDENSED,
48     CONDENSED,
49     SEMI_CONDENSED,
50     NORMAL,
51     SEMI_EXPANDED,
52     EXPANDED,
53     EXTRA_EXPANDED,
54     ULTRA_EXPANDED
55   };
56
57   const char* const Name[] =
58   {
59     "NONE",
60     "ULTRA_CONDENSED",
61     "EXTRA_CONDENSED",
62     "CONDENSED",
63     "SEMI_CONDENSED",
64     "NORMAL",
65     "SEMI_EXPANDED",
66     "EXPANDED",
67     "EXTRA_EXPANDED",
68     "ULTRA_EXPANDED"
69   };
70 } // namespace FontWidth
71
72 namespace FontWeight
73 {
74   /**
75    * @brief Enumeration type for the font's weight
76    */
77   enum Type
78   {
79     NONE,                      ///< Means not defined. Will use what is set as default, currently NORMAL.
80     THIN,
81     ULTRA_LIGHT,
82     EXTRA_LIGHT = ULTRA_LIGHT,
83     LIGHT,
84     DEMI_LIGHT,
85     SEMI_LIGHT = DEMI_LIGHT,
86     BOOK,
87     NORMAL,
88     REGULAR = NORMAL,
89     MEDIUM,
90     DEMI_BOLD,
91     SEMI_BOLD = DEMI_BOLD,
92     BOLD,
93     ULTRA_BOLD,
94     EXTRA_BOLD = ULTRA_BOLD,
95     BLACK,
96     HEAVY = BLACK,
97     EXTRA_BLACK = BLACK
98   };
99
100   const char* const Name[] =
101   {
102     "NONE",
103     "THIN",
104     "ULTRA_LIGHT",
105     "LIGHT",
106     "DEMI_LIGHT",
107     "BOOK",
108     "NORMAL",
109     "MEDIUM",
110     "DEMI_BOLD",
111     "BOLD",
112     "ULTRA_BOLD",
113     "BLACK"
114   };
115 }
116
117 namespace FontSlant
118 {
119   /**
120    * @brief Enumeration type for the font's slant
121    */
122   enum Type
123   {
124     NONE,           ///< Means not defined. Will use what is set as default, currently NORMAL.
125     NORMAL,
126     ROMAN = NORMAL,
127     ITALIC,
128     OBLIQUE
129   };
130
131   const char* const Name[] =
132   {
133     "NONE",
134     "NORMAL",
135     "ITALIC",
136     "OBLIQUE"
137   };
138 } // namespace FontSlant
139
140 struct FontDescription
141 {
142   enum Type
143   {
144     INVALID,     ///< Not valid font.
145     FACE_FONT,   ///< A face font.
146     BITMAP_FONT, ///< A bitmap font. Each glyph has a url with the bitmap.
147   };
148
149   FontDescription()
150   : path(),
151     family(),
152     width( FontWidth::NONE ),
153     weight( FontWeight::NONE ),
154     slant( FontSlant::NONE ),
155     type( INVALID )
156   {}
157
158   ~FontDescription()
159   {}
160
161   FontPath         path;   ///< The font's file name path.
162   FontFamily       family; ///< The font's family name.
163   FontWidth::Type  width;  ///< The font's width.
164   FontWeight::Type weight; ///< The font's weight.
165   FontSlant::Type  slant;  ///< The font's slant.
166   Type             type;   ///< The type of font.
167 };
168
169 typedef std::vector<FontDescription> FontList;
170
171 DALI_ADAPTOR_API std::ostream& operator<<( std::ostream& o, const FontList& fontList );
172
173 } // namespace TextAbstraction
174
175 } // namespace Dali
176
177 #endif // DALI_TEXT_ABSTRACTION_FONT_LIST_H