3e07971461dd144bdd6dcb866533d85f9815dd91
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Components / Attributes / ButtonAttributes.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.Components
20 {
21     /// <summary>
22     /// ButtonAttributes is a class which saves Button'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 ButtonAttributes : ViewAttributes
28     {
29         /// <summary>
30         /// Creates a new instance of a ButtonAttributes.
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 ButtonAttributes() : base() { }
36         /// <summary>
37         /// Creates a new instance of a ButtonAttributes with attributes.
38         /// </summary>
39         /// <param name="attributes">Create ButtonAttributes 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 ButtonAttributes(ButtonAttributes attributes) : base(attributes)
44         {
45             if(attributes == null)
46             {
47                 return;
48             }
49
50             IsSelectable = attributes.IsSelectable;
51             IconRelativeOrientation = attributes.IconRelativeOrientation;
52
53             if (attributes.ShadowImageAttributes != null)
54             {
55                 ShadowImageAttributes = attributes.ShadowImageAttributes.Clone() as ImageAttributes;
56             }
57
58             if (attributes.BackgroundImageAttributes != null)
59             {
60                 BackgroundImageAttributes = attributes.BackgroundImageAttributes.Clone() as ImageAttributes;
61             }
62
63             if (attributes.OverlayImageAttributes != null)
64             {
65                 OverlayImageAttributes = attributes.OverlayImageAttributes.Clone() as ImageAttributes;
66             }
67
68             if (attributes.TextAttributes != null)
69             {
70                 TextAttributes = attributes.TextAttributes.Clone() as TextAttributes;
71             }
72
73             if (attributes.IconAttributes != null)
74             {
75                 IconAttributes = attributes.IconAttributes.Clone() as ImageAttributes;
76             }
77         }
78         /// <summary>
79         /// Shadow image's attributes.
80         /// </summary>
81         /// <since_tizen> 6 </since_tizen>
82         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
83         [EditorBrowsable(EditorBrowsableState.Never)]
84         public ImageAttributes ShadowImageAttributes
85         {
86             get;
87             set;
88         }
89         /// <summary>
90         /// Background image's attributes.
91         /// </summary>
92         /// <since_tizen> 6 </since_tizen>
93         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
94         [EditorBrowsable(EditorBrowsableState.Never)]
95         public ImageAttributes BackgroundImageAttributes
96         {
97             get;
98             set;
99         }
100         /// <summary>
101         /// Overlay image's attributes.
102         /// </summary>
103         /// <since_tizen> 6 </since_tizen>
104         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
105         [EditorBrowsable(EditorBrowsableState.Never)]
106         public ImageAttributes OverlayImageAttributes
107         {
108             get;
109             set;
110         }
111         /// <summary>
112         /// Text's attributes.
113         /// </summary>
114         /// <since_tizen> 6 </since_tizen>
115         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
116         [EditorBrowsable(EditorBrowsableState.Never)]
117         public TextAttributes TextAttributes
118         {
119             get;
120             set;
121         }
122         /// <summary>
123         /// Icon's attributes.
124         /// </summary>
125         /// <since_tizen> 6 </since_tizen>
126         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
127         [EditorBrowsable(EditorBrowsableState.Never)]
128         public ImageAttributes IconAttributes
129         {
130             get;
131             set;
132         }
133         /// <summary>
134         /// Flag to decide button can be selected or not.
135         /// </summary>
136         /// <since_tizen> 6 </since_tizen>
137         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
138         [EditorBrowsable(EditorBrowsableState.Never)]
139         public bool? IsSelectable
140         {
141             get;
142             set;
143         }
144         /// <summary>
145         /// Icon relative orientation.
146         /// </summary>
147         /// <since_tizen> 6 </since_tizen>
148         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
149         [EditorBrowsable(EditorBrowsableState.Never)]
150         public Button.IconOrientation? IconRelativeOrientation
151         {
152             get;
153             set;
154         }
155         /// <summary>
156         /// Attributes's clone function.
157         /// </summary>
158         /// <since_tizen> 6 </since_tizen>
159         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
160         [EditorBrowsable(EditorBrowsableState.Never)]
161         public override Attributes Clone()
162         {
163             return new ButtonAttributes(this);
164         }
165     }
166 }