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.
73 return !Interop.Elementary.elm_object_disabled_get(Handle);
77 Interop.Elementary.elm_object_disabled_set(Handle, !value);
82 /// Sets or gets whether displaying the item as a separator.
84 /// <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>
85 public bool IsSeparator
89 return Interop.Elementary.elm_toolbar_item_separator_get(Handle);
93 Interop.Elementary.elm_toolbar_item_separator_set(Handle, value);
98 /// Sets or gets whether the item is selected.
100 public bool IsSelected
104 return Interop.Elementary.elm_toolbar_item_selected_get(Handle);
108 Interop.Elementary.elm_toolbar_item_selected_set(Handle, value);
113 /// Selected will be triggered when the item is selected.
115 public event EventHandler Selected;
118 /// LongPressed will be triggered when the item is pressed long time.
120 public event EventHandler LongPressed;
123 /// Clicked will be triggered when the item is clicked.
125 public event EventHandler Clicked;
127 internal void SendSelected()
129 Selected?.Invoke(this, EventArgs.Empty);
131 internal void SendLongPressed()
133 LongPressed?.Invoke(this, EventArgs.Empty);
135 internal void SendClicked()
137 Clicked?.Invoke(this, EventArgs.Empty);