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 /// PopupStyle is a class which saves Popup'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 PopupStyle : ControlStyle
32 /// Creates a new instance of a PopupStyle.
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 PopupStyle() : base()
43 /// Creates a new instance of a PopupStyle with style.
45 /// <param name="style">Create PopupStyle 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 PopupStyle(PopupStyle style) : base(style)
56 /// Title Text's Style.
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)]
61 public TextLabelStyle Title
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 Extents ShadowExtents
80 /// Popup button's attributes.
82 /// <since_tizen> 6 </since_tizen>
83 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
84 [EditorBrowsable(EditorBrowsableState.Never)]
85 public ButtonStyle Buttons
92 /// Attributes's clone function.
94 /// <since_tizen> 6 </since_tizen>
95 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
96 [EditorBrowsable(EditorBrowsableState.Never)]
97 public override void CopyFrom(BindableObject bindableObject)
99 base.CopyFrom(bindableObject);
101 PopupStyle popupAttributes = bindableObject as PopupStyle;
102 if (popupAttributes != null)
104 if (popupAttributes.Title != null)
106 Title.CopyFrom(popupAttributes.Title);
109 if (popupAttributes.Buttons != null)
111 Buttons.CopyFrom(popupAttributes.Buttons);
114 if (popupAttributes.ShadowExtents != null)
116 ShadowExtents = new Extents(popupAttributes.ShadowExtents.Start, popupAttributes.ShadowExtents.End, popupAttributes.ShadowExtents.Top, popupAttributes.ShadowExtents.Bottom);
121 private void InitSubStyle()
123 ShadowExtents = new Extents(24, 24, 24, 24);
124 Title = new TextLabelStyle()
126 Size = new Size(0, 0),
127 PositionUsesPivotPoint = true,
128 ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
129 PivotPoint = Tizen.NUI.PivotPoint.TopLeft,
130 HorizontalAlignment = HorizontalAlignment.Begin,
131 VerticalAlignment = VerticalAlignment.Bottom
134 Buttons = new ButtonStyle()
136 Size = new Size(0, 0),
137 PositionUsesPivotPoint = true,
138 ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft,
139 PivotPoint = Tizen.NUI.PivotPoint.BottomLeft,
140 Overlay = new ImageViewStyle()
142 PositionUsesPivotPoint = true,
143 ParentOrigin = Tizen.NUI.ParentOrigin.Center,
144 PivotPoint = Tizen.NUI.PivotPoint.Center,
145 WidthResizePolicy = ResizePolicyType.FillToParent,
146 HeightResizePolicy = ResizePolicyType.FillToParent
149 Text = new TextLabelStyle()
151 PositionUsesPivotPoint = true,
152 ParentOrigin = Tizen.NUI.ParentOrigin.Center,
153 PivotPoint = Tizen.NUI.PivotPoint.Center,
154 WidthResizePolicy = ResizePolicyType.FillToParent,
155 HeightResizePolicy = ResizePolicyType.FillToParent,
156 HorizontalAlignment = HorizontalAlignment.Center,
157 VerticalAlignment = VerticalAlignment.Center