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