a9880f199fa84e3bb72ecb6ea2dc5260bd4119e2
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.CommonUI / Attributes / ToastAttributes.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
19 namespace Tizen.NUI.CommonUI
20 {
21     /// <summary>
22     /// ToastAttributes is a class which saves Toast's ux data.
23     /// </summary>
24     /// <since_tizen> 6 </since_tizen>
25     /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
26     [EditorBrowsable(EditorBrowsableState.Never)]
27     public class ToastAttributes : ViewAttributes
28     {
29         /// <summary>
30         /// Creates a new instance of a ToastAttributes.
31         /// </summary>
32         /// <since_tizen> 6 </since_tizen>
33         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
34         [EditorBrowsable(EditorBrowsableState.Never)]
35         public ToastAttributes() : base() { }
36
37         /// <summary>
38         /// Creates a new instance of a ToastAttributes with attributes.
39         /// </summary>
40         /// <param name="attributes">Create ToastAttributes by attributes customized by user.</param>
41         /// <since_tizen> 6 </since_tizen>
42         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
43         [EditorBrowsable(EditorBrowsableState.Never)]
44         public ToastAttributes(ToastAttributes attributes) : base(attributes)
45         {
46             if(null == attributes)
47             {
48                 return;
49             }
50             if(null != attributes.BackgroundImageAttributes)
51             {
52                 BackgroundImageAttributes = attributes.BackgroundImageAttributes.Clone() as ImageAttributes;
53             }
54             if(null != attributes.TextAttributes)
55             {
56                 TextAttributes = attributes.TextAttributes.Clone() as TextAttributes;
57             }
58             TextLineHeight = attributes.TextLineHeight;
59             TextLineSpace = attributes.TextLineSpace;
60             Duration = attributes.Duration;
61         }
62
63         /// <summary>
64         /// Gets or sets background image attributes.
65         /// </summary>
66         /// <since_tizen> 6 </since_tizen>
67         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
68         [EditorBrowsable(EditorBrowsableState.Never)]
69         public ImageAttributes BackgroundImageAttributes
70         {
71             get;
72             set;
73         }
74
75         /// <summary>
76         /// Gets or sets text attributes.
77         /// </summary>
78         /// <since_tizen> 6 </since_tizen>
79         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
80         [EditorBrowsable(EditorBrowsableState.Never)]
81         public TextAttributes TextAttributes
82         {
83             get;
84             set;
85         }
86
87         /// <summary>
88         /// Gets or sets toast text line height.
89         /// </summary>
90         /// <since_tizen> 6 </since_tizen>
91         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
92         [EditorBrowsable(EditorBrowsableState.Never)]
93         public uint? TextLineHeight
94         {
95             get;
96             set;
97         }
98
99         /// <summary>
100         /// Gets or sets toast text line space.
101         /// </summary>
102         /// <since_tizen> 6 </since_tizen>
103         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
104         [EditorBrowsable(EditorBrowsableState.Never)]
105         public uint? TextLineSpace
106         {
107             get;
108             set;
109         }
110
111         /// <summary>
112         /// Gets or sets toast show duration time.
113         /// </summary>
114         /// <since_tizen> 6 </since_tizen>
115         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
116         [EditorBrowsable(EditorBrowsableState.Never)]
117         public uint? Duration
118         {
119             get;
120             set;
121         }
122
123         /// <summary>
124         /// Attributes's clone function.
125         /// </summary>
126         /// <since_tizen> 6 </since_tizen>
127         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
128         [EditorBrowsable(EditorBrowsableState.Never)]
129         public override Attributes Clone()
130         {
131             return new ToastAttributes(this);
132         }
133     }
134 }