[NUI] Picker: Apply Tizen 7.0 GUI
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Components / Style / PaginationStyle.cs
1 /*
2  * Copyright(c) 2020 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> 8 </since_tizen>
27     public class PaginationStyle : ControlStyle
28     {
29         /// <summary>The IndicatorSize bindable property.</summary>
30         [EditorBrowsable(EditorBrowsableState.Never)]
31         public static readonly BindableProperty IndicatorSizeProperty = BindableProperty.Create(nameof(IndicatorSize), typeof(Size), typeof(PaginationStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
32         {
33             ((PaginationStyle)bindable).indicatorSize = newValue == null ? null : new Size((Size)newValue);
34         },
35         defaultValueCreator: (bindable) =>
36         {
37             return ((PaginationStyle)bindable).indicatorSize;
38         });
39
40         /// <summary>The IndicatorImageUrlSelector bindable property.</summary>
41         [EditorBrowsable(EditorBrowsableState.Never)]
42         public static readonly BindableProperty IndicatorImageUrlSelectorProperty = BindableProperty.Create("IndicatorImageUrl", typeof(Selector<string>), typeof(PaginationStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
43         {
44             ((PaginationStyle)bindable).indicatorImageUrl = (Selector<string>)newValue;
45         },
46         defaultValueCreator: (bindable) =>
47         {
48             return ((PaginationStyle)bindable).indicatorImageUrl;
49         });
50
51         /// <summary>The IndicatorSpacing bindable property.</summary>
52         [EditorBrowsable(EditorBrowsableState.Never)]
53         public static readonly BindableProperty IndicatorSpacingProperty = BindableProperty.Create(nameof(IndicatorSpacing), typeof(int?), typeof(PaginationStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
54         {
55             ((PaginationStyle)bindable).indicatorSpacing = (int?)newValue;
56         },
57         defaultValueCreator: (bindable) =>
58         {
59             return ((PaginationStyle)bindable).indicatorSpacing;
60         });
61
62         private Size indicatorSize;
63         private Selector<string> indicatorImageUrl;
64         private int? indicatorSpacing;
65
66         static PaginationStyle() { }
67
68         /// <summary>
69         /// Creates a new instance of a PaginationStyle.
70         /// </summary>
71         /// <since_tizen> 8 </since_tizen>
72         public PaginationStyle() : base() { }
73
74         /// <summary>
75         /// Creates a new instance of a PaginationStyle using style.
76         /// </summary>
77         /// <param name="style">Create PaginationStyle by style customized by user.</param>
78         /// <since_tizen> 8 </since_tizen>
79         public PaginationStyle(PaginationStyle style) : base(style)
80         {
81         }
82
83         /// <summary>
84         /// Gets or sets the size of the indicator.
85         /// </summary>
86         /// <since_tizen> 8 </since_tizen>
87         public Size IndicatorSize
88         {
89             get => (Size)GetValue(IndicatorSizeProperty);
90             set => SetValue(IndicatorSizeProperty, value);
91         }
92
93         /// <summary>
94         /// Gets or sets the resource of indicator.
95         /// </summary>
96         /// <since_tizen> 8 </since_tizen>
97         public Selector<string> IndicatorImageUrl
98         {
99             get => (Selector<string>)GetValue(IndicatorImageUrlSelectorProperty);
100             set => SetValue(IndicatorImageUrlSelectorProperty, value);
101         }
102
103         /// <summary>
104         /// Gets or sets the space of the indicator.
105         /// </summary>
106         /// <since_tizen> 8 </since_tizen>
107         public int IndicatorSpacing
108         {
109             get => ((int?)GetValue(IndicatorSpacingProperty)) ?? 0;
110             set => SetValue(IndicatorSpacingProperty, value);
111         }
112
113         /// <inheritdoc/>
114         /// <since_tizen> 8 </since_tizen>
115         public override void CopyFrom(BindableObject bindableObject)
116         {
117             base.CopyFrom(bindableObject);
118         }
119     }
120 }