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 a item of Toolbar.
24 public class ToolbarItem : ItemObject
28 internal ToolbarItem(string text, string icon) : base(IntPtr.Zero)
35 /// Sets or gets the icon path of the item.
46 Interop.Elementary.elm_toolbar_item_icon_set(Handle, value);
51 /// Sets or gets the text string of the item.
62 SetPartText(null, value);
67 /// Sets or gets the enable of the item.
69 [Obsolete("Enabled is obsolete as of version v1.1.0-beta-023. Please use IsEnabled instead.")]
83 /// Sets or gets whether displaying the item as a separator.
85 /// <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 icons or labels.</remarks>
86 public bool IsSeparator
90 return Interop.Elementary.elm_toolbar_item_separator_get(Handle);
94 Interop.Elementary.elm_toolbar_item_separator_set(Handle, value);
99 /// Sets or gets whether the item is selected.
101 public bool IsSelected
105 return Interop.Elementary.elm_toolbar_item_selected_get(Handle);
109 Interop.Elementary.elm_toolbar_item_selected_set(Handle, value);
114 /// Selected will be triggered when the item is selected.
116 public event EventHandler Selected;
119 /// LongPressed will be triggered when the item is pressed long time.
121 public event EventHandler LongPressed;
124 /// Clicked will be triggered when the item is clicked.
126 public event EventHandler Clicked;
128 internal void SendSelected()
130 Selected?.Invoke(this, EventArgs.Empty);
132 internal void SendLongPressed()
134 LongPressed?.Invoke(this, EventArgs.Empty);
136 internal void SendClicked()
138 Clicked?.Invoke(this, EventArgs.Empty);