[NUI] Introduce CollectionView and related classes. (#2525)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Components / Style / DefaultTitleItemStyle.cs
1 /*
2  * Copyright(c) 2021 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  
18 using System.ComponentModel;
19 using Tizen.NUI.BaseComponents;
20 using Tizen.NUI.Binding;
21 using Tizen.NUI.Components.Extension;
22
23 namespace Tizen.NUI.Components
24 {
25     /// <summary>
26     /// DefaultTitleItemStyle is a class which saves DefaultLinearItem's ux data.
27     /// </summary>
28     [EditorBrowsable(EditorBrowsableState.Never)]
29     public class DefaultTitleItemStyle : RecyclerViewItemStyle
30     {
31         static DefaultTitleItemStyle() { }
32
33         /// <summary>
34         /// Creates a new instance of a DefaultTitleItemStyle.
35         /// </summary>
36         /// <since_tizen> 8 </since_tizen>
37         public DefaultTitleItemStyle() : base()
38         {
39         }
40
41         /// <summary>
42         /// Creates a new instance of a DefaultTitleItemStyle with style.
43         /// </summary>
44         /// <param name="style">Create DefaultTitleItemStyle by style customized by user.</param>
45         [EditorBrowsable(EditorBrowsableState.Never)]
46         public DefaultTitleItemStyle(DefaultTitleItemStyle style) : base(style)
47         {
48         }
49
50         /// <summary>
51         /// Label Text's style.
52         /// </summary>
53         [EditorBrowsable(EditorBrowsableState.Never)]
54         public TextLabelStyle Label { get; set; } = new TextLabelStyle();
55
56         /// <summary>
57         /// Icon's style.
58         /// </summary>
59         [EditorBrowsable(EditorBrowsableState.Never)]
60         public ViewStyle Icon { get; set; } = new ViewStyle();
61
62         /// <summary>
63         /// Seperator's style.
64         /// </summary>
65         [EditorBrowsable(EditorBrowsableState.Never)]
66         public ViewStyle Seperator { get; set; } = new ViewStyle();
67
68         /// <summary>
69         /// Style's clone function.
70         /// </summary>
71         /// <param name="bindableObject">The style that need to copy.</param>
72         [EditorBrowsable(EditorBrowsableState.Never)]
73         public override void CopyFrom(BindableObject bindableObject)
74         {
75             base.CopyFrom(bindableObject);
76
77             if (bindableObject is DefaultTitleItemStyle RecyclerViewItemStyle)
78             {
79                 Label.CopyFrom(RecyclerViewItemStyle.Label);
80                 Icon.CopyFrom(RecyclerViewItemStyle.Icon);
81                 Seperator.CopyFrom(RecyclerViewItemStyle.Seperator);
82             }
83         }
84     }
85 }