Fix components issue 1216 (#1194)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Components / Style / PaginationStyle.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     /// PaginationStyle used to config the pagination represent.
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 PaginationStyle : ControlStyle
30     {
31         /// <summary>
32         /// Creates a new instance of a PaginationStyle.
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 PaginationStyle() : base() { }
38
39         /// <summary>
40         /// Creates a new instance of a PaginationStyle using style.
41         /// </summary>
42         /// <since_tizen> 6 </since_tizen>
43         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
44         [EditorBrowsable(EditorBrowsableState.Never)]
45         public PaginationStyle(PaginationStyle style) : base(style)
46         {
47             if (null == style) return;
48
49             this.CopyFrom(style);
50         }
51
52         /// <summary>
53         /// Gets or sets the size of the indicator.
54         /// </summary>
55         /// <since_tizen> 6 </since_tizen>
56         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
57         [EditorBrowsable(EditorBrowsableState.Never)]
58         public Size IndicatorSize
59         {
60             get;
61             set;
62         }
63
64         /// <summary>
65         /// Gets or sets the resource of indicator.
66         /// </summary>
67         /// <since_tizen> 6 </since_tizen>
68         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
69         [EditorBrowsable(EditorBrowsableState.Never)]
70         public Selector<string> IndicatorImageURL
71         {
72             get;
73             set;
74         } = new Selector<string>();
75
76         /// <summary>
77         /// Gets or sets the space of the indicator.
78         /// </summary>
79         /// <since_tizen> 6 </since_tizen>
80         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
81         [EditorBrowsable(EditorBrowsableState.Never)]
82         public int IndicatorSpacing
83         {
84             get;
85             set;
86         }
87
88         /// <summary>
89         /// Retrieves a copy of PaginationStyle.
90         /// </summary>
91         /// <since_tizen> 6 </since_tizen>
92         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
93         [EditorBrowsable(EditorBrowsableState.Never)]
94         public override void CopyFrom(BindableObject bindableObject)
95         {
96             base.CopyFrom(bindableObject);
97
98             PaginationStyle paginationStyle = bindableObject as PaginationStyle;
99             if (null != paginationStyle)
100             {
101                 if (null != paginationStyle.IndicatorSize)
102                 {
103                     IndicatorSize = new Size(paginationStyle.IndicatorSize.Width, paginationStyle.IndicatorSize.Height);
104                 }
105                 if (null != paginationStyle.IndicatorImageURL)
106                 {
107                     IndicatorImageURL.Clone(paginationStyle.IndicatorImageURL);
108                 }
109                 IndicatorSpacing = paginationStyle.IndicatorSpacing;
110             }
111         }
112     }
113 }