a3bce9747e654cd4fe1748028efab76cc0f45f3e
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Components / Attributes / LoadingAttributes.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 using Tizen.NUI.BaseComponents;
19 using Tizen.NUI.Binding;
20
21 namespace Tizen.NUI.Components
22 {
23     /// <summary>
24     /// LoadingStyle is a class which saves Loading's ux data.
25     /// </summary>
26     /// <since_tizen> 6 </since_tizen>
27     /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
28     [EditorBrowsable(EditorBrowsableState.Never)]
29     public class LoadingStyle : ControlStyle
30     {
31         /// <summary>
32         /// Creates a new instance of a LoadingStyle.
33         /// </summary>
34         /// <since_tizen> 6 </since_tizen>
35         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
36         [EditorBrowsable(EditorBrowsableState.Never)]
37         public LoadingStyle() : base() { }
38
39         /// <summary>
40         /// Creates a new instance of a LoadingStyle with style.
41         /// </summary>
42         /// <param name="style">Create LoadingStyle by style customized by user.</param>
43         /// <since_tizen> 6 </since_tizen>
44         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
45         [EditorBrowsable(EditorBrowsableState.Never)]
46         public LoadingStyle(LoadingStyle style) : base(style)
47         {
48             if(null == style)
49             {
50                 return;
51             }
52             this.CopyFrom(style);
53         }
54
55         /// <summary>
56         /// Gets or sets loading image resources.
57         /// </summary>
58         /// <since_tizen> 6 </since_tizen>
59         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
60         [EditorBrowsable(EditorBrowsableState.Never)]
61         public string[] Images
62         {
63             get;
64             set;
65         }
66
67         /// <summary>
68         /// Gets or sets loading image size.
69         /// </summary>
70         /// <since_tizen> 6 </since_tizen>
71         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
72         [EditorBrowsable(EditorBrowsableState.Never)]
73         public Size LoadingSize
74         {
75             get;
76             set;
77         }
78
79         /// <summary>
80         /// Gets or sets loading frame per second.
81         /// </summary>
82         /// <since_tizen> 6 </since_tizen>
83         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
84         [EditorBrowsable(EditorBrowsableState.Never)]
85         public Selector<int?> FrameRate
86         {
87             get;
88             set;
89         } = new Selector<int?>();
90
91         /// <summary>
92         /// Attributes's clone function.
93         /// </summary>
94         /// <since_tizen> 6 </since_tizen>
95         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
96         [EditorBrowsable(EditorBrowsableState.Never)]
97         public override void CopyFrom(BindableObject bindableObject)
98         {
99             base.CopyFrom(bindableObject);
100
101             LoadingStyle loadingStyle = bindableObject as LoadingStyle;
102
103             if (null != loadingStyle)
104             {
105                 if (null != loadingStyle.FrameRate)
106                 {
107                     FrameRate.Clone(loadingStyle.FrameRate);
108                 }
109                 if (null != loadingStyle.LoadingSize)
110                 {
111                     LoadingSize = loadingStyle.LoadingSize;
112                 }
113                 if (null != loadingStyle.Images)
114                 {
115                     Images = loadingStyle.Images;
116                 }
117             }
118         }
119     }
120 }