Change EvasObject's API visibility to protected from internal.
[platform/core/csapi/tizenfx.git] / src / ElmSharp / ElmSharp / Spinner.cs
1 using System;
2
3 namespace ElmSharp
4 {
5     public class Spinner : Layout
6     {
7         double _minimum = 0.0;
8         double _maximum = 100.0;
9
10         Interop.SmartEvent _changed;
11         Interop.SmartEvent _delayedChanged;
12
13         public Spinner(EvasObject parent) : base(parent)
14         {
15             _changed = new Interop.SmartEvent(this, Handle, "changed");
16             _changed.On += (s, e) => ValueChanged?.Invoke(this, EventArgs.Empty);
17
18             _delayedChanged = new Interop.SmartEvent(this, Handle, "delay,changed");
19             _delayedChanged.On += (s, e) => DelayedValueChanged?.Invoke(this, EventArgs.Empty);
20         }
21
22         public event EventHandler ValueChanged;
23
24         public event EventHandler DelayedValueChanged;
25
26         public string LabelFormat
27         {
28             get
29             {
30                 return Interop.Elementary.elm_spinner_label_format_get(Handle);
31             }
32             set
33             {
34                 Interop.Elementary.elm_spinner_label_format_set(Handle, value);
35             }
36         }
37
38         public double Minimum
39         {
40             get
41             {
42                 return _minimum;
43             }
44             set
45             {
46                 _minimum = value;
47                 Interop.Elementary.elm_spinner_min_max_set(Handle, _minimum, _maximum);
48             }
49         }
50
51         public double Maximum
52         {
53             get
54             {
55                 return _maximum;
56             }
57             set
58             {
59                 _maximum = value;
60                 Interop.Elementary.elm_spinner_min_max_set(Handle, _minimum, _maximum);
61             }
62         }
63
64         public double Step
65         {
66             get
67             {
68                 return Interop.Elementary.elm_spinner_step_get(Handle);
69             }
70             set
71             {
72                 Interop.Elementary.elm_spinner_step_set(Handle, value);
73             }
74         }
75
76         public double Value
77         {
78             get
79             {
80                 return Interop.Elementary.elm_spinner_value_get(Handle);
81             }
82             set
83             {
84                 Interop.Elementary.elm_spinner_value_set(Handle, value);
85             }
86         }
87
88         public double Interval
89         {
90             get
91             {
92                 return Interop.Elementary.elm_spinner_interval_get(Handle);
93             }
94             set
95             {
96                 Interop.Elementary.elm_spinner_interval_set(Handle, value);
97             }
98         }
99
100         public double RoundBase
101         {
102             get
103             {
104                 return Interop.Elementary.elm_spinner_base_get(Handle);
105             }
106             set
107             {
108                 Interop.Elementary.elm_spinner_base_set(Handle, value);
109             }
110         }
111
112         public int RoundValue
113         {
114             get
115             {
116                 return Interop.Elementary.elm_spinner_round_get(Handle);
117             }
118             set
119             {
120                 Interop.Elementary.elm_spinner_round_set(Handle, value);
121             }
122         }
123
124         public bool IsWrapEnabled
125         {
126             get
127             {
128                 return Interop.Elementary.elm_spinner_wrap_get(Handle);
129             }
130             set
131             {
132                 Interop.Elementary.elm_spinner_wrap_set(Handle, value);
133             }
134         }
135
136         public bool IsEditable
137         {
138             get
139             {
140                 return Interop.Elementary.elm_spinner_editable_get(Handle);
141             }
142             set
143             {
144                 Interop.Elementary.elm_spinner_editable_set(Handle, value);
145             }
146         }
147
148
149         public void AddSpecialValue(double value, string label)
150         {
151             Interop.Elementary.elm_spinner_special_value_add(Handle, value, label);
152         }
153
154         public void RemoveSpecialValue(double value)
155         {
156             Interop.Elementary.elm_spinner_special_value_del(Handle, value);
157         }
158
159         public string GetSpecialValue(double value)
160         {
161             return Interop.Elementary.elm_spinner_special_value_get(Handle, value);
162         }
163
164         protected override IntPtr CreateHandle(EvasObject parent)
165         {
166             return Interop.Elementary.elm_spinner_add(parent);
167         }
168     }
169 }