[EflSharp] Separate efl and Circle cs files and Update cs files (#786)
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / Circle / CircleScroller.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4
5 namespace Efl
6 {
7     namespace Ui
8     {
9         namespace Wearable
10         {
11             /// <summary>
12             /// CircleScrollerVerticalBar is a part used to set the color of the vertical bar.
13             /// </summary>
14             /// <since_tizen> 6 </since_tizen>
15             public class CircleScrollerVerticalBar : ICircleColor
16             {
17                 IntPtr _handle;
18                 public CircleScrollerVerticalBar(IntPtr CircleHandle) { _handle = CircleHandle; }
19
20                 /// <summary>
21                 /// Sets the color of the vertical bar on the circle scroller.
22                 /// </summary>
23                 /// <since_tizen> 6 </since_tizen>
24                 public void SetColor(int r, int g, int b, int a)
25                 {
26                     if (_handle != null)
27                         Interop.Eext.eext_circle_object_color_set(_handle, r, g, b, a);
28                 }
29
30                 /// <summary>
31                 /// Gets the color of the vertical bar on the circle scroller.
32                 /// </summary>
33                 /// <since_tizen> 6 </since_tizen>
34                 public void GetColor(out int r, out int g, out int b, out int a)
35                 {
36                     r = g = b = a = -1;
37                     if (_handle != null)
38                         Interop.Eext.eext_circle_object_color_get(_handle, out r, out g, out b, out a);
39                 }
40             }
41
42             /// <summary>
43             /// CircleScrollerVerticalBarBackground is a part used to set the background color of the vertical bar.
44             /// </summary>
45             /// <since_tizen> 6 </since_tizen>
46             public class CircleScrollerVerticalBarBackground : ICircleColor
47             {
48                 IntPtr _handle;
49                 public CircleScrollerVerticalBarBackground(IntPtr CircleHandle) { _handle = CircleHandle; }
50
51                 /// <summary>
52                 /// Sets the background color of the vertical bar on the circle scroller.
53                 /// </summary>
54                 /// <since_tizen> 6 </since_tizen>
55                 public void SetColor(int r, int g, int b, int a)
56                 {
57                     if (_handle != null)
58                         Interop.Eext.eext_circle_object_item_color_set(_handle, "vertical,scroll,bg", r, g, b, a);
59                 }
60
61                 /// <summary>
62                 /// Gets the background color of the vertical bar on the circle scroller.
63                 /// </summary>
64                 /// <since_tizen> 6 </since_tizen>
65                 public void GetColor(out int r, out int g, out int b, out int a)
66                 {
67                     r = g = b = a = -1;
68                     if (_handle != null)
69                         Interop.Eext.eext_circle_object_item_color_get(_handle, "vertical,scroll,bg", out r, out g, out b, out a);
70                 }
71             }
72
73             /// <summary>
74             /// CircleScrollerHorizontalBar is a part used to set the color of the horizontal bar.
75             /// </summary>
76             /// <since_tizen> 6 </since_tizen>
77             public class CircleScrollerHorizontalBar : ICircleColor
78             {
79                 IntPtr _handle;
80                 public CircleScrollerHorizontalBar(IntPtr CircleHandle) { _handle = CircleHandle; }
81
82                 /// <summary>
83                 /// Sets the color of the horizontal bar on the circle scroller.
84                 /// </summary>
85                 /// <since_tizen> 6 </since_tizen>
86                 public void SetColor(int r, int g, int b, int a)
87                 {
88                     if (_handle != null)
89                         Interop.Eext.eext_circle_object_item_color_set(_handle, "horizontal,scroll,bar", r, g, b, a);
90                 }
91
92                 /// <summary>
93                 /// Gets the color of the horizontal bar on the circle scroller.
94                 /// </summary>
95                 /// <since_tizen> 6 </since_tizen>
96                 public void GetColor(out int r, out int g, out int b, out int a)
97                 {
98                     r = g = b = a = -1;
99                     if (_handle != null)
100                         Interop.Eext.eext_circle_object_item_color_get(_handle, "horizontal,scroll,bar", out r, out g, out b, out a);
101                 }
102             }
103
104             /// <summary>
105             /// CircleScrollerHorizontalBarBackground is a part used to set the background color of the horizontal bar.
106             /// </summary>
107             /// <since_tizen> 6 </since_tizen>
108             public class CircleScrollerHorizontalBarBackground : ICircleColor
109             {
110                 IntPtr _handle;
111                 public CircleScrollerHorizontalBarBackground(IntPtr CircleHandle) { _handle = CircleHandle; }
112
113                 /// <summary>
114                 /// Sets the background color of the horizontal bar on the circle scroller.
115                 /// </summary>
116                 /// <since_tizen> 6 </since_tizen>
117                 public void SetColor(int r, int g, int b, int a)
118                 {
119                     if (_handle != null)
120                         Interop.Eext.eext_circle_object_item_color_set(_handle, "horizontal,scroll,bg", r, g, b, a);
121                 }
122
123                 /// <summary>
124                 /// Gets the background color of the horizontal bar on the circle scroller.
125                 /// </summary>
126                 /// <since_tizen> 6 </since_tizen>
127                 public void GetColor(out int r, out int g, out int b, out int a)
128                 {
129                     r = g = b = a = -1;
130                     if (_handle != null)
131                         Interop.Eext.eext_circle_object_item_color_get(_handle, "horizontal,scroll,bg", out r, out g, out b, out a);
132                 }
133             }
134
135             public class CircleScroller : Efl.Ui.Scroller, ICircleWidget
136             {
137                 IntPtr _handle;
138
139                 /// <summary>
140                 /// Get the handle for the circle widget.
141                 /// </summary>
142                 /// <since_tizen> 6 </since_tizen>
143                 public virtual IntPtr CircleHandle => _handle;
144
145                 /// <summary>
146                 /// Sets or gets the color of the vertical bar.
147                 /// </summary>
148                 /// <since_tizen> 6 </since_tizen>
149                 public CircleScrollerVerticalBar VerticalBar;
150
151                 /// <summary>
152                 /// Sets or gets the background color of the vertical bar.
153                 /// </summary>
154                 /// <since_tizen> 6 </since_tizen>
155                 public CircleScrollerVerticalBarBackground VerticalBarBackground;
156
157                 /// <summary>
158                 /// Sets or gets the color of the horizontal bar.
159                 /// </summary>
160                 /// <since_tizen> 6 </since_tizen>
161                 public CircleScrollerHorizontalBar HorizontalBar;
162
163                 /// <summary>
164                 /// Sets or gets the background color of the horizontal bar.
165                 /// </summary>
166                 /// <since_tizen> 6 </since_tizen>
167                 public CircleScrollerHorizontalBarBackground HorizontalBarBackground;
168
169                 /// <summary>
170                 /// Creates and initializes a new instance of the CircleScroller class.
171                 /// </summary>
172                 /// <param name="parent">The Efl.Ui.Widget to which the new CircleScroller will be attached as a child.</par
173                 /// <since_tizen> 6 </since_tizen>
174                 public CircleScroller(Efl.Ui.Widget parent) : base(parent)
175                 {
176                     _handle = Interop.Eext.eext_circle_object_scroller_add(this.NativeHandle, IntPtr.Zero);
177
178                     VerticalBar = new CircleScrollerVerticalBar(_handle);
179                     VerticalBarBackground = new CircleScrollerVerticalBarBackground(_handle);
180                     HorizontalBar = new CircleScrollerHorizontalBar(_handle);
181                     HorizontalBarBackground = new CircleScrollerHorizontalBarBackground(_handle);
182
183                     elm_layout_content_set(this.NativeHandle, "efl.swallow.vg", CircleHandle);
184                 }
185
186                 [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)]
187                 internal static extern bool elm_layout_content_set(IntPtr obj, string swallow, IntPtr content);
188
189                 /// <summary>
190                 /// Sets or gets the disabled state of the circle scroller.
191                 /// </summary>
192                 /// <since_tizen> 6 </since_tizen>
193                 public bool Disable
194                 {
195                     get => !Enable;
196                     set => Enable = !value;
197                 }
198
199                 /// <summary>
200                 /// Sets or gets the enabled state of the circle scroller.
201                 /// </summary>
202                 /// <since_tizen> 6 </since_tizen>
203                 public bool Enable
204                 {
205                     get
206                     {
207                         return !Interop.Eext.eext_circle_object_disabled_get(CircleHandle);
208                     }
209                     set
210                     {
211                         Interop.Eext.eext_circle_object_disabled_set(CircleHandle, !value);
212                     }
213                 }
214
215                 /// <summary>
216                 /// Sets or gets the value of HorizontalScrollBarVisiblePolicy.
217                 /// </summary>
218                 /// <since_tizen> 6 </since_tizen>
219                 public ScrollbarMode HorizontalScrollBarVisiblePolicy
220                 {
221                     get
222                     {
223                         int policy;
224                         Interop.Eext.eext_circle_object_scroller_policy_get(CircleHandle, out policy, IntPtr.Zero);
225                         return (ScrollbarMode)policy;
226                     }
227                     set
228                     {
229                         ScrollbarMode v = VerticalScrollBarVisiblePolicy;
230                         Interop.Eext.eext_circle_object_scroller_policy_set(CircleHandle, (int)value, (int)v);
231                     }
232                 }
233
234                 /// <summary>
235                 /// Sets or gets the value of VerticalScrollBarVisiblePolicy.
236                 /// </summary>
237                 /// <since_tizen> 6 </since_tizen>
238                 public ScrollbarMode VerticalScrollBarVisiblePolicy
239                 {
240                     get
241                     {
242                         int policy;
243                         Interop.Eext.eext_circle_object_scroller_policy_get(CircleHandle, IntPtr.Zero, out policy);
244                         return (ScrollbarMode)policy;
245                     }
246                     set
247                     {
248                         ScrollbarMode h = HorizontalScrollBarVisiblePolicy;
249                         Interop.Eext.eext_circle_object_scroller_policy_set(CircleHandle, (int)h, (int)value);
250                     }
251                 }
252
253                 /// <summary>
254                 /// Sets or gets the line width of the vertical scroll bar.
255                 /// </summary>
256                 /// <since_tizen> 6 </since_tizen>
257                 public int VerticalScrollBarLineWidth
258                 {
259                     get
260                     {
261                         return Interop.Eext.eext_circle_object_line_width_get(CircleHandle);
262                     }
263                     set
264                     {
265                         Interop.Eext.eext_circle_object_line_width_set(CircleHandle, value);
266                     }
267                 }
268
269                 /// <summary>
270                 /// Sets or gets the line width of the horizontal scroll bar.
271                 /// </summary>
272                 /// <since_tizen> 6 </since_tizen>
273                 public int HorizontalScrollBarLineWidth
274                 {
275                     get
276                     {
277                         return Interop.Eext.eext_circle_object_item_line_width_get(CircleHandle, "horizontal,scroll,bar");
278                     }
279                     set
280                     {
281                         Interop.Eext.eext_circle_object_item_line_width_set(CircleHandle, "horizontal,scroll,bar", value);
282                     }
283                 }
284
285                 /// <summary>
286                 /// Sets or gets the line width of the vertical scroll background.
287                 /// </summary>
288                 /// <since_tizen> 6 </since_tizen>
289                 public int VerticalScrollBackgroundLineWidth
290                 {
291                     get
292                     {
293                         return Interop.Eext.eext_circle_object_item_line_width_get(CircleHandle, "vertical,scroll,bg");
294                     }
295                     set
296                     {
297                         Interop.Eext.eext_circle_object_item_line_width_set(CircleHandle, "vertical,scroll,bg", value);
298                     }
299                 }
300
301                 /// <summary>
302                 /// Sets or gets the line width of the horizontal scroll background.
303                 /// </summary>
304                 /// <since_tizen> 6 </since_tizen>
305                 public int HorizontalScrollBackgroundLineWidth
306                 {
307                     get
308                     {
309                         return Interop.Eext.eext_circle_object_item_line_width_get(CircleHandle, "horizontal,scroll,bg");
310                     }
311                     set
312                     {
313                         Interop.Eext.eext_circle_object_item_line_width_set(CircleHandle, "horizontal,scroll,bg", value);
314                     }
315                 }
316
317                 /// <summary>
318                 /// Sets or gets the radius of the vertical scroll bar.
319                 /// </summary>
320                 /// <since_tizen> 6 </since_tizen>
321                 public double VerticalScrollBarRadius
322                 {
323                     get
324                     {
325                         return Interop.Eext.eext_circle_object_radius_get(CircleHandle);
326                     }
327                     set
328                     {
329                         Interop.Eext.eext_circle_object_radius_set(CircleHandle, value);
330                     }
331                 }
332
333                 /// <summary>
334                 /// Sets or gets the radius of the horizontal scroll bar.
335                 /// </summary>
336                 /// <since_tizen> 6 </since_tizen>
337                 public double HorizontalScrollBarRadius
338                 {
339                     get
340                     {
341                         return Interop.Eext.eext_circle_object_item_radius_get(CircleHandle, "horizontal,scroll,bar");
342                     }
343                     set
344                     {
345                         Interop.Eext.eext_circle_object_item_radius_set(CircleHandle, "horizontal,scroll,bar", value);
346                     }
347                 }
348
349                 /// <summary>
350                 /// Sets or gets the radius of the vertical scroll background.
351                 /// </summary>
352                 /// <since_tizen> 6 </since_tizen>
353                 public double VerticalScrollBackgroundRadius
354                 {
355                     get
356                     {
357                         return Interop.Eext.eext_circle_object_item_radius_get(CircleHandle, "vertical,scroll,bg");
358                     }
359                     set
360                     {
361                         Interop.Eext.eext_circle_object_item_radius_set(CircleHandle, "vertical,scroll,bg", value);
362                     }
363                 }
364
365                 /// <summary>
366                 /// Sets or gets the radius of the horizontal scroll background.
367                 /// </summary>
368                 /// <since_tizen> 6 </since_tizen>
369                 public double HorizontalScrollBackgroundRadius
370                 {
371                     get
372                     {
373                         return Interop.Eext.eext_circle_object_item_radius_get(CircleHandle, "horizontal,scroll,bg");
374                     }
375                     set
376                     {
377                         Interop.Eext.eext_circle_object_item_radius_set(CircleHandle, "horizontal,scroll,bg", value);
378                     }
379                 }
380             }
381         }
382     }
383 }