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
30 internal ToolbarItem(string text, string icon) : base(IntPtr.Zero)
36 internal ToolbarItem(string text, string icon, EvasObject parent) : base(IntPtr.Zero, parent)
43 /// Sets or gets the icon path of the item.
45 /// <since_tizen> preview </since_tizen>
55 Interop.Elementary.elm_toolbar_item_icon_set(Handle, value);
60 /// Sets or gets the text string of the item.
62 /// <since_tizen> preview </since_tizen>
72 SetPartText(null, value);
77 /// Sets or gets the enable of the item.
79 /// <since_tizen> preview </since_tizen>
80 [Obsolete("Enabled is obsolete as of version v1.1.0-beta-023. Please use IsEnabled instead.")]
94 /// Sets or gets whether displaying the item as a separator.
96 /// <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>
97 /// <since_tizen> preview </since_tizen>
98 public bool IsSeparator
102 return Interop.Elementary.elm_toolbar_item_separator_get(Handle);
106 Interop.Elementary.elm_toolbar_item_separator_set(Handle, value);
111 /// Sets or gets whether the item is selected.
113 /// <since_tizen> preview </since_tizen>
114 public bool IsSelected
118 return Interop.Elementary.elm_toolbar_item_selected_get(Handle);
122 Interop.Elementary.elm_toolbar_item_selected_set(Handle, value);
127 /// Selected will be triggered when the item is selected.
129 /// <since_tizen> preview </since_tizen>
130 public event EventHandler Selected;
133 /// LongPressed will be triggered when the item is pressed for a long time.
135 /// <since_tizen> preview </since_tizen>
136 public event EventHandler LongPressed;
139 /// Clicked will be triggered when the item is clicked.
141 /// <since_tizen> preview </since_tizen>
142 public event EventHandler Clicked;
144 internal void SendSelected()
146 Selected?.Invoke(this, EventArgs.Empty);
148 internal void SendLongPressed()
150 LongPressed?.Invoke(this, EventArgs.Empty);
152 internal void SendClicked()
154 Clicked?.Invoke(this, EventArgs.Empty);