2090f25f8d9d72c7f11f3c6747ac338f04b8be70
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.CommonUI / Attributes / SwitchAttributes.cs
1 /*
2  * Copyright(c) 2019 Samsung Electronics Co., Ltd.
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.ComponentModel;
18
19 namespace Tizen.NUI.CommonUI
20 {
21     /// <summary>
22     /// SwitchAttributes is a class which saves Switch's ux data.
23     /// </summary>
24     /// <since_tizen> 6 </since_tizen>
25     /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
26     [EditorBrowsable(EditorBrowsableState.Never)]
27     public class SwitchAttributes : ButtonAttributes
28     {
29         /// <summary>
30         /// Creates a new instance of a SwitchAttributes.
31         /// </summary>
32         /// <since_tizen> 6 </since_tizen>
33         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
34         [EditorBrowsable(EditorBrowsableState.Never)]
35         public SwitchAttributes() : base() { }
36         /// <summary>
37         /// Creates a new instance of a SwitchAttributes with attributes.
38         /// </summary>
39         /// <param name="attributes">Create SwitchAttributes by attributes customized by user.</param>
40         /// <since_tizen> 6 </since_tizen>
41         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
42         [EditorBrowsable(EditorBrowsableState.Never)]
43         public SwitchAttributes(SwitchAttributes attributes) : base(attributes)
44         {
45             if(attributes == null)
46             {
47                 return;
48             }
49             if (attributes.SwitchHandlerImageAttributes != null)
50             {
51                 SwitchHandlerImageAttributes = attributes.SwitchHandlerImageAttributes.Clone() as ImageAttributes;
52             }
53
54             if (attributes.SwitchBackgroundImageAttributes != null)
55             {
56                 SwitchBackgroundImageAttributes = attributes.SwitchBackgroundImageAttributes.Clone() as ImageAttributes;
57             }
58         }
59
60         /// <summary>
61         /// Handler image's attributes.
62         /// </summary>
63         /// <since_tizen> 6 </since_tizen>
64         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
65         [EditorBrowsable(EditorBrowsableState.Never)]
66         public ImageAttributes SwitchHandlerImageAttributes
67         {
68             get;
69             set;
70         }
71
72         /// <summary>
73         /// Background image's attributes.
74         /// </summary>
75         /// <since_tizen> 6 </since_tizen>
76         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
77         [EditorBrowsable(EditorBrowsableState.Never)]
78         public ImageAttributes SwitchBackgroundImageAttributes
79         {
80             get;
81             set;
82         }
83
84         /// <summary>
85         /// Attributes's clone function.
86         /// </summary>
87         /// <since_tizen> 6 </since_tizen>
88         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
89         [EditorBrowsable(EditorBrowsableState.Never)]
90         public override Attributes Clone()
91         {
92             return new SwitchAttributes(this);
93         }
94     }
95 }