[NUI] TCSACR-226 code change (#1032)
[platform/core/csapi/tizenfx.git] / src / ElmSharp.Wearable / ElmSharp.Wearable / CircleSurface.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4
5 namespace ElmSharp.Wearable
6 {
7     /// <summary>
8     /// The CircleSurface presents a surface for drawing the circular feature of circle widgets.
9     /// </summary>
10     /// <since_tizen> preview </since_tizen>
11     public class CircleSurface
12     {
13         IntPtr _handle;
14
15         /// <summary>
16         /// Creates and initializes a new instance of the CircleSurface class with a surface on the Conformant widget.
17         /// </summary>
18         /// <param name="conformant">The Conformant widget to create a surface.</param>
19         /// <since_tizen> preview </since_tizen>
20         public CircleSurface(Conformant conformant)
21         {
22             _handle = Interop.Eext.eext_circle_surface_conformant_add(conformant);
23         }
24
25         /// <summary>
26         /// Creates and initializes a new instance of the CircleSurface class with a surface on the Layout widget.
27         /// </summary>
28         /// <param name="layout">The Layout widget to create a surface.</param>
29         /// <since_tizen> preview </since_tizen>
30         public CircleSurface(Layout layout)
31         {
32             _handle = Interop.Eext.eext_circle_surface_layout_add(layout);
33         }
34
35         /// <summary>
36         /// Creates and initializes a new instance of the CircleSurface class with a surface on the Naviframe widget.
37         /// </summary>
38         /// <param name="naviframe">The Naviframe widget to create a surface.</param>
39         /// <since_tizen> preview </since_tizen>
40         public CircleSurface(Naviframe naviframe)
41         {
42             _handle = Interop.Eext.eext_circle_surface_naviframe_add(naviframe.RealHandle);
43         }
44
45         /// <summary>
46         /// Creates and initializes a new instance of the CircleSurface class with no surface.
47         /// </summary>
48         /// <since_tizen> preview </since_tizen>
49         public CircleSurface()
50         {
51             _handle = IntPtr.Zero;
52         }
53
54         /// <summary>
55         /// Gets the handle for CircleSurface.
56         /// </summary>
57         /// <since_tizen> preview </since_tizen>
58         public IntPtr Handle => _handle;
59
60         /// <summary>
61         /// Deletes the given CircleSurface.
62         /// </summary>
63         /// <since_tizen> preview </since_tizen>
64         public void Delete()
65         {
66             if (Handle != IntPtr.Zero)
67             {
68                 Interop.Eext.eext_circle_surface_del(Handle);
69                 _handle = IntPtr.Zero;
70             }
71         }
72
73         internal static CircleSurface CreateCircleSurface(EvasObject obj)
74         {
75             if (obj is Conformant) return new CircleSurface(obj as Conformant);
76             else if (obj is Naviframe) return new CircleSurface(obj as Naviframe);
77             else if (obj is Layout) return new CircleSurface(obj as Layout);
78             else return new CircleSurface();
79         }
80     }
81 }