[ACR-564] deprecate unused API
[platform/core/csapi/tizenfx.git] / src / ElmSharp / ElmSharp / Panel.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     /// Enumeration for the PanelDirection types.
23     /// </summary>
24     /// <since_tizen> preview </since_tizen>
25     [Obsolete("This has been deprecated in API12")]
26     public enum PanelDirection
27     {
28         /// <summary>
29         /// Top to bottom.
30         /// </summary>
31         Top = 0,
32         /// <summary>
33         /// Bottom to top.
34         /// </summary>
35         Bottom,
36         /// <summary>
37         /// Left to right.
38         /// </summary>
39         Left,
40         /// <summary>
41         /// Right to left.
42         /// </summary>
43         Right,
44     }
45
46     /// <summary>
47     /// The Panel is a container that can contain subobjects.
48     /// </summary>
49     /// <since_tizen> preview </since_tizen>
50     [Obsolete("This has been deprecated in API12")]
51     public class Panel : Layout
52     {
53         SmartEvent _toggled;
54         SmartEvent _scrolled;
55
56         /// <summary>
57         /// Creates and initializes a new instance of the Panel class.
58         /// </summary>
59         /// <param name="parent">The EvasObject to which the new panel will be attached as a child.</param>
60         /// <since_tizen> preview </since_tizen>
61         [Obsolete("This has been deprecated in API12")]
62         public Panel(EvasObject parent) : base(parent)
63         {
64             _toggled = new SmartEvent(this, this.RealHandle, "toggled");
65             _scrolled = new SmartEvent(this, this.RealHandle, "scroll");
66
67             _toggled.On += (s, e) => Toggled?.Invoke(this, EventArgs.Empty);
68             _scrolled.On += (s, e) => Scrolled?.Invoke(this, EventArgs.Empty);
69         }
70
71         /// <summary>
72         /// Sets or gets the hidden status of a given Panel widget.
73         /// </summary>
74         /// <since_tizen> preview </since_tizen>
75         [Obsolete("This has been deprecated in API12")]
76         public bool IsOpen
77         {
78             get
79             {
80                 return !Interop.Elementary.elm_panel_hidden_get(RealHandle);
81             }
82             set
83             {
84                 Interop.Elementary.elm_panel_hidden_set(RealHandle, !value);
85             }
86         }
87
88         /// <summary>
89         /// Sets or gets the direction of a given Panel widget.
90         /// </summary>
91         /// <since_tizen> preview </since_tizen>
92         [Obsolete("This has been deprecated in API12")]
93         public PanelDirection Direction
94         {
95             get
96             {
97                 return (PanelDirection)Interop.Elementary.elm_panel_orient_get(RealHandle);
98             }
99             set
100             {
101                 Interop.Elementary.elm_panel_orient_set(RealHandle, (int)value);
102             }
103         }
104
105         /// <summary>
106         /// Toggled will be triggered when the panel is toggled.
107         /// </summary>
108         /// <since_tizen> preview </since_tizen>
109         [Obsolete("This has been deprecated in API12")]
110         public event EventHandler Toggled;
111
112         /// <summary>
113         /// Scrolled will be triggered when the panel has been scrolled. This event is emitted only when the panel is scrollable
114         /// </summary>
115         /// <since_tizen> preview </since_tizen>
116         [Obsolete("This has been deprecated in API12")]
117         public event EventHandler Scrolled;
118
119         /// <summary>
120         /// Enable or disable scrolling in the panel.
121         /// </summary>
122         /// <param name="enable">
123         /// Bool value can be false or true.
124         /// </param>
125         /// <since_tizen> preview </since_tizen>
126         [Obsolete("This has been deprecated in API12")]
127         public void SetScrollable(bool enable)
128         {
129             Interop.Elementary.elm_panel_scrollable_set(RealHandle, enable);
130         }
131
132         /// <summary>
133         /// Sets the scroll size of the panel.
134         /// </summary>
135         /// <param name="ratio">
136         /// The size of the scroll area.
137         /// </param>
138         /// <since_tizen> preview </since_tizen>
139         [Obsolete("This has been deprecated in API12")]
140         public void SetScrollableArea(double ratio)
141         {
142             Interop.Elementary.elm_panel_scrollable_content_size_set(RealHandle, ratio);
143         }
144
145         /// <summary>
146         /// Toggles the hidden state of the panel.
147         /// </summary>
148         /// <since_tizen> preview </since_tizen>
149         [Obsolete("This has been deprecated in API12")]
150         public void Toggle()
151         {
152             Interop.Elementary.elm_panel_toggle(RealHandle);
153         }
154
155         /// <summary>
156         /// Creates a widget handle.
157         /// </summary>
158         /// <param name="parent">Parent EvasObject.</param>
159         /// <returns>Handle IntPtr.</returns>
160         /// <since_tizen> preview </since_tizen>
161         [Obsolete("This has been deprecated in API12")]
162         protected override IntPtr CreateHandle(EvasObject parent)
163         {
164             IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle);
165             Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default");
166
167             RealHandle = Interop.Elementary.elm_panel_add(handle);
168             Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle);
169
170             return handle;
171         }
172     }
173 }