2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 public class ProgressBar : Layout
25 public ProgressBar(EvasObject parent) : base(parent)
27 _changed = new SmartEvent(this, this.RealHandle, "changed");
28 _changed.On += (s, e) =>
30 ValueChanged?.Invoke(this, EventArgs.Empty);
34 public event EventHandler ValueChanged;
36 public bool IsPulseMode
40 return Interop.Elementary.elm_progressbar_pulse_get(RealHandle);
44 Interop.Elementary.elm_progressbar_pulse_set(RealHandle, value);
52 return Interop.Elementary.elm_progressbar_value_get(RealHandle);
56 Interop.Elementary.elm_progressbar_value_set(RealHandle, value);
64 return Interop.Elementary.elm_progressbar_span_size_get(RealHandle);
68 Interop.Elementary.elm_progressbar_span_size_set(RealHandle, value);
72 public bool IsHorizontal
76 return Interop.Elementary.elm_progressbar_horizontal_get(RealHandle);
80 Interop.Elementary.elm_progressbar_horizontal_set(RealHandle, value);
84 public bool IsInverted
88 return Interop.Elementary.elm_progressbar_inverted_get(RealHandle);
92 Interop.Elementary.elm_progressbar_inverted_set(RealHandle, value);
96 public string UnitFormat
100 return Interop.Elementary.elm_progressbar_unit_format_get(RealHandle);
104 Interop.Elementary.elm_progressbar_unit_format_set(RealHandle, value);
108 public void PlayPulse()
110 Interop.Elementary.elm_progressbar_pulse(RealHandle, true);
113 [Obsolete("use StopPulse instead")]
114 public void StopPluse()
116 Interop.Elementary.elm_progressbar_pulse(RealHandle, false);
119 public void StopPulse()
121 Interop.Elementary.elm_progressbar_pulse(RealHandle, false);
124 protected override IntPtr CreateHandle(EvasObject parent)
126 IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle);
127 Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default");
129 RealHandle = Interop.Elementary.elm_progressbar_add(handle);
130 Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle);