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.
22 /// The ToolbarItem is an item of the toolbar.
24 /// <since_tizen> preview </since_tizen>
25 public class ToolbarItem : ItemObject
29 internal ToolbarItem(string text, string icon) : base(IntPtr.Zero)
36 /// Sets or gets the icon path of the item.
38 /// <since_tizen> preview </since_tizen>
48 Interop.Elementary.elm_toolbar_item_icon_set(Handle, value);
53 /// Sets or gets the text string of the item.
55 /// <since_tizen> preview </since_tizen>
65 SetPartText(null, value);
70 /// Sets or gets the enable of the item.
72 /// <since_tizen> preview </since_tizen>
73 [Obsolete("Enabled is obsolete as of version v1.1.0-beta-023. Please use IsEnabled instead.")]
87 /// Sets or gets whether displaying the item as a separator.
89 /// <remarks>Items aren't set as a separator by default. If set as a separator, it displays a separator theme, so it won't display the icons or labels.</remarks>
90 /// <since_tizen> preview </since_tizen>
91 public bool IsSeparator
95 return Interop.Elementary.elm_toolbar_item_separator_get(Handle);
99 Interop.Elementary.elm_toolbar_item_separator_set(Handle, value);
104 /// Sets or gets whether the item is selected.
106 /// <since_tizen> preview </since_tizen>
107 public bool IsSelected
111 return Interop.Elementary.elm_toolbar_item_selected_get(Handle);
115 Interop.Elementary.elm_toolbar_item_selected_set(Handle, value);
120 /// Selected will be triggered when the item is selected.
122 /// <since_tizen> preview </since_tizen>
123 public event EventHandler Selected;
126 /// LongPressed will be triggered when the item is pressed for a long time.
128 /// <since_tizen> preview </since_tizen>
129 public event EventHandler LongPressed;
132 /// Clicked will be triggered when the item is clicked.
134 /// <since_tizen> preview </since_tizen>
135 public event EventHandler Clicked;
137 internal void SendSelected()
139 Selected?.Invoke(this, EventArgs.Empty);
141 internal void SendLongPressed()
143 LongPressed?.Invoke(this, EventArgs.Empty);
145 internal void SendClicked()
147 Clicked?.Invoke(this, EventArgs.Empty);