Release 4.0.0-preview1-00051
[platform/core/csapi/tizenfx.git] / src / ElmSharp.Wearable / ElmSharp.Wearable / MoreOptionItem.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4
5 namespace ElmSharp.Wearable
6 {
7     public class MoreOptionItem
8     {
9         const string MainTextPartName = "selector,main_text";
10         const string SubTextPartName = "selector,sub_text";
11         const string IconPartName = "item,icon";
12
13         string _mainText;
14         string _subText;
15         Image _icon;
16         IntPtr _handle;
17
18         public IntPtr Handle
19         {
20             get
21             {
22                 return _handle;
23             }
24             set
25             {
26                 if (_handle == value) return;
27                 _handle = value;
28                 if (_mainText != null)
29                     Interop.Eext.eext_more_option_item_part_text_set(Handle, MainTextPartName, _mainText);
30                 if (_subText != null)
31                     Interop.Eext.eext_more_option_item_part_text_set(Handle, SubTextPartName, _subText);
32                 if (_icon != null)
33                     Interop.Eext.eext_more_option_item_part_content_set(Handle, IconPartName, _icon);
34             }
35         }
36
37         public MoreOptionItem()
38         {
39             _icon = null;
40         }
41
42         public string MainText
43         {
44             set
45             {
46                 if (_mainText == value) return;
47                 _mainText = value;
48                 if (Handle != IntPtr.Zero)
49                 {
50                     Interop.Eext.eext_more_option_item_part_text_set(Handle, MainTextPartName, _mainText);
51                 }
52             }
53
54             get
55             {
56                 return _mainText;
57             }
58         }
59
60         public string SubText
61         {
62             set
63             {
64                 if (_subText == value) return;
65                 _subText = value;
66                 if (Handle != IntPtr.Zero)
67                 {
68                     Interop.Eext.eext_more_option_item_part_text_set(Handle, SubTextPartName, _subText);
69                 }
70             }
71
72             get
73             {
74                 return _subText;
75             }
76         }
77
78         public Image Icon
79         {
80             set
81             {
82                 if (_icon == value) return;
83                 _icon = value;
84                 if (Handle != IntPtr.Zero)
85                 {
86                     Interop.Eext.eext_more_option_item_part_content_set(Handle, IconPartName, _icon);
87                 }
88             }
89             get
90             {
91                 return _icon;
92             }
93         }
94     }
95 }