2 * Copyright(c) 2018 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.
18 using System.ComponentModel;
19 using System.Runtime.InteropServices;
20 using Tizen.NUI.BaseComponents;
21 using Tizen.NUI.Binding;
23 namespace Tizen.NUI.UIComponents
26 /// The Popup widget provides a configurable popup dialog with a built-in layout of three main fields.
28 /// <since_tizen> 3 </since_tizen>
29 public class Popup : View
31 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
32 [EditorBrowsable(EditorBrowsableState.Never)]
33 public static readonly BindableProperty TitleProperty = BindableProperty.Create("Title", typeof(PropertyMap), typeof(Popup), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) =>
35 var popup = (Popup)bindable;
38 Tizen.NUI.Object.SetProperty(popup.swigCPtr, Popup.Property.TITLE, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
41 defaultValueCreator:(bindable) =>
43 var popup = (Popup)bindable;
44 PropertyMap temp = new PropertyMap();
45 Tizen.NUI.Object.GetProperty(popup.swigCPtr, Popup.Property.TITLE).Get(temp);
48 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
49 [EditorBrowsable(EditorBrowsableState.Never)]
50 public static readonly BindableProperty ContentProperty = BindableProperty.Create("Content", typeof(PropertyMap), typeof(Popup), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) =>
52 var popup = (Popup)bindable;
55 Tizen.NUI.Object.SetProperty(popup.swigCPtr, Popup.Property.CONTENT, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
58 defaultValueCreator:(bindable) =>
60 var popup = (Popup)bindable;
61 PropertyMap temp = new PropertyMap();
62 Tizen.NUI.Object.GetProperty(popup.swigCPtr, Popup.Property.CONTENT).Get(temp);
65 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
66 [EditorBrowsable(EditorBrowsableState.Never)]
67 public static readonly BindableProperty FooterProperty = BindableProperty.Create("Footer", typeof(PropertyMap), typeof(Popup), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) =>
69 var popup = (Popup)bindable;
72 Tizen.NUI.Object.SetProperty(popup.swigCPtr, Popup.Property.FOOTER, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
75 defaultValueCreator:(bindable) =>
77 var popup = (Popup)bindable;
78 PropertyMap temp = new PropertyMap();
79 Tizen.NUI.Object.GetProperty(popup.swigCPtr, Popup.Property.FOOTER).Get(temp);
82 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
83 [EditorBrowsable(EditorBrowsableState.Never)]
84 public static readonly BindableProperty DisplayStateProperty = BindableProperty.Create("DisplayState", typeof(DisplayStateType), typeof(Popup), DisplayStateType.Hidden, propertyChanged: (bindable, oldValue, newValue) =>
86 var popup = (Popup)bindable;
87 string valueToString = "";
90 switch ((DisplayStateType)newValue)
92 case DisplayStateType.Showing:
94 valueToString = "SHOWING";
97 case DisplayStateType.Shown:
99 valueToString = "SHOWN";
102 case DisplayStateType.Hiding:
104 valueToString = "HIDING";
107 case DisplayStateType.Hidden:
109 valueToString = "HIDDEN";
114 valueToString = "HIDDEN";
118 Tizen.NUI.Object.SetProperty(popup.swigCPtr, Popup.Property.DISPLAY_STATE, new Tizen.NUI.PropertyValue(valueToString));
121 defaultValueCreator:(bindable) =>
123 var popup = (Popup)bindable;
125 if (Tizen.NUI.Object.GetProperty(popup.swigCPtr, Popup.Property.DISPLAY_STATE).Get(out temp) == false)
127 NUILog.Error("DisplayState get error!");
132 return DisplayStateType.Showing;
134 return DisplayStateType.Shown;
136 return DisplayStateType.Hiding;
138 return DisplayStateType.Hidden;
140 return DisplayStateType.Hidden;
143 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
144 [EditorBrowsable(EditorBrowsableState.Never)]
145 public static readonly BindableProperty TouchTransparentProperty = BindableProperty.Create("TouchTransparent", typeof(bool), typeof(Popup), false, propertyChanged: (bindable, oldValue, newValue) =>
147 var popup = (Popup)bindable;
148 if (newValue != null)
150 Tizen.NUI.Object.SetProperty(popup.swigCPtr, Popup.Property.TOUCH_TRANSPARENT, new Tizen.NUI.PropertyValue((bool)newValue));
153 defaultValueCreator:(bindable) =>
155 var popup = (Popup)bindable;
157 Tizen.NUI.Object.GetProperty(popup.swigCPtr, Popup.Property.TOUCH_TRANSPARENT).Get(out temp);
160 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
161 [EditorBrowsable(EditorBrowsableState.Never)]
162 public static readonly BindableProperty TailVisibilityProperty = BindableProperty.Create("TailVisibility", typeof(bool), typeof(Popup), false, propertyChanged: (bindable, oldValue, newValue) =>
164 var popup = (Popup)bindable;
165 if (newValue != null)
167 Tizen.NUI.Object.SetProperty(popup.swigCPtr, Popup.Property.TAIL_VISIBILITY, new Tizen.NUI.PropertyValue((bool)newValue));
170 defaultValueCreator:(bindable) =>
172 var popup = (Popup)bindable;
174 Tizen.NUI.Object.GetProperty(popup.swigCPtr, Popup.Property.TAIL_VISIBILITY).Get(out temp);
177 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
178 [EditorBrowsable(EditorBrowsableState.Never)]
179 public static readonly BindableProperty TailPositionProperty = BindableProperty.Create("TailPosition", typeof(Vector3), typeof(Popup), Vector3.Zero, propertyChanged: (bindable, oldValue, newValue) =>
181 var popup = (Popup)bindable;
182 if (newValue != null)
184 Tizen.NUI.Object.SetProperty(popup.swigCPtr, Popup.Property.TAIL_POSITION, new Tizen.NUI.PropertyValue((Vector3)newValue));
187 defaultValueCreator:(bindable) =>
189 var popup = (Popup)bindable;
190 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
191 Tizen.NUI.Object.GetProperty(popup.swigCPtr, Popup.Property.TAIL_POSITION).Get(temp);
194 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
195 [EditorBrowsable(EditorBrowsableState.Never)]
196 public static readonly BindableProperty ContextualModeProperty = BindableProperty.Create("ContextualMode", typeof(ContextualModeType), typeof(Popup), ContextualModeType.Below, propertyChanged: (bindable, oldValue, newValue) =>
198 var popup = (Popup)bindable;
199 string valueToString = "";
200 if (newValue != null)
202 switch ((ContextualModeType)newValue)
204 case ContextualModeType.NonContextual:
206 valueToString = "NON_CONTEXTUAL";
209 case ContextualModeType.Above:
211 valueToString = "ABOVE";
214 case ContextualModeType.Rright:
216 valueToString = "RIGHT";
219 case ContextualModeType.Below:
221 valueToString = "BELOW";
224 case ContextualModeType.Left:
226 valueToString = "LEFT";
231 valueToString = "BELOW";
235 Tizen.NUI.Object.SetProperty(popup.swigCPtr, Popup.Property.CONTEXTUAL_MODE, new Tizen.NUI.PropertyValue(valueToString));
238 defaultValueCreator:(bindable) =>
240 var popup = (Popup)bindable;
242 if (Tizen.NUI.Object.GetProperty(popup.swigCPtr, Popup.Property.CONTEXTUAL_MODE).Get(out temp) == false)
244 NUILog.Error("ContextualMode get error!");
248 case "NON_CONTEXTUAL":
249 return ContextualModeType.NonContextual;
251 return ContextualModeType.Above;
253 return ContextualModeType.Rright;
255 return ContextualModeType.Below;
257 return ContextualModeType.Left;
259 return ContextualModeType.Below;
262 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
263 [EditorBrowsable(EditorBrowsableState.Never)]
264 public static readonly BindableProperty AnimationDurationProperty = BindableProperty.Create("AnimationDuration", typeof(float), typeof(Popup), default(float), propertyChanged: (bindable, oldValue, newValue) =>
266 var popup = (Popup)bindable;
267 if (newValue != null)
269 Tizen.NUI.Object.SetProperty(popup.swigCPtr, Popup.Property.ANIMATION_DURATION, new Tizen.NUI.PropertyValue((float)newValue));
272 defaultValueCreator:(bindable) =>
274 var popup = (Popup)bindable;
276 Tizen.NUI.Object.GetProperty(popup.swigCPtr, Popup.Property.ANIMATION_DURATION).Get(out temp);
279 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
280 [EditorBrowsable(EditorBrowsableState.Never)]
281 public static readonly BindableProperty AnimationModeProperty = BindableProperty.Create("AnimationMode", typeof(AnimationModeType), typeof(Popup), AnimationModeType.Fade, propertyChanged: (bindable, oldValue, newValue) =>
283 var popup = (Popup)bindable;
284 string valueToString = "";
285 if (newValue != null)
287 switch ((AnimationModeType)newValue)
289 case AnimationModeType.None:
291 valueToString = "NONE";
294 case AnimationModeType.Zoom:
296 valueToString = "ZOOM";
299 case AnimationModeType.Fade:
301 valueToString = "FADE";
304 case AnimationModeType.Custom:
306 valueToString = "CUSTOM";
311 valueToString = "FADE";
315 Tizen.NUI.Object.SetProperty(popup.swigCPtr, Popup.Property.ANIMATION_MODE, new Tizen.NUI.PropertyValue(valueToString));
318 defaultValueCreator:(bindable) =>
320 var popup = (Popup)bindable;
322 if (Tizen.NUI.Object.GetProperty(popup.swigCPtr, Popup.Property.ANIMATION_MODE).Get(out temp) == false)
324 NUILog.Error("AnimationMode get error!");
329 return AnimationModeType.None;
331 return AnimationModeType.Zoom;
333 return AnimationModeType.Fade;
335 return AnimationModeType.Custom;
337 return AnimationModeType.Fade;
340 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
341 [EditorBrowsable(EditorBrowsableState.Never)]
342 public static readonly BindableProperty EntryAnimationProperty = BindableProperty.Create("EntryAnimation", typeof(PropertyMap), typeof(Popup), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) =>
344 var popup = (Popup)bindable;
345 if (newValue != null)
347 Tizen.NUI.Object.SetProperty(popup.swigCPtr, Popup.Property.ENTRY_ANIMATION, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
350 defaultValueCreator:(bindable) =>
352 var popup = (Popup)bindable;
353 PropertyMap temp = new PropertyMap();
354 Tizen.NUI.Object.GetProperty(popup.swigCPtr, Popup.Property.ENTRY_ANIMATION).Get(temp);
357 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
358 [EditorBrowsable(EditorBrowsableState.Never)]
359 public static readonly BindableProperty ExitAnimationProperty = BindableProperty.Create("ExitAnimation", typeof(PropertyMap), typeof(Popup), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) =>
361 var popup = (Popup)bindable;
362 if (newValue != null)
364 Tizen.NUI.Object.SetProperty(popup.swigCPtr, Popup.Property.EXIT_ANIMATION, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
367 defaultValueCreator:(bindable) =>
369 var popup = (Popup)bindable;
370 PropertyMap temp = new PropertyMap();
371 Tizen.NUI.Object.GetProperty(popup.swigCPtr, Popup.Property.EXIT_ANIMATION).Get(temp);
374 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
375 [EditorBrowsable(EditorBrowsableState.Never)]
376 public static readonly BindableProperty AutoHideDelayProperty = BindableProperty.Create("AutoHideDelay", typeof(int), typeof(Popup), default(int), propertyChanged: (bindable, oldValue, newValue) =>
378 var popup = (Popup)bindable;
379 if (newValue != null)
381 Tizen.NUI.Object.SetProperty(popup.swigCPtr, Popup.Property.AUTO_HIDE_DELAY, new Tizen.NUI.PropertyValue((int)newValue));
384 defaultValueCreator:(bindable) =>
386 var popup = (Popup)bindable;
388 Tizen.NUI.Object.GetProperty(popup.swigCPtr, Popup.Property.AUTO_HIDE_DELAY).Get(out temp);
391 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
392 [EditorBrowsable(EditorBrowsableState.Never)]
393 public static readonly BindableProperty BackingEnabledProperty = BindableProperty.Create("BackingEnabled", typeof(bool), typeof(Popup), false, propertyChanged: (bindable, oldValue, newValue) =>
395 var popup = (Popup)bindable;
396 if (newValue != null)
398 Tizen.NUI.Object.SetProperty(popup.swigCPtr, Popup.Property.BACKING_ENABLED, new Tizen.NUI.PropertyValue((bool)newValue));
401 defaultValueCreator:(bindable) =>
403 var popup = (Popup)bindable;
405 Tizen.NUI.Object.GetProperty(popup.swigCPtr, Popup.Property.BACKING_ENABLED).Get(out temp);
408 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
409 [EditorBrowsable(EditorBrowsableState.Never)]
410 public static readonly BindableProperty BackingColorProperty = BindableProperty.Create("BackingColor", typeof(Vector4), typeof(Popup), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) =>
412 var popup = (Popup)bindable;
413 if (newValue != null)
415 Tizen.NUI.Object.SetProperty(popup.swigCPtr, Popup.Property.BACKING_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue));
418 defaultValueCreator:(bindable) =>
420 var popup = (Popup)bindable;
421 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
422 Tizen.NUI.Object.GetProperty(popup.swigCPtr, Popup.Property.BACKING_COLOR).Get(temp);
425 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
426 [EditorBrowsable(EditorBrowsableState.Never)]
427 public static readonly BindableProperty PopupBackgroundImageProperty = BindableProperty.Create("PopupBackgroundImage", typeof(string), typeof(Popup), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
429 var popup = (Popup)bindable;
430 if (newValue != null)
432 Tizen.NUI.Object.SetProperty(popup.swigCPtr, Popup.Property.POPUP_BACKGROUND_IMAGE, new Tizen.NUI.PropertyValue((string)newValue));
435 defaultValueCreator:(bindable) =>
437 var popup = (Popup)bindable;
439 Tizen.NUI.Object.GetProperty(popup.swigCPtr, Popup.Property.POPUP_BACKGROUND_IMAGE).Get(out temp);
442 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
443 [EditorBrowsable(EditorBrowsableState.Never)]
444 public static readonly BindableProperty PopupBackgroundBorderProperty = BindableProperty.Create("PopupBackgroundBorder", typeof(Rectangle), typeof(Popup), new Rectangle(0,0,0,0), propertyChanged: (bindable, oldValue, newValue) =>
446 var popup = (Popup)bindable;
447 if (newValue != null)
449 Tizen.NUI.Object.SetProperty(popup.swigCPtr, Popup.Property.POPUP_BACKGROUND_BORDER, new Tizen.NUI.PropertyValue((Rectangle)newValue));
452 defaultValueCreator:(bindable) =>
454 var popup = (Popup)bindable;
455 Rectangle temp = new Rectangle(0, 0, 0, 0);
456 Tizen.NUI.Object.GetProperty(popup.swigCPtr, Popup.Property.POPUP_BACKGROUND_BORDER).Get(temp);
459 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
460 [EditorBrowsable(EditorBrowsableState.Never)]
461 public static readonly BindableProperty TailUpImageProperty = BindableProperty.Create("TailUpImage", typeof(string), typeof(Popup), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
463 var popup = (Popup)bindable;
464 if (newValue != null)
466 Tizen.NUI.Object.SetProperty(popup.swigCPtr, Popup.Property.TAIL_UP_IMAGE, new Tizen.NUI.PropertyValue((string)newValue));
469 defaultValueCreator:(bindable) =>
471 var popup = (Popup)bindable;
473 Tizen.NUI.Object.GetProperty(popup.swigCPtr, Popup.Property.TAIL_UP_IMAGE).Get(out temp);
476 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
477 [EditorBrowsable(EditorBrowsableState.Never)]
478 public static readonly BindableProperty TailDownImageProperty = BindableProperty.Create("TailDownImage", typeof(string), typeof(Popup), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
480 var popup = (Popup)bindable;
481 if (newValue != null)
483 Tizen.NUI.Object.SetProperty(popup.swigCPtr, Popup.Property.TAIL_DOWN_IMAGE, new Tizen.NUI.PropertyValue((string)newValue));
486 defaultValueCreator:(bindable) =>
488 var popup = (Popup)bindable;
490 Tizen.NUI.Object.GetProperty(popup.swigCPtr, Popup.Property.TAIL_DOWN_IMAGE).Get(out temp);
493 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
494 [EditorBrowsable(EditorBrowsableState.Never)]
495 public static readonly BindableProperty TailLeftImageProperty = BindableProperty.Create("TailLeftImage", typeof(string), typeof(Popup), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
497 var popup = (Popup)bindable;
498 if (newValue != null)
500 Tizen.NUI.Object.SetProperty(popup.swigCPtr, Popup.Property.TAIL_LEFT_IMAGE, new Tizen.NUI.PropertyValue((string)newValue));
503 defaultValueCreator:(bindable) =>
505 var popup = (Popup)bindable;
507 Tizen.NUI.Object.GetProperty(popup.swigCPtr, Popup.Property.TAIL_LEFT_IMAGE).Get(out temp);
510 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
511 [EditorBrowsable(EditorBrowsableState.Never)]
512 public static readonly BindableProperty TailRightImageProperty = BindableProperty.Create("TailRightImage", typeof(string), typeof(Popup), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
514 var popup = (Popup)bindable;
515 if (newValue != null)
517 Tizen.NUI.Object.SetProperty(popup.swigCPtr, Popup.Property.TAIL_RIGHT_IMAGE, new Tizen.NUI.PropertyValue((string)newValue));
520 defaultValueCreator:(bindable) =>
522 var popup = (Popup)bindable;
524 Tizen.NUI.Object.GetProperty(popup.swigCPtr, Popup.Property.TAIL_RIGHT_IMAGE).Get(out temp);
528 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
529 private EventHandler<TouchedOutsideEventArgs> _popUpOutsideTouchedEventHandler;
530 private OutsideTouchedEventCallbackDelegate _popUpOutsideTouchedEventCallbackDelegate;
531 private EventHandler<ShowingEventArgs> _popUpShowingEventHandler;
532 private ShowingEventCallbackDelegate _popUpShowingEventCallbackDelegate;
533 private EventHandler<ShownEventArgs> _popUpShownEventHandler;
534 private ShownEventCallbackDelegate _popUpShownEventCallbackDelegate;
535 private EventHandler<HidingEventArgs> _popUpHidingEventHandler;
536 private HidingEventCallbackDelegate _popUpHidingEventCallbackDelegate;
537 private EventHandler<HiddenEventArgs> _popUpHiddenEventHandler;
538 private HiddenEventCallbackDelegate _popUpHiddenEventCallbackDelegate;
541 /// Creates the popup.
543 /// <since_tizen> 3 </since_tizen>
544 public Popup() : this(Interop.Popup.Popup_New(), true)
546 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
549 internal Popup(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.Popup.Popup_SWIGUpcast(cPtr), cMemoryOwn)
551 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
554 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
555 private delegate void OutsideTouchedEventCallbackDelegate();
556 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
557 private delegate void ShowingEventCallbackDelegate();
558 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
559 private delegate void ShownEventCallbackDelegate();
560 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
561 private delegate void HidingEventCallbackDelegate();
562 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
563 private delegate void HiddenEventCallbackDelegate();
566 /// An event is sent when the user has touched outside the dialog.
568 /// <since_tizen> 3 </since_tizen>
569 public event EventHandler<TouchedOutsideEventArgs> TouchedOutside
573 if (_popUpOutsideTouchedEventHandler == null)
575 _popUpOutsideTouchedEventCallbackDelegate = (OnOutsideTouched);
576 OutsideTouchedSignal().Connect(_popUpOutsideTouchedEventCallbackDelegate);
578 _popUpOutsideTouchedEventHandler += value;
582 _popUpOutsideTouchedEventHandler -= value;
583 if (_popUpOutsideTouchedEventHandler == null && OutsideTouchedSignal().Empty() == false)
585 this.OutsideTouchedSignal().Disconnect(_popUpOutsideTouchedEventCallbackDelegate);
591 /// An event is sent when the popup starts showing.
593 /// <since_tizen> 3 </since_tizen>
594 public event EventHandler<ShowingEventArgs> Showing
598 if (_popUpShowingEventHandler == null)
600 _popUpShowingEventCallbackDelegate = (OnShowing);
601 ShowingSignal().Connect(_popUpShowingEventCallbackDelegate);
603 _popUpShowingEventHandler += value;
607 _popUpShowingEventHandler -= value;
608 if (_popUpShowingEventHandler == null && ShowingSignal().Empty() == false)
610 ShowingSignal().Disconnect(_popUpShowingEventCallbackDelegate);
616 /// An event is sent when the popup has been fully displayed.
618 /// <since_tizen> 3 </since_tizen>
619 public event EventHandler<ShownEventArgs> Shown
623 if (_popUpShownEventHandler == null)
625 _popUpShownEventCallbackDelegate = (OnShown);
626 ShownSignal().Connect(_popUpShownEventCallbackDelegate);
628 _popUpShownEventHandler += value;
632 _popUpShownEventHandler -= value;
633 if (_popUpShownEventHandler == null && ShownSignal().Empty() == false)
635 ShownSignal().Disconnect(_popUpShownEventCallbackDelegate);
641 /// An event is sent when the popup starts to hide.
643 /// <since_tizen> 3 </since_tizen>
644 public event EventHandler<HidingEventArgs> Hiding
648 if (_popUpHidingEventHandler == null)
650 _popUpHidingEventCallbackDelegate = (OnHiding);
651 HidingSignal().Connect(_popUpHidingEventCallbackDelegate);
653 _popUpHidingEventHandler += value;
657 _popUpHidingEventHandler -= value;
658 if (_popUpHidingEventHandler == null && HidingSignal().Empty() == false)
660 HidingSignal().Disconnect(_popUpHidingEventCallbackDelegate);
666 /// An event is sent when the popup has been completely hidden.
668 /// <since_tizen> 3 </since_tizen>
669 public event EventHandler<HiddenEventArgs> Hidden
673 if (_popUpHiddenEventHandler == null)
675 _popUpHiddenEventCallbackDelegate = (OnHidden);
676 HiddenSignal().Connect(_popUpHiddenEventCallbackDelegate);
678 _popUpHiddenEventHandler += value;
682 _popUpHiddenEventHandler -= value;
683 if (_popUpHiddenEventHandler == null && HiddenSignal().Empty() == false)
685 HiddenSignal().Disconnect(_popUpHiddenEventCallbackDelegate);
691 /// The display states of the popup.
693 /// <since_tizen> 3 </since_tizen>
694 public enum DisplayStateType
697 /// The popup is transitioning in
699 /// <since_tizen> 3 </since_tizen>
702 /// The popup is fully shown
704 /// <since_tizen> 3 </since_tizen>
707 /// The popup is transitioning out
709 /// <since_tizen> 3 </since_tizen>
712 /// The popup is fully hidden
714 /// <since_tizen> 3 </since_tizen>
719 /// The animation modes within the popup.<br />
720 /// Choose from a predefined mode or "CUSTOM" to use the ANIMATION_IN and ANIMATION_OUT properties.<br />
722 /// <since_tizen> 3 </since_tizen>
723 public enum AnimationModeType
728 /// <since_tizen> 3 </since_tizen>
731 /// Popup zooms in and out animating the scale property.
733 /// <since_tizen> 3 </since_tizen>
736 /// Popup fades in and out
738 /// <since_tizen> 3 </since_tizen>
741 /// Use the EntryAnimation and ExitAnimation animation properties.
743 /// <since_tizen> 3 </since_tizen>
748 /// The types of the contextual layout.<br />
749 /// The popup is positioned adjacent to it's parent in the direction specified by this mode.<br />
750 /// NON_CONTEXTUAL disables any contextual positioning.<br />
752 /// <since_tizen> 3 </since_tizen>
753 public enum ContextualModeType
756 /// any contextual positioning
758 /// <since_tizen> 3 </since_tizen>
763 /// <since_tizen> 3 </since_tizen>
768 /// <since_tizen> 3 </since_tizen>
773 /// <since_tizen> 3 </since_tizen>
778 /// <since_tizen> 3 </since_tizen>
785 /// <since_tizen> 3 </since_tizen>
786 public PropertyMap Title
790 return (PropertyMap)GetValue(TitleProperty);
794 SetValue(TitleProperty, value);
799 /// The popup content.
801 /// <since_tizen> 3 </since_tizen>
802 public PropertyMap Content
806 return (PropertyMap)GetValue(ContentProperty);
810 SetValue(ContentProperty, value);
815 /// The popup footer.
817 /// <since_tizen> 3 </since_tizen>
818 public PropertyMap Footer
822 return (PropertyMap)GetValue(FooterProperty);
826 SetValue(FooterProperty, value);
831 /// The popup display state.
833 /// <since_tizen> 3 </since_tizen>
834 public DisplayStateType DisplayState
838 return (DisplayStateType)GetValue(DisplayStateProperty);
842 SetValue(DisplayStateProperty, value);
847 /// The touch transparent.
849 /// <since_tizen> 3 </since_tizen>
850 public bool TouchTransparent
854 return (bool)GetValue(TouchTransparentProperty);
858 SetValue(TouchTransparentProperty, value);
863 /// The popup tail visibility.
865 /// <since_tizen> 3 </since_tizen>
866 public bool TailVisibility
870 return (bool)GetValue(TailVisibilityProperty);
874 SetValue(TailVisibilityProperty, value);
879 /// The popup tail position.
881 /// <since_tizen> 3 </since_tizen>
882 public Vector3 TailPosition
886 return (Vector3)GetValue(TailPositionProperty);
890 SetValue(TailPositionProperty, value);
895 /// The contextual mode.
897 /// <since_tizen> 3 </since_tizen>
898 public ContextualModeType ContextualMode
902 return (ContextualModeType)GetValue(ContextualModeProperty);
906 SetValue(ContextualModeProperty, value);
911 /// The animation duration.
913 /// <since_tizen> 3 </since_tizen>
914 public float AnimationDuration
918 return (float)GetValue(AnimationDurationProperty);
922 SetValue(AnimationDurationProperty, value);
927 /// The animation mode.
929 /// <since_tizen> 3 </since_tizen>
930 public AnimationModeType AnimationMode
934 return (AnimationModeType)GetValue(AnimationModeProperty);
938 SetValue(AnimationModeProperty, value);
943 /// The entry animation.
945 /// <since_tizen> 3 </since_tizen>
946 public PropertyMap EntryAnimation
950 return (PropertyMap)GetValue(EntryAnimationProperty);
954 SetValue(EntryAnimationProperty, value);
959 /// The exit animation.
961 /// <since_tizen> 3 </since_tizen>
962 public PropertyMap ExitAnimation
966 return (PropertyMap)GetValue(ExitAnimationProperty);
970 SetValue(ExitAnimationProperty, value);
975 /// The auto hide delay.
977 /// <since_tizen> 3 </since_tizen>
978 public int AutoHideDelay
982 return (int)GetValue(AutoHideDelayProperty);
986 SetValue(AutoHideDelayProperty, value);
991 /// The backing enabled.
993 /// <since_tizen> 3 </since_tizen>
994 public bool BackingEnabled
998 return (bool)GetValue(BackingEnabledProperty);
1002 SetValue(BackingEnabledProperty, value);
1007 /// The backing color.
1009 /// <since_tizen> 3 </since_tizen>
1010 public Vector4 BackingColor
1014 return (Vector4)GetValue(BackingColorProperty);
1018 SetValue(BackingColorProperty, value);
1023 /// The background image.
1025 /// <since_tizen> 3 </since_tizen>
1026 public string PopupBackgroundImage
1030 return (string)GetValue(PopupBackgroundImageProperty);
1034 SetValue(PopupBackgroundImageProperty, value);
1039 /// The background border.
1041 /// <since_tizen> 3 </since_tizen>
1042 public Rectangle PopupBackgroundBorder
1046 return (Rectangle)GetValue(PopupBackgroundBorderProperty);
1050 SetValue(PopupBackgroundBorderProperty, value);
1055 /// The tail up image.
1057 /// <since_tizen> 3 </since_tizen>
1058 public string TailUpImage
1062 return (string)GetValue(TailUpImageProperty);
1066 SetValue(TailUpImageProperty, value);
1071 /// The tail down image.
1073 /// <since_tizen> 3 </since_tizen>
1074 public string TailDownImage
1078 return (string)GetValue(TailDownImageProperty);
1082 SetValue(TailDownImageProperty, value);
1087 /// The tail left image.
1089 /// <since_tizen> 3 </since_tizen>
1090 public string TailLeftImage
1094 return (string)GetValue(TailLeftImageProperty);
1098 SetValue(TailLeftImageProperty, value);
1103 /// The tail right image.
1105 /// <since_tizen> 3 </since_tizen>
1106 public string TailRightImage
1110 return (string)GetValue(TailRightImageProperty);
1114 SetValue(TailRightImageProperty, value);
1119 /// Sets the title for this popup.
1121 /// <param name="titleView">The actor to set the title.</param>
1122 /// <since_tizen> 3 </since_tizen>
1123 public void SetTitle(View titleView)
1125 Interop.Popup.Popup_SetTitle(swigCPtr, View.getCPtr(titleView));
1126 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1130 /// Sets the content actor.
1132 /// <param name="content">The actor to use.</param>
1133 /// <since_tizen> 3 </since_tizen>
1134 public void SetContent(View content)
1136 Interop.Popup.Popup_SetContent(swigCPtr, View.getCPtr(content));
1137 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1141 /// Sets the actor to use for the footer in this popup.
1143 /// <param name="footer">The footer actor to be added to this popup.</param>
1144 /// <since_tizen> 3 </since_tizen>
1145 public void SetFooter(View footer)
1147 Interop.Popup.Popup_SetFooter(swigCPtr, View.getCPtr(footer));
1148 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1152 /// Sets the display state of popup.<br />
1153 /// There are 4 total display states.<br />
1154 /// Only 2 can be set, but all four can be read for better inspection of the current popup state.<br />
1156 /// The other two states are getable, but not setable, and are there for consistency.<br />
1158 /// | Value | Setting the state | Getting the state |<br />
1159 /// |----------|--------------------------------|--------------------------------|<br />
1160 /// | SHOWN | Show the popup | The popup is fully shown |<br />
1161 /// | HIDDEN | Hide the popup | The popup is fully hidden |<br />
1162 /// | SHOWING | | The popup is transitioning in |<br />
1163 /// | HIDING | | The popup is transitioning out |<br />
1165 /// All 4 states changes cause notifications via 4 respective signals that can be connected to.<br />
1167 /// <param name="displayState">The desired display state to change to.</param>
1168 /// <since_tizen> 3 </since_tizen>
1169 public void SetDisplayState(Popup.DisplayStateType displayState)
1171 Interop.Popup.Popup_SetDisplayState(swigCPtr, (int)displayState);
1172 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1175 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Popup obj)
1177 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
1180 internal View GetTitle()
1182 //to fix memory leak issue, match the handle count with native side.
1183 IntPtr cPtr = Interop.Popup.Popup_GetTitle(swigCPtr);
1184 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
1185 View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View;
1186 Interop.BaseHandle.delete_BaseHandle(CPtr);
1187 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
1189 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1193 internal View GetContent()
1195 //to fix memory leak issue, match the handle count with native side.
1196 IntPtr cPtr = Interop.Popup.Popup_GetContent(swigCPtr);
1197 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
1198 View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View;
1199 Interop.BaseHandle.delete_BaseHandle(CPtr);
1200 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
1202 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1206 internal View GetFooter()
1208 //to fix memory leak issue, match the handle count with native side.
1209 IntPtr cPtr = Interop.Popup.Popup_GetFooter(swigCPtr);
1210 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
1211 View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View;
1212 Interop.BaseHandle.delete_BaseHandle(CPtr);
1213 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
1215 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1219 internal Popup.DisplayStateType GetDisplayState()
1221 Popup.DisplayStateType ret = (Popup.DisplayStateType)Interop.Popup.Popup_GetDisplayState(swigCPtr);
1222 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1226 internal VoidSignal OutsideTouchedSignal()
1228 VoidSignal ret = new VoidSignal(Interop.Popup.Popup_OutsideTouchedSignal(swigCPtr), false);
1229 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1233 internal VoidSignal ShowingSignal()
1235 VoidSignal ret = new VoidSignal(Interop.Popup.Popup_ShowingSignal(swigCPtr), false);
1236 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1240 internal VoidSignal ShownSignal()
1242 VoidSignal ret = new VoidSignal(Interop.Popup.Popup_ShownSignal(swigCPtr), false);
1243 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1247 internal VoidSignal HidingSignal()
1249 VoidSignal ret = new VoidSignal(Interop.Popup.Popup_HidingSignal(swigCPtr), false);
1250 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1254 internal VoidSignal HiddenSignal()
1256 VoidSignal ret = new VoidSignal(Interop.Popup.Popup_HiddenSignal(swigCPtr), false);
1257 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1264 /// <param name="type">The dispose type</param>
1265 /// <since_tizen> 3 </since_tizen>
1266 protected override void Dispose(DisposeTypes type)
1273 //Release your own unmanaged resources here.
1274 //You should not access any managed member here except static instance.
1275 //because the execution order of Finalizes is non-deterministic.
1278 if (_popUpHiddenEventCallbackDelegate != null)
1280 HiddenSignal().Disconnect(_popUpHiddenEventCallbackDelegate);
1283 if (_popUpHidingEventCallbackDelegate != null)
1285 HidingSignal().Disconnect(_popUpHidingEventCallbackDelegate);
1289 if (_popUpShownEventCallbackDelegate != null)
1291 ShownSignal().Disconnect(_popUpShownEventCallbackDelegate);
1294 if (_popUpShowingEventCallbackDelegate != null)
1296 ShowingSignal().Disconnect(_popUpShowingEventCallbackDelegate);
1299 if (_popUpOutsideTouchedEventCallbackDelegate != null)
1301 this.OutsideTouchedSignal().Disconnect(_popUpOutsideTouchedEventCallbackDelegate);
1304 if (swigCPtr.Handle != global::System.IntPtr.Zero)
1308 swigCMemOwn = false;
1309 Interop.Popup.delete_Popup(swigCPtr);
1311 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
1317 // Callback for Popup OutsideTouchedSignal
1318 private void OnOutsideTouched()
1320 TouchedOutsideEventArgs e = new TouchedOutsideEventArgs();
1322 if (_popUpOutsideTouchedEventHandler != null)
1324 //here we send all data to user event handlers
1325 _popUpOutsideTouchedEventHandler(this, e);
1329 // Callback for ShowingSignal
1330 private void OnShowing()
1332 ShowingEventArgs e = new ShowingEventArgs();
1334 if (_popUpShowingEventHandler != null)
1336 //here we send all data to user event handlers
1337 _popUpShowingEventHandler(this, e);
1341 // Callback for ShownSignal
1342 private void OnShown()
1344 ShownEventArgs e = new ShownEventArgs();
1346 if (_popUpShownEventHandler != null)
1348 //here we send all data to user event handlers
1349 _popUpShownEventHandler(this, e);
1353 // Callback for HidingSignal
1354 private void OnHiding()
1356 HidingEventArgs e = new HidingEventArgs();
1358 if (_popUpHidingEventHandler != null)
1360 //here we send all data to user event handlers
1361 _popUpHidingEventHandler(this, e);
1365 // Callback for HiddenSignal
1366 private void OnHidden()
1368 HiddenEventArgs e = new HiddenEventArgs();
1370 if (_popUpHiddenEventHandler != null)
1372 //here we send all data to user event handlers
1373 _popUpHiddenEventHandler(this, e);
1378 /// Event arguments that passed via the OutsideTouchedEvent.
1380 /// <since_tizen> 3 </since_tizen>
1381 public class TouchedOutsideEventArgs : EventArgs
1386 /// Event arguments that passed via the ShowingEventArgs.
1388 /// <since_tizen> 3 </since_tizen>
1389 public class ShowingEventArgs : EventArgs
1394 /// Event arguments that passed via the ShownEventArgs.
1396 /// <since_tizen> 3 </since_tizen>
1397 public class ShownEventArgs : EventArgs
1402 /// Event arguments that passed via the HidingEventArgs.
1404 /// <since_tizen> 3 </since_tizen>
1405 public class HidingEventArgs : EventArgs
1410 /// Event arguments that passed via the HiddenEventArgs.
1412 /// <since_tizen> 3 </since_tizen>
1413 public class HiddenEventArgs : EventArgs
1417 internal new class Property
1419 internal static readonly int TITLE = Interop.Popup.Popup_Property_TITLE_get();
1420 internal static readonly int CONTENT = Interop.Popup.Popup_Property_CONTENT_get();
1421 internal static readonly int FOOTER = Interop.Popup.Popup_Property_FOOTER_get();
1422 internal static readonly int DISPLAY_STATE = Interop.Popup.Popup_Property_DISPLAY_STATE_get();
1423 internal static readonly int TOUCH_TRANSPARENT = Interop.Popup.Popup_Property_TOUCH_TRANSPARENT_get();
1424 internal static readonly int TAIL_VISIBILITY = Interop.Popup.Popup_Property_TAIL_VISIBILITY_get();
1425 internal static readonly int TAIL_POSITION = Interop.Popup.Popup_Property_TAIL_POSITION_get();
1426 internal static readonly int CONTEXTUAL_MODE = Interop.Popup.Popup_Property_CONTEXTUAL_MODE_get();
1427 internal static readonly int ANIMATION_DURATION = Interop.Popup.Popup_Property_ANIMATION_DURATION_get();
1428 internal static readonly int ANIMATION_MODE = Interop.Popup.Popup_Property_ANIMATION_MODE_get();
1429 internal static readonly int ENTRY_ANIMATION = Interop.Popup.Popup_Property_ENTRY_ANIMATION_get();
1430 internal static readonly int EXIT_ANIMATION = Interop.Popup.Popup_Property_EXIT_ANIMATION_get();
1431 internal static readonly int AUTO_HIDE_DELAY = Interop.Popup.Popup_Property_AUTO_HIDE_DELAY_get();
1432 internal static readonly int BACKING_ENABLED = Interop.Popup.Popup_Property_BACKING_ENABLED_get();
1433 internal static readonly int BACKING_COLOR = Interop.Popup.Popup_Property_BACKING_COLOR_get();
1434 internal static readonly int POPUP_BACKGROUND_IMAGE = Interop.Popup.Popup_Property_POPUP_BACKGROUND_IMAGE_get();
1435 internal static readonly int POPUP_BACKGROUND_BORDER = Interop.Popup.Popup_Property_POPUP_BACKGROUND_BORDER_get();
1436 internal static readonly int TAIL_UP_IMAGE = Interop.Popup.Popup_Property_TAIL_UP_IMAGE_get();
1437 internal static readonly int TAIL_DOWN_IMAGE = Interop.Popup.Popup_Property_TAIL_DOWN_IMAGE_get();
1438 internal static readonly int TAIL_LEFT_IMAGE = Interop.Popup.Popup_Property_TAIL_LEFT_IMAGE_get();
1439 internal static readonly int TAIL_RIGHT_IMAGE = Interop.Popup.Popup_Property_TAIL_RIGHT_IMAGE_get();