2 * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 /// This class is a static class for utility methods.
22 /// <since_tizen> preview </since_tizen>
23 public static class Utility
26 /// Appends a font path to the list of font paths used by the application.
28 /// <param name="path">The new font path.</param>
29 /// <since_tizen> preview </since_tizen>
30 public static void AppendGlobalFontPath(string path)
32 Interop.Evas.evas_font_path_global_append(path);
36 /// Prepends a font path to the list of font paths used by the application.
38 /// <param name="path">The new font path.</param>
39 /// <since_tizen> preview </since_tizen>
40 public static void PrependEvasGlobalFontPath(string path)
42 Interop.Evas.evas_font_path_global_prepend(path);
46 /// Removes all font paths loaded into the memory by evas_font_path_app_* APIs for the application.
48 /// <since_tizen> preview </since_tizen>
49 public static void ClearEvasGlobalFontPath()
51 Interop.Evas.evas_font_path_global_clear();
55 /// Sets the Edje color class.
57 /// <param name="colorClass">Color class.</param>
58 /// <param name="red">Object red value.</param>
59 /// <param name="green">Object green value.</param>
60 /// <param name="blue">Object blue value.</param>
61 /// <param name="alpha">Object alpha value.</param>
62 /// <param name="outlineRed">Outline red value.</param>
63 /// <param name="outlineGreen">Outline green value.</param>
64 /// <param name="outlineBlue">Outline blue value.</param>
65 /// <param name="outlineAlpha">Outline alpha value.</param>
66 /// <param name="shadowRed">Shadow red value.</param>
67 /// <param name="shadowGreen">Shadow green value.</param>
68 /// <param name="shadowBlue">Shadow blue value.</param>
69 /// <param name="shadowAlpha">Shadow alpha value.</param>
70 /// <returns></returns>
71 /// <since_tizen> preview </since_tizen>
72 public static bool SetEdjeColorClass(string colorClass, int red, int green, int blue, int alpha, int outlineRed, int outlineGreen, int outlineBlue, int outlineAlpha,
73 int shadowRed, int shadowGreen, int shadowBlue, int shadowAlpha)
75 return Interop.Elementary.edje_color_class_set(colorClass, red, green, blue, alpha, outlineRed, outlineGreen, outlineBlue, outlineAlpha, shadowRed, shadowGreen, shadowBlue, shadowAlpha);
79 /// Gets the Edje color class.
81 /// <param name="colorClass">Color class.</param>
82 /// <param name="red">Object red value.</param>
83 /// <param name="green">Object green value.</param>
84 /// <param name="blue">Object blue value.</param>
85 /// <param name="alpha">Object alpha value.</param>
86 /// <param name="outlineRed">Outline red value.</param>
87 /// <param name="outlineGreen">Outline green value.</param>
88 /// <param name="outlineBlue">Outline blue value.</param>
89 /// <param name="outlineAlpha">Outline alpha value.</param>
90 /// <param name="shadowRed">Shadow red value.</param>
91 /// <param name="shadowGreen">Shadow green value.</param>
92 /// <param name="shadowBlue">Shadow blue value.</param>
93 /// <param name="shadowAlpha">Shadow alpha value.</param>
94 /// <returns></returns>
95 /// <since_tizen> preview </since_tizen>
96 public static bool GetEdjeColorClass(string colorClass, out int red, out int green, out int blue, out int alpha, out int outlineRed, out int outlineGreen, out int outlineBlue,
97 out int outlineAlpha, out int shadowRed, out int shadowGreen, out int shadowBlue, out int shadowAlpha)
99 return Interop.Elementary.edje_color_class_get(colorClass, out red, out green, out blue, out alpha, out outlineRed, out outlineGreen, out outlineBlue, out outlineAlpha,
100 out shadowRed, out shadowGreen, out shadowBlue, out shadowAlpha);
104 /// Processes all the queued up edje messages.
105 /// This function triggers the processing of messages addressed to any (alive) edje objects.
107 /// <since_tizen> preview </since_tizen>
108 public static void ProcessEdjeMessageSignal()
110 Interop.Elementary.edje_message_signal_process();
114 /// Sets the Edje text class.
116 /// <param name="textClass">The text class name.</param>
117 /// <param name="font">The font name.</param>
118 /// <param name="size">The font size.</param>
119 /// <returns>True on success, or False on error.</returns>
120 /// <since_tizen> preview </since_tizen>
121 public static bool SetEdjeTextClass(string textClass, string font, int size)
123 return Interop.Elementary.edje_text_class_set(textClass, font, size);
127 /// Gets the Edje text class.
129 /// <param name="textClass">The text class name.</param>
130 /// <param name="font">The font name.</param>
131 /// <param name="size">The font size.</param>
132 /// <returns>True on success, or False on error.</returns>
133 /// <since_tizen> preview </since_tizen>
134 public static bool GetEdjeTextClass(string textClass, out string font, out int size)
136 return Interop.Elementary.edje_text_class_get(textClass, out font, out size);
140 /// Delete the text class.
142 /// <param name="textClass">The text class name.</param>
143 /// <since_tizen> preview </since_tizen>
144 public static void DeleteEdjeTextClass(string textClass)
146 Interop.Elementary.edje_text_class_del(textClass);
150 /// Pre-multiplies the RGB triplet by an alpha factor.
152 /// <param name="alpha">The alpha factor.</param>
153 /// <param name="red">The red component of the color.</param>
154 /// <param name="green">The green component of the color.</param>
155 /// <param name="blue">The blue component of the color.</param>
156 /// <since_tizen> preview </since_tizen>
157 public static void PremulityplyEvasColorByAlpha(int alpha, ref int red, ref int green, ref int blue)
159 Interop.Evas.evas_color_argb_premul(alpha, ref red, ref green, ref blue);
163 /// Undoes pre-multiplication of the RGB triplet by an alpha factor.
165 /// <param name="alpha">The alpha factor.</param>
166 /// <param name="red">The red component of the color.</param>
167 /// <param name="green">The green component of the color.</param>
168 /// <param name="blue">The blue component of the color.</param>
169 /// <since_tizen> preview </since_tizen>
170 public static void UnPremulityplyEvasColorByAlpha(int alpha, ref int red, ref int green, ref int blue)
172 Interop.Evas.evas_color_argb_unpremul(alpha, ref red, ref green, ref blue);