Change EvasObject's API visibility to protected from internal.
[platform/core/csapi/tizenfx.git] / src / ElmSharp / ElmSharp / ToolbarItem.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using System.Threading.Tasks;
6
7 namespace ElmSharp
8 {
9     public class ToolbarItem : ItemObject
10     {
11         string _icon;
12         string _text;
13         internal ToolbarItem(string text, string icon) : base(IntPtr.Zero)
14         {
15             _text = text;
16             _icon = icon;
17         }
18
19         public string Icon
20         {
21             get
22             {
23                 return _icon;
24             }
25             set
26             {
27                 _icon = value;
28                 Interop.Elementary.elm_toolbar_item_icon_set(Handle, value);
29             }
30         }
31         public string Text
32         {
33             get
34             {
35                 return _text;
36             }
37             set
38             {
39                 _text = value;
40                 SetPartText(null, value);
41             }
42         }
43         public bool Enabled
44         {
45             get
46             {
47                 return !Interop.Elementary.elm_object_disabled_get(Handle);
48             }
49             set
50             {
51                 Interop.Elementary.elm_object_disabled_set(Handle, !value);
52             }
53         }
54         public bool IsSeparator
55         {
56             get
57             {
58                 return Interop.Elementary.elm_toolbar_item_separator_get(Handle);
59             }
60             set
61             {
62                 Interop.Elementary.elm_toolbar_item_separator_set(Handle, value);
63             }
64         }
65         public bool IsSelected
66         {
67             get
68             {
69                 return Interop.Elementary.elm_toolbar_item_selected_get(Handle);
70             }
71             set
72             {
73                 Interop.Elementary.elm_toolbar_item_selected_set(Handle, value);
74             }
75         }
76
77         public event EventHandler Selected;
78         public event EventHandler LongPressed;
79         public event EventHandler Clicked;
80
81         internal void SendSelected()
82         {
83             Selected?.Invoke(this, EventArgs.Empty);
84         }
85         internal void SendLongPressed()
86         {
87             LongPressed?.Invoke(this, EventArgs.Empty);
88         }
89         internal void SendClicked()
90         {
91             Clicked?.Invoke(this, EventArgs.Empty);
92         }
93     }
94 }