2 * Copyright(c) 2019 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 using System.ComponentModel;
18 using Tizen.NUI.BaseComponents;
19 using Tizen.NUI.Binding;
21 namespace Tizen.NUI.Components
24 /// ToastStyle is a class which saves Toast's ux data.
26 /// <since_tizen> 6 </since_tizen>
27 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
28 [EditorBrowsable(EditorBrowsableState.Never)]
29 public class ToastStyle : ControlStyle
32 /// Creates a new instance of a ToastStyle.
34 /// <since_tizen> 6 </since_tizen>
35 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
36 [EditorBrowsable(EditorBrowsableState.Never)]
37 public ToastStyle() : base()
43 /// Creates a new instance of a ToastStyle with Style.
45 /// <param name="Style">Create ToastStyle by Style customized by user.</param>
46 /// <since_tizen> 6 </since_tizen>
47 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
48 [EditorBrowsable(EditorBrowsableState.Never)]
49 public ToastStyle(ToastStyle style) : base(style)
56 /// Gets or sets toast show duration time.
58 /// <since_tizen> 6 </since_tizen>
59 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
60 [EditorBrowsable(EditorBrowsableState.Never)]
70 /// <since_tizen> 6 </since_tizen>
71 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
72 [EditorBrowsable(EditorBrowsableState.Never)]
73 public TextLabelStyle Text { get; set; }
76 /// Style's clone function.
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 override void CopyFrom(BindableObject bindableObject)
83 base.CopyFrom(bindableObject);
84 ToastStyle toastStyle = bindableObject as ToastStyle;
85 if (toastStyle != null)
87 if (null != toastStyle.Text)
89 Text.CopyFrom(toastStyle.Text);
91 Duration = toastStyle.Duration;
95 private void InitSubStyle()
97 Text = new TextLabelStyle()
99 PositionUsesPivotPoint = true,
100 ParentOrigin = Tizen.NUI.ParentOrigin.Center,
101 PivotPoint = Tizen.NUI.PivotPoint.Center,
102 WidthResizePolicy = ResizePolicyType.FillToParent,
103 HeightResizePolicy = ResizePolicyType.FillToParent,
104 HorizontalAlignment = HorizontalAlignment.Center,
105 VerticalAlignment = VerticalAlignment.Center,
106 TextColor = Color.White