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 Vector4 ShadowOffset
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.Shadow != null)
106 Shadow.CopyFrom(popupAttributes.Shadow);
109 if (popupAttributes.Title != null)
111 Title.CopyFrom(popupAttributes.Title);
114 if (popupAttributes.Buttons != null)
116 Buttons.CopyFrom(popupAttributes.Buttons);
119 if (popupAttributes.ShadowOffset != null)
121 ShadowOffset = new Vector4(popupAttributes.ShadowOffset.W, popupAttributes.ShadowOffset.X, popupAttributes.ShadowOffset.Y, popupAttributes.ShadowOffset.Z);
126 private void InitSubStyle()
128 Shadow = new ImageViewStyle()
130 PositionUsesPivotPoint = true,
131 ParentOrigin = Tizen.NUI.ParentOrigin.Center,
132 PivotPoint = Tizen.NUI.PivotPoint.Center
135 Title = new TextLabelStyle()
137 Size = new Size(0, 0),
138 PositionUsesPivotPoint = true,
139 ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
140 PivotPoint = Tizen.NUI.PivotPoint.TopLeft,
141 HorizontalAlignment = HorizontalAlignment.Begin,
142 VerticalAlignment = VerticalAlignment.Bottom
145 Buttons = new ButtonStyle()
147 Size = new Size(0, 0),
148 PositionUsesPivotPoint = true,
149 ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft,
150 PivotPoint = Tizen.NUI.PivotPoint.BottomLeft,
151 Text = new TextLabelStyle
153 PositionUsesPivotPoint = true,
154 ParentOrigin = Tizen.NUI.ParentOrigin.Center,
155 PivotPoint = Tizen.NUI.PivotPoint.Center,
156 HorizontalAlignment = HorizontalAlignment.Center,
157 VerticalAlignment = VerticalAlignment.Center