962391ed7d56c0156b5053ab1c2efca65f0a4f7a
[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         static PaginationStyle() { }
32
33         /// <summary>
34         /// Creates a new instance of a PaginationStyle.
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 PaginationStyle() : base() { }
40
41         /// <summary>
42         /// Creates a new instance of a PaginationStyle using style.
43         /// </summary>
44         /// <since_tizen> 6 </since_tizen>
45         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
46         [EditorBrowsable(EditorBrowsableState.Never)]
47         public PaginationStyle(PaginationStyle style) : base(style)
48         {
49             if (null == style) return;
50
51             this.CopyFrom(style);
52         }
53
54         /// <summary>
55         /// Gets or sets the size of the indicator.
56         /// </summary>
57         /// <since_tizen> 6 </since_tizen>
58         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
59         [EditorBrowsable(EditorBrowsableState.Never)]
60         public Size IndicatorSize { get; set; }
61
62         /// <summary>
63         /// Gets or sets the resource of indicator.
64         /// </summary>
65         /// <since_tizen> 6 </since_tizen>
66         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
67         [EditorBrowsable(EditorBrowsableState.Never)]
68         public Selector<string> IndicatorImageURL { get; set; } = new Selector<string>();
69
70         /// <summary>
71         /// Gets or sets the space of the indicator.
72         /// </summary>
73         /// <since_tizen> 6 </since_tizen>
74         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
75         [EditorBrowsable(EditorBrowsableState.Never)]
76         public int IndicatorSpacing { get; set; }
77
78         /// <summary>
79         /// Retrieves a copy of PaginationStyle.
80         /// </summary>
81         /// <since_tizen> 6 </since_tizen>
82         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
83         [EditorBrowsable(EditorBrowsableState.Never)]
84         public override void CopyFrom(BindableObject bindableObject)
85         {
86             base.CopyFrom(bindableObject);
87
88             PaginationStyle paginationStyle = bindableObject as PaginationStyle;
89             if (null != paginationStyle)
90             {
91                 if (null != paginationStyle.IndicatorSize)
92                 {
93                     IndicatorSize = new Size(paginationStyle.IndicatorSize.Width, paginationStyle.IndicatorSize.Height);
94                 }
95                 if (null != paginationStyle.IndicatorImageURL)
96                 {
97                     IndicatorImageURL?.Clone(paginationStyle.IndicatorImageURL);
98                 }
99                 IndicatorSpacing = paginationStyle.IndicatorSpacing;
100             }
101         }
102     }
103 }