Release 4.0.0-preview1-00301
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / DaliEnumConstants.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17 using System;
18 using System.Reflection;
19 using System.Diagnostics;
20 using System.Runtime.CompilerServices;
21
22 namespace Tizen.NUI
23 {
24   namespace Constants
25   {
26     /// <summary>
27     /// Enumeration for texture types.
28     /// </summary>
29     public enum TextureType
30     {
31             /// <summary>
32             /// One 2D image
33             /// </summary>
34             /// <since_tizen> 3 </since_tizen>
35             Texture2D = Tizen.NUI.TextureType.TEXTURE_2D,
36             /// <summary>
37             /// Six 2D images arranged in a cube-shape
38             /// </summary>
39             /// <since_tizen> 3 </since_tizen>
40             TextureCube = Tizen.NUI.TextureType.TEXTURE_CUBE
41     }
42
43     /// <summary>
44     /// Enumeration for stereoscopic view modes.
45     /// </summary>
46     public enum ViewMode
47     {
48             /// <summary>
49             /// Monoscopic (single camera). This is the default.
50             /// </summary>
51             /// <since_tizen> 3 </since_tizen>
52             Mono = Tizen.NUI.ViewMode.MONO,
53             /// <summary>
54             /// Stereoscopic. Frame buffer is split horizontally with the left and right camera views in their respective sides.
55             /// </summary>
56             /// <since_tizen> 3 </since_tizen>
57             StereoHorizontal = Tizen.NUI.ViewMode.STEREO_HORIZONTAL,
58             /// <summary>
59             /// Stereoscopic. Frame buffer is split vertically with the left camera view at the top and the right camera view at the bottom.
60             /// </summary>
61             /// <since_tizen> 3 </since_tizen>
62             StereoVertical = Tizen.NUI.ViewMode.STEREO_VERTICAL,
63             /// <summary>
64             /// Stereoscopic. Left/Right camera views are rendered into the framebuffer on alternate frames.
65             /// </summary>
66             /// <since_tizen> 3 </since_tizen>
67             StereoInterlaced = Tizen.NUI.ViewMode.STEREO_INTERLACED
68     }
69
70         /// <summary>
71         /// Enumeration for the direction
72         /// </summary>
73         /// <since_tizen> 3 </since_tizen>
74         public struct Direction
75         {
76             /// <summary>
77             /// Enumeration for the Direction types.
78             /// </summary>
79             /// <since_tizen> 3 </since_tizen>
80             public enum Type
81             {
82                 /// <summary>
83                 /// from Left to Right
84                 /// </summary>
85                 /// <since_tizen> 3 </since_tizen>
86                 LeftToRight = Tizen.NUI.DirectionType.LEFT_TO_RIGHT,
87                 /// <summary>
88                 /// from Right to Left
89                 /// </summary>
90                 /// <since_tizen> 3 </since_tizen>
91                 RightToLeft = Tizen.NUI.DirectionType.RIGHT_TO_LEFT
92             }
93         }
94
95
96
97         /// <summary>
98         /// ToolTip
99         /// </summary>
100         /// <since_tizen> 3 </since_tizen>
101         public struct Tooltip
102         {
103             /// <summary>
104             /// The properties used for a Tooltip.
105             /// </summary>
106             /// <since_tizen> 3 </since_tizen>
107             public struct Property
108             {
109                 /// <summary>
110                 /// The content to display.
111                 /// </summary>
112                 /// <since_tizen> 3 </since_tizen>
113                 public static readonly int Content = NDalic.TOOLTIP_CONTENT;
114                 /// <summary>
115                 /// The layout of the content.
116                 /// </summary>\
117                 /// <since_tizen> 3 </since_tizen>
118                 public static readonly int Layout = NDalic.TOOLTIP_LAYOUT;
119                 /// <summary>
120                 /// Time to wait in seconds before a tooltip is shown while the is movement is within the allowed threshold.
121                 /// </summary>
122                 /// <since_tizen> 3 </since_tizen>
123                 public static readonly int WaitTime = NDalic.TOOLTIP_WAIT_TIME;
124                 /// <summary>
125                 /// The background of the tooltip.
126                 /// </summary>
127                 /// <since_tizen> 3 </since_tizen>
128                 public static readonly int Background = NDalic.TOOLTIP_BACKGROUND;
129                 /// <summary>
130                 /// The tail used by the tooltip.
131                 /// </summary>
132                 /// <since_tizen> 3 </since_tizen>
133                 public static readonly int Tail = NDalic.TOOLTIP_TAIL;
134                 /// <summary>
135                 /// The position of the tooltip in relation to the control.
136                 /// </summary>
137                 /// <since_tizen> 3 </since_tizen>
138                 public static readonly int Position = NDalic.TOOLTIP_POSITION;
139                 /// <summary>
140                 /// If Tooltip::Position::HOVER_POINT is used for the POSITION, then this is the offset the tooltip is displayed at from the hover point.
141                 /// </summary>
142                 /// <since_tizen> 3 </since_tizen>
143                 public static readonly int HoverPointOffset = NDalic.TOOLTIP_HOVER_POINT_OFFSET;
144                 /// <summary>
145                 /// The movement threshold allowed before showing (or hiding a popup).
146                 /// </summary>
147                 /// <since_tizen> 3 </since_tizen>
148                 public static readonly int MovementThreshold = NDalic.TOOLTIP_MOVEMENT_THRESHOLD;
149                 /// <summary>
150                 /// If true, the tooltip will disappear after hover movement beyond a certain distance.
151                 /// </summary>
152                 /// <since_tizen> 3 </since_tizen>
153                 public static readonly int DisappearOnMovement = NDalic.TOOLTIP_DISAPPEAR_ON_MOVEMENT;
154             }
155
156             /// <summary>
157             /// Background Property
158             /// </summary>
159             public struct BackgroundProperty
160             {
161                 /// <summary>
162                 /// The image to use as the background.
163                 /// </summary>
164                 /// <since_tizen> 3 </since_tizen>
165                 public static readonly int Visual = NDalic.TOOLTIP_BACKGROUND_VISUAL;
166                 /// <summary>
167                 /// The size of the borders in the order: left, right, bottom, top.
168                 /// </summary>
169                 /// <since_tizen> 3 </since_tizen>
170                 public static readonly int Border = NDalic.TOOLTIP_BACKGROUND_BORDER;
171             }
172
173             /// <summary>
174             /// The properties of the tail used by the tooltip.
175             /// </summary>
176             public struct TailProperty
177             {
178                 /// <summary>
179                 /// Whether to show the tail or not.
180                 /// </summary>
181                 /// <since_tizen> 3 </since_tizen>
182                 public static readonly int Visibility = NDalic.TOOLTIP_TAIL_VISIBILITY;
183                 /// <summary>
184                 /// The image used for the tail if it is above the tooltip.
185                 /// </summary>
186                 /// <since_tizen> 3 </since_tizen>
187                 public static readonly int AboveVisual = NDalic.TOOLTIP_TAIL_ABOVE_VISUAL;
188                 /// <summary>
189                 /// The image used for the tail if it is below the tooltip.
190                 /// </summary>
191                 /// <since_tizen> 3 </since_tizen>
192                 public static readonly int BelowVisual = NDalic.TOOLTIP_TAIL_BELOW_VISUAL;
193             }
194         }
195     } // namespace Constants
196
197
198 internal class NUILog
199 {
200     [Conditional("DEBUG_ON")]
201     public static void Debug(string msg,
202         [CallerLineNumber] int lineNum = 0,
203         [CallerMemberName] string caller = null,
204         [CallerFilePath] string file = null
205     )
206     {
207         Tizen.Log.Fatal("NUI", $"{msg} (at {DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fffffff")} line {lineNum} of {caller} in {file})" );
208     }
209
210     public static void Error(string msg,
211         [CallerLineNumber] int lineNum = 0,
212         [CallerMemberName] string caller = null,
213         [CallerFilePath] string file = null
214     )
215     {
216         Tizen.Log.Fatal("NUI", $"[ERROR] {msg} (at {DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fffffff")} line {lineNum} of {caller} in {file})" );
217     }
218 }
219
220 } // namesapce Dali