[EflSharp] Update Circle and efl cs files (#945)
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / Circle / MoreOptionItem.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             /// The MoreOptioniItem is an item used by more option widget.
13             /// </summary>
14             /// <since_tizen> 6 </since_tizen>
15             public class MoreOptionItem
16             {
17                 const string MainTextPartName = "selector,main_text";
18                 const string SubTextPartName = "selector,sub_text";
19                 const string IconPartName = "item,icon";
20
21                 string _mainText;
22                 string _subText;
23                 Image _icon;
24                 Image _preIcon;
25
26                 public IntPtr _handle;
27                 public IntPtr NativeHandle
28                 {
29                     set
30                     {
31                         if (_handle == value) return;
32                         _handle = value;
33
34                         if (_handle == null) return;
35
36                         if (_mainText != null)
37                             Interop.Eext.eext_more_option_item_part_text_set(NativeHandle, MainTextPartName, _mainText);
38                         if (_subText != null)
39                             Interop.Eext.eext_more_option_item_part_text_set(NativeHandle, SubTextPartName, _subText);
40                         if (_icon != null)
41                             Interop.Eext.eext_more_option_item_part_content_set(NativeHandle, IconPartName, _icon.NativeHandle);
42                     }
43                     get
44                     {
45                         return _handle;
46                     }
47                 }
48
49                 /// <summary>
50                 /// Sets or gets the main text.
51                 /// </summary>
52                 /// <since_tizen> 6 </since_tizen>
53                 public string MainText
54                 {
55                     set
56                     {
57                         if (_mainText == value) return;
58                         _mainText = value;
59                         if (NativeHandle != IntPtr.Zero)
60                         {
61                             Interop.Eext.eext_more_option_item_part_text_set(NativeHandle, MainTextPartName, _mainText);
62                         }
63                     }
64
65                     get
66                     {
67                         return _mainText;
68                     }
69                 }
70
71                 /// <summary>
72                 /// Sets or gets the sub text.
73                 /// </summary>
74                 /// <since_tizen> 6 </since_tizen>
75                 public string SubText
76                 {
77                     set
78                     {
79                         if (_subText == value) return;
80                         _subText = value;
81                         if (NativeHandle != IntPtr.Zero)
82                         {
83                             Interop.Eext.eext_more_option_item_part_text_set(NativeHandle, SubTextPartName, _subText);
84                         }
85                     }
86
87                     get
88                     {
89                         return _subText;
90                     }
91                 }
92
93                 /// <summary>
94                 /// Sets or gets the icon image.
95                 /// </summary>
96                 /// <since_tizen> 6 </since_tizen>
97                 public Image Icon
98                 {
99                     set
100                     {
101                         if (_icon != null) _preIcon = _icon;
102                         if (_icon == value) return;
103                         _icon = value;
104
105                         if (NativeHandle != IntPtr.Zero)
106                         {
107                             if (_preIcon != null)
108                                 _preIcon.SetVisible(false);
109                             Interop.Eext.eext_more_option_item_part_content_set(NativeHandle, IconPartName, _icon.NativeHandle);
110                         }
111                     }
112                     get
113                     {
114                         return _icon;
115                     }
116                 }
117             }
118         }
119     }
120 }