[ACR-564] deprecate unused API
[platform/core/csapi/tizenfx.git] / src / ElmSharp / ElmSharp / Panes.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 Panes is a widget that adds a draggable bar between two contents.
23     /// When dragged, this bar resizes the contents' size.
24     /// </summary>
25     /// <since_tizen> preview </since_tizen>
26     [Obsolete("This has been deprecated in API12")]
27     public class Panes : Layout
28     {
29         SmartEvent _press;
30         SmartEvent _unpressed;
31
32         /// <summary>
33         /// Creates and initializes a new instance of the Panes class.
34         /// </summary>
35         /// <param name="parent">The EvasObject to which the new Panes will be attached as a child.</param>
36         /// <since_tizen> preview </since_tizen>
37         [Obsolete("This has been deprecated in API12")]
38         public Panes(EvasObject parent) : base(parent)
39         {
40             _press = new SmartEvent(this, this.RealHandle, "press");
41             _unpressed = new SmartEvent(this, this.RealHandle, "unpress");
42
43             _press.On += (s, e) => Pressed?.Invoke(this, e);
44             _unpressed.On += (s, e) => Unpressed?.Invoke(this, e);
45         }
46
47         /// <summary>
48         /// Pressed will be triggered when the panes have been pressed (button isn't released yet).
49         /// </summary>
50         /// <since_tizen> preview </since_tizen>
51         [Obsolete("This has been deprecated in API12")]
52         public event EventHandler Pressed;
53
54         /// <summary>
55         /// Unpressed will be triggered when the panes are released after being pressed.
56         /// </summary>
57         /// <since_tizen> preview </since_tizen>
58         [Obsolete("This has been deprecated in API12")]
59         public event EventHandler Unpressed;
60
61         /// <summary>
62         /// Sets or gets the resize mode of a given Panes widget.
63         /// True means the left and right panes resize homogeneously.
64         /// </summary>
65         /// <since_tizen> preview </since_tizen>
66         [Obsolete("This has been deprecated in API12")]
67         public bool IsFixed
68         {
69             get
70             {
71                 return Interop.Elementary.elm_panes_fixed_get(RealHandle);
72             }
73             set
74             {
75                 Interop.Elementary.elm_panes_fixed_set(RealHandle, value);
76             }
77         }
78
79         /// <summary>
80         /// Sets or gets the size proportion of the Panes widget's left side.
81         /// </summary>
82         /// <remarks>
83         /// By default, it's homogeneous, i.e., both sides have the same size. If something different is required,
84         /// it can be set with this function. For example, if the left content should be displayed over 75% of the panes size,
85         /// the size should be passed as 0.75. This way, the right content is resized to 25% of the panes size.
86         /// If displayed vertically, left content is displayed at the top and right content at the bottom.
87         /// This proportion changes when the user drags the panes bar.
88         ///
89         /// The float type value between 0.0 and 1.0 represents the size proportion of the left side.
90         /// </remarks>
91         /// <since_tizen> preview </since_tizen>
92         [Obsolete("This has been deprecated in API12")]
93         public double Proportion
94         {
95             get
96             {
97                 return Interop.Elementary.elm_panes_content_left_size_get(RealHandle);
98             }
99             set
100             {
101                 Interop.Elementary.elm_panes_content_left_size_set(RealHandle, value);
102             }
103         }
104
105         /// <summary>
106         /// Sets or gets the orientation of a given Panes widget.
107         /// </summary>
108         /// <remarks>
109         /// Use this function to change how your panes are to be disposed: vertically or horizontally.
110         /// Horizontal panes have "top" and "bottom" contents, vertical panes have "left" and "right" contents.
111         /// By default, the panes are in a vertical mode.
112         /// </remarks>
113         /// <since_tizen> preview </since_tizen>
114         [Obsolete("This has been deprecated in API12")]
115         public bool IsHorizontal
116         {
117             get
118             {
119                 return Interop.Elementary.elm_panes_horizontal_get(RealHandle);
120             }
121             set
122             {
123                 Interop.Elementary.elm_panes_horizontal_set(RealHandle, value);
124             }
125         }
126
127         /// <summary>
128         /// Sets or gets the absolute minimum size of panes widget's left side.
129         /// If displayed vertically, left content is displayed at the top.
130         /// The value represents minimum size of the left side in pixels.
131         /// </summary>
132         /// <since_tizen> preview </since_tizen>
133         [Obsolete("This has been deprecated in API12")]
134         public int LeftMinimumSize
135         {
136             get
137             {
138                 return Interop.Elementary.elm_panes_content_left_min_size_get(RealHandle);
139             }
140             set
141             {
142                 Interop.Elementary.elm_panes_content_left_min_size_set(RealHandle, value);
143             }
144         }
145
146         /// <summary>
147         /// Sets or gets the relative minimum size of the panes widget's left side.
148         /// The proportion of minimum size of the left side.
149         /// If displayed vertically, left content is displayed at the top.
150         /// The value between 0.0 and 1.0 represents size proportion of the minimum size of the left side.
151         /// </summary>
152         /// <since_tizen> preview </since_tizen>
153         [Obsolete("This has been deprecated in API12")]
154         public double LeftMinimumRelativeSize
155         {
156             get
157             {
158                 return Interop.Elementary.elm_panes_content_left_min_relative_size_get(RealHandle);
159             }
160             set
161             {
162                 Interop.Elementary.elm_panes_content_left_min_relative_size_set(RealHandle, value);
163             }
164         }
165
166         /// <summary>
167         /// Sets or gets the absolute minimum size of the panes widget's right side.
168         /// If displayed vertically, right content is displayed at the top.
169         /// The value represents the minimum size of the right side in pixels.
170         /// </summary>
171         /// <since_tizen> preview </since_tizen>
172         [Obsolete("This has been deprecated in API12")]
173         public int RightMinimumSize
174         {
175             get
176             {
177                 return Interop.Elementary.elm_panes_content_right_min_size_get(RealHandle);
178             }
179             set
180             {
181                 Interop.Elementary.elm_panes_content_right_min_size_set(RealHandle, value);
182             }
183         }
184
185         /// <summary>
186         /// Sets or gets the relative minimum size of the panes widget's right side.
187         /// Proportion of the minimum size of the right side.
188         /// If displayed vertically, right content is displayed at the top.
189         /// The value between 0.0 and 1.0 represents size proportion of the minimum size of the right side.
190         /// </summary>
191         /// <since_tizen> preview </since_tizen>
192         [Obsolete("This has been deprecated in API12")]
193         public double RightMinimumRelativeSize
194         {
195             get
196             {
197                 return Interop.Elementary.elm_panes_content_right_min_relative_size_get(RealHandle);
198             }
199             set
200             {
201                 Interop.Elementary.elm_panes_content_right_min_relative_size_set(RealHandle, value);
202             }
203         }
204
205         /// <summary>
206         /// Creates a widget handle.
207         /// </summary>
208         /// <param name="parent">Parent EvasObject.</param>
209         /// <returns>Handle IntPtr.</returns>
210         /// <since_tizen> preview </since_tizen>
211         [Obsolete("This has been deprecated in API12")]
212         protected override IntPtr CreateHandle(EvasObject parent)
213         {
214             IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle);
215             Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default");
216
217             RealHandle = Interop.Elementary.elm_panes_add(handle);
218             Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle);
219
220             return handle;
221         }
222     }
223 }