2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FUiUiConfiguration.h
20 * @brief This is the header file for the %UiConfiguration class.
22 * This header file contains the declarations of the %UiConfiguration class.
25 #ifndef _FUI_UI_CONFIGURATION_H_
26 #define _FUI_UI_CONFIGURATION_H_
28 #include <FGrpColor.h>
29 #include <FUiUiConfigurationTypes.h>
31 namespace Tizen { namespace Base {
35 namespace Tizen { namespace Ui {
37 class _OSP_EXPORT_ UiConfiguration
41 * Sets the default font to all the Controls.
45 * @return An error code
46 * @param[in] fontName The app font name or system font name @n
47 * The app font name is retrieved using Tizen::Graphics::GetFaceName(Tizen::Base::String& filepath).
48 * The system font name is retrieved using Tizen::Graphics::Font::GetSystemFontListN().
49 * Sets an empty string if you want to reset
50 * @exception E_SUCCESS The method is successful.
51 * @exception E_FILE_NOT_FOUND The specified font cannot be found or accessed.
52 * @remarks At First, the value of fontName is considered app font name if it matches one of the face names of the font files which is located in '/res/font'.
53 * If not, the value of fontName is considered system font name if it matches one of the retrieved values using GetSystemFontListN().
54 * @remarks The control first attempt to find the control font. If it fails, then it searches for the application default font and the system font, in sequence.
55 * @see GetDefaultFont()
57 static result SetDefaultFont(const Tizen::Base::String& fontName);
60 * Gets the default font for all the Controls.
64 * @return The app font name or system font name @n
65 * else an empty string if the default font is not set
66 * @see SetDefaultFont()
68 static Tizen::Base::String GetDefaultFont(void);
71 * Sets the font of the control with the specified file name.
75 * @return An error code
76 * @param[in] fileName The file name of a font-resource located in @b '/res/font', @n
77 * else sets an empty string to reset
78 * @exception E_SUCCESS The method is successful.
79 * @exception E_FILE_NOT_FOUND The specified font cannot be found or accessed.
80 * @exception E_UNSUPPORTED_FORMAT The specified font format is not supported.
81 * @see GetDefaultFontFile()
83 static result SetDefaultFontFromFile(const Tizen::Base::String& fileName);
86 * Gets a font file name of the control.
90 * @return The font name set in the control @n
91 * else an empty string if the font is not set
92 * @see SetDefaultFontFromFile()
94 static Tizen::Base::String GetDefaultFontFile(void);
97 * Gets the actual font size
101 * @return An actual font size of given font size string.
102 * @param[in] sizeString The predefined string value, such as "giant", "huge", "large", "medium", or "small". @n
103 * It is case-insensitive and can be retrieved using Tizen:System:SettingInfo::GetValue().
105 * @remarks If the specified @c sizeString is not defined, -1 is returned.
107 static float GetFontSize(const Tizen::Base::String& sizeString);
110 * Gets the color of controls
114 * @return The color of the given color key
115 * @param[in] colorKey The color key.
116 * @exception E_SUCCESS The method is successful.
117 * @exception E_KEY_NOT_FOUND The specified color cannot be found or accessed.
118 * @remarks 1. Color keys are defined in FUiUiConfigurationTypes.h.
119 * 2. The specific error code can be accessed using the GetLastResult() method.
120 * 3. Using the return value without checking the return value of GetLastResult is prohibited.
122 static Tizen::Graphics::Color GetColor(int colorKey);
126 // This default constructor is intentionally declared as private because this class cannot be constructed.
128 UiConfiguration(void);
131 // This destructor is intentionally declared as private because this class cannot be constructed.
133 ~UiConfiguration(void);
136 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
138 UiConfiguration(const UiConfiguration& rhs);
141 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
143 UiConfiguration& operator =(const UiConfiguration& rhs);
145 }; // UiConfiguration
149 #endif // _FUI_UI_CONFIGURATION_H_