Fixed ItemView flicking to top now shows overshoot indicator
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / text-controls / text-font-style.h
1 #ifndef __DALI_TOOLKIT_INTERNAL_TEXT_FONT_STYLE_H__
2 #define __DALI_TOOLKIT_INTERNAL_TEXT_FONT_STYLE_H__
3
4 /*
5  * Copyright (c) 2015 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/scripting/scripting.h>
23
24 // INTERNAL INCLUDES
25 #include <dali-toolkit/internal/text/text-controller.h>
26 #include <dali-toolkit/internal/text/text-definitions.h>
27
28 namespace Dali
29 {
30
31 namespace Toolkit
32 {
33
34 namespace Text
35 {
36
37 const Scripting::StringEnum FONT_WIDTH_STRING_TABLE[] =
38 {
39   { "ultra-condensed", TextAbstraction::FontWidth::ULTRA_CONDENSED },
40   { "extra-condensed", TextAbstraction::FontWidth::EXTRA_CONDENSED },
41   { "condensed", TextAbstraction::FontWidth::CONDENSED },
42   { "semi-condensed", TextAbstraction::FontWidth::SEMI_CONDENSED },
43   { "normal", TextAbstraction::FontWidth::NORMAL },
44   { "semi-expanded", TextAbstraction::FontWidth::SEMI_EXPANDED },
45   { "expanded", TextAbstraction::FontWidth::EXPANDED },
46   { "extra-expanded", TextAbstraction::FontWidth::EXTRA_EXPANDED },
47   { "ultra-expanded", TextAbstraction::FontWidth::ULTRA_EXPANDED },
48 };
49 const unsigned int FONT_WIDTH_STRING_TABLE_COUNT = sizeof( FONT_WIDTH_STRING_TABLE ) / sizeof( FONT_WIDTH_STRING_TABLE[0] );
50
51 const Scripting::StringEnum FONT_WEIGHT_STRING_TABLE[] =
52 {
53   { "thin", TextAbstraction::FontWeight::THIN },
54   { "ultra-light", TextAbstraction::FontWeight::ULTRA_LIGHT },
55   { "extra-light", TextAbstraction::FontWeight::EXTRA_LIGHT },
56   { "light", TextAbstraction::FontWeight::LIGHT },
57   { "demi-light", TextAbstraction::FontWeight::DEMI_LIGHT },
58   { "semi-light", TextAbstraction::FontWeight::SEMI_LIGHT },
59   { "book", TextAbstraction::FontWeight::BOOK },
60   { "normal", TextAbstraction::FontWeight::NORMAL },
61   { "regular", TextAbstraction::FontWeight::REGULAR },
62   { "medium", TextAbstraction::FontWeight::MEDIUM },
63   { "demi-bold", TextAbstraction::FontWeight::DEMI_BOLD },
64   { "semi-bold", TextAbstraction::FontWeight::SEMI_BOLD },
65   { "bold", TextAbstraction::FontWeight::BOLD },
66   { "ultra-bold", TextAbstraction::FontWeight::ULTRA_BOLD },
67   { "extra-bold", TextAbstraction::FontWeight::EXTRA_BOLD },
68   { "black", TextAbstraction::FontWeight::BLACK },
69   { "heavy", TextAbstraction::FontWeight::HEAVY },
70   { "extra-black", TextAbstraction::FontWeight::EXTRA_BLACK }
71 };
72 const unsigned int FONT_WEIGHT_STRING_TABLE_COUNT = sizeof( FONT_WEIGHT_STRING_TABLE ) / sizeof( FONT_WEIGHT_STRING_TABLE[0] );
73
74 const Scripting::StringEnum FONT_SLANT_STRING_TABLE[] =
75 {
76   { "normal", TextAbstraction::FontSlant::NORMAL },
77   { "roman", TextAbstraction::FontSlant::ROMAN },
78   { "italic", TextAbstraction::FontSlant::ITALIC },
79   { "oblique", TextAbstraction::FontSlant::OBLIQUE }
80 };
81 const unsigned int FONT_SLANT_STRING_TABLE_COUNT = sizeof( FONT_SLANT_STRING_TABLE ) / sizeof( FONT_SLANT_STRING_TABLE[0] );
82
83 /**
84  * @brief Sets the font's style property.
85  *
86  * @param[in] controller The text's controller.
87  * @param[in] value The value of the font's style.
88  *
89  */
90 void SetFontStyleProperty( ControllerPtr controller, const Property::Value& value );
91
92 /**
93  * @brief Retrieves the font's style property.
94  *
95  * @param[in] controller The text's controller.
96  * @param[out] value The value of the font's style.
97  */
98 void GetFontStyleProperty( ControllerPtr controller, Property::Value& value );
99
100 } // namespace Text
101
102 } // namespace Toolkit
103
104 } // namespace Dali
105
106 #endif // __DALI_TOOLKIT_INTERNAL_TEXT_FONT_STYLE_H__