[ACR-564] deprecate unused API
[platform/core/csapi/tizenfx.git] / src / ElmSharp / ElmSharp / ToolbarItem.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 using System;
18
19 namespace ElmSharp
20 {
21     /// <summary>
22     /// The ToolbarItem is an item of the toolbar.
23     /// </summary>
24     /// <since_tizen> preview </since_tizen>
25     [Obsolete("This has been deprecated in API12")]
26     public class ToolbarItem : ItemObject
27     {
28         string _icon;
29         string _text;
30
31         internal ToolbarItem(string text, string icon) : base(IntPtr.Zero)
32         {
33             _text = text;
34             _icon = icon;
35         }
36
37         internal ToolbarItem(string text, string icon, EvasObject parent) : base(IntPtr.Zero, parent)
38         {
39             _text = text;
40             _icon = icon;
41         }
42
43         /// <summary>
44         /// Sets or gets the icon path of the item.
45         /// </summary>
46         /// <since_tizen> preview </since_tizen>
47         [Obsolete("This has been deprecated in API12")]
48         public string Icon
49         {
50             get
51             {
52                 return _icon;
53             }
54             set
55             {
56                 _icon = value;
57                 Interop.Elementary.elm_toolbar_item_icon_set(Handle, value);
58             }
59         }
60
61         /// <summary>
62         /// Sets or gets the text string of the item.
63         /// </summary>
64         /// <since_tizen> preview </since_tizen>
65         [Obsolete("This has been deprecated in API12")]
66         public string Text
67         {
68             get
69             {
70                 return _text;
71             }
72             set
73             {
74                 _text = value;
75                 SetPartText(null, value);
76             }
77         }
78
79         /// <summary>
80         /// Sets or gets the enable of the item.
81         /// </summary>
82         /// <since_tizen> preview </since_tizen>
83         [Obsolete("Enabled is obsolete as of version v1.1.0-beta-023. Please use IsEnabled instead.")]
84         public bool Enabled
85         {
86             get
87             {
88                 return IsEnabled;
89             }
90             set
91             {
92                 IsEnabled = value;
93             }
94         }
95
96         /// <summary>
97         /// Sets or gets whether displaying the item as a separator.
98         /// </summary>
99         /// <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>
100         /// <since_tizen> preview </since_tizen>
101         [Obsolete("This has been deprecated in API12")]
102         public bool IsSeparator
103         {
104             get
105             {
106                 return Interop.Elementary.elm_toolbar_item_separator_get(Handle);
107             }
108             set
109             {
110                 Interop.Elementary.elm_toolbar_item_separator_set(Handle, value);
111             }
112         }
113
114         /// <summary>
115         /// Sets or gets whether the item is selected.
116         /// </summary>
117         /// <since_tizen> preview </since_tizen>
118         [Obsolete("This has been deprecated in API12")]
119         public bool IsSelected
120         {
121             get
122             {
123                 return Interop.Elementary.elm_toolbar_item_selected_get(Handle);
124             }
125             set
126             {
127                 Interop.Elementary.elm_toolbar_item_selected_set(Handle, value);
128             }
129         }
130
131         /// <summary>
132         /// Selected will be triggered when the item is selected.
133         /// </summary>
134         /// <since_tizen> preview </since_tizen>
135         [Obsolete("This has been deprecated in API12")]
136         public event EventHandler Selected;
137
138         /// <summary>
139         /// LongPressed will be triggered when the item is pressed for a long time.
140         /// </summary>
141         /// <since_tizen> preview </since_tizen>
142         [Obsolete("This has been deprecated in API12")]
143         public event EventHandler LongPressed;
144
145         /// <summary>
146         /// Clicked will be triggered when the item is clicked.
147         /// </summary>
148         /// <since_tizen> preview </since_tizen>
149         [Obsolete("This has been deprecated in API12")]
150         public event EventHandler Clicked;
151
152         internal void SendSelected()
153         {
154             Selected?.Invoke(this, EventArgs.Empty);
155         }
156         internal void SendLongPressed()
157         {
158             LongPressed?.Invoke(this, EventArgs.Empty);
159         }
160         internal void SendClicked()
161         {
162             Clicked?.Invoke(this, EventArgs.Empty);
163         }
164     }
165 }