2 * Copyright(c) 2017 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;
530 internal Popup(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Popup_SWIGUpcast(cPtr), cMemoryOwn)
532 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
535 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Popup obj)
537 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
543 /// <param name="type">The dispose type</param>
544 /// <since_tizen> 3 </since_tizen>
545 protected override void Dispose(DisposeTypes type)
552 if (type == DisposeTypes.Explicit)
555 //Release your own managed resources here.
556 //You should release all of your own disposable objects here.
560 //Release your own unmanaged resources here.
561 //You should not access any managed member here except static instance.
562 //because the execution order of Finalizes is non-deterministic.
565 if (_popUpHiddenEventCallbackDelegate != null)
567 HiddenSignal().Disconnect(_popUpHiddenEventCallbackDelegate);
570 if (_popUpHidingEventCallbackDelegate != null)
572 HidingSignal().Disconnect(_popUpHidingEventCallbackDelegate);
576 if (_popUpShownEventCallbackDelegate != null)
578 ShownSignal().Disconnect(_popUpShownEventCallbackDelegate);
581 if (_popUpShowingEventCallbackDelegate != null)
583 ShowingSignal().Disconnect(_popUpShowingEventCallbackDelegate);
586 if (_popUpOutsideTouchedEventCallbackDelegate != null)
588 this.OutsideTouchedSignal().Disconnect(_popUpOutsideTouchedEventCallbackDelegate);
591 if (swigCPtr.Handle != global::System.IntPtr.Zero)
596 NDalicPINVOKE.delete_Popup(swigCPtr);
598 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
608 /// Event arguments that passed via the OutsideTouchedEvent.
610 /// <since_tizen> 3 </since_tizen>
611 public class TouchedOutsideEventArgs : EventArgs
616 /// Event arguments that passed via the ShowingEventArgs.
618 /// <since_tizen> 3 </since_tizen>
619 public class ShowingEventArgs : EventArgs
624 /// Event arguments that passed via the ShownEventArgs.
626 /// <since_tizen> 3 </since_tizen>
627 public class ShownEventArgs : EventArgs
632 /// Event arguments that passed via the HidingEventArgs.
634 /// <since_tizen> 3 </since_tizen>
635 public class HidingEventArgs : EventArgs
640 /// Event arguments that passed via the HiddenEventArgs.
642 /// <since_tizen> 3 </since_tizen>
643 public class HiddenEventArgs : EventArgs
647 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
648 private delegate void OutsideTouchedEventCallbackDelegate();
649 private EventHandler<TouchedOutsideEventArgs> _popUpOutsideTouchedEventHandler;
650 private OutsideTouchedEventCallbackDelegate _popUpOutsideTouchedEventCallbackDelegate;
652 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
653 private delegate void ShowingEventCallbackDelegate();
654 private EventHandler<ShowingEventArgs> _popUpShowingEventHandler;
655 private ShowingEventCallbackDelegate _popUpShowingEventCallbackDelegate;
657 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
658 private delegate void ShownEventCallbackDelegate();
659 private EventHandler<ShownEventArgs> _popUpShownEventHandler;
660 private ShownEventCallbackDelegate _popUpShownEventCallbackDelegate;
662 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
663 private delegate void HidingEventCallbackDelegate();
664 private EventHandler<HidingEventArgs> _popUpHidingEventHandler;
665 private HidingEventCallbackDelegate _popUpHidingEventCallbackDelegate;
667 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
668 private delegate void HiddenEventCallbackDelegate();
669 private EventHandler<HiddenEventArgs> _popUpHiddenEventHandler;
670 private HiddenEventCallbackDelegate _popUpHiddenEventCallbackDelegate;
673 /// An event is sent when the user has touched outside the dialog.
675 /// <since_tizen> 3 </since_tizen>
676 public event EventHandler<TouchedOutsideEventArgs> TouchedOutside
680 if (_popUpOutsideTouchedEventHandler == null)
682 _popUpOutsideTouchedEventCallbackDelegate = (OnOutsideTouched);
683 OutsideTouchedSignal().Connect(_popUpOutsideTouchedEventCallbackDelegate);
685 _popUpOutsideTouchedEventHandler += value;
689 _popUpOutsideTouchedEventHandler -= value;
690 if (_popUpOutsideTouchedEventHandler == null && OutsideTouchedSignal().Empty() == false)
692 this.OutsideTouchedSignal().Disconnect(_popUpOutsideTouchedEventCallbackDelegate);
697 // Callback for Popup OutsideTouchedSignal
698 private void OnOutsideTouched()
700 TouchedOutsideEventArgs e = new TouchedOutsideEventArgs();
702 if (_popUpOutsideTouchedEventHandler != null)
704 //here we send all data to user event handlers
705 _popUpOutsideTouchedEventHandler(this, e);
710 /// An event is sent when the popup starts showing.
712 /// <since_tizen> 3 </since_tizen>
713 public event EventHandler<ShowingEventArgs> Showing
717 if (_popUpShowingEventHandler == null)
719 _popUpShowingEventCallbackDelegate = (OnShowing);
720 ShowingSignal().Connect(_popUpShowingEventCallbackDelegate);
722 _popUpShowingEventHandler += value;
726 _popUpShowingEventHandler -= value;
727 if (_popUpShowingEventHandler == null && ShowingSignal().Empty() == false)
729 ShowingSignal().Disconnect(_popUpShowingEventCallbackDelegate);
734 // Callback for ShowingSignal
735 private void OnShowing()
737 ShowingEventArgs e = new ShowingEventArgs();
739 if (_popUpShowingEventHandler != null)
741 //here we send all data to user event handlers
742 _popUpShowingEventHandler(this, e);
748 /// An event is sent when the popup has been fully displayed.
750 /// <since_tizen> 3 </since_tizen>
751 public event EventHandler<ShownEventArgs> Shown
755 if (_popUpShownEventHandler == null)
757 _popUpShownEventCallbackDelegate = (OnShown);
758 ShownSignal().Connect(_popUpShownEventCallbackDelegate);
760 _popUpShownEventHandler += value;
764 _popUpShownEventHandler -= value;
765 if (_popUpShownEventHandler == null && ShownSignal().Empty() == false)
767 ShownSignal().Disconnect(_popUpShownEventCallbackDelegate);
772 // Callback for ShownSignal
773 private void OnShown()
775 ShownEventArgs e = new ShownEventArgs();
777 if (_popUpShownEventHandler != null)
779 //here we send all data to user event handlers
780 _popUpShownEventHandler(this, e);
785 /// An event is sent when the popup starts to hide.
787 /// <since_tizen> 3 </since_tizen>
788 public event EventHandler<HidingEventArgs> Hiding
792 if (_popUpHidingEventHandler == null)
794 _popUpHidingEventCallbackDelegate = (OnHiding);
795 HidingSignal().Connect(_popUpHidingEventCallbackDelegate);
797 _popUpHidingEventHandler += value;
801 _popUpHidingEventHandler -= value;
802 if (_popUpHidingEventHandler == null && HidingSignal().Empty() == false)
804 HidingSignal().Disconnect(_popUpHidingEventCallbackDelegate);
809 // Callback for HidingSignal
810 private void OnHiding()
812 HidingEventArgs e = new HidingEventArgs();
814 if (_popUpHidingEventHandler != null)
816 //here we send all data to user event handlers
817 _popUpHidingEventHandler(this, e);
822 /// An event is sent when the popup has been completely hidden.
824 /// <since_tizen> 3 </since_tizen>
825 public event EventHandler<HiddenEventArgs> Hidden
829 if (_popUpHiddenEventHandler == null)
831 _popUpHiddenEventCallbackDelegate = (OnHidden);
832 HiddenSignal().Connect(_popUpHiddenEventCallbackDelegate);
834 _popUpHiddenEventHandler += value;
838 _popUpHiddenEventHandler -= value;
839 if (_popUpHiddenEventHandler == null && HiddenSignal().Empty() == false)
841 HiddenSignal().Disconnect(_popUpHiddenEventCallbackDelegate);
846 // Callback for HiddenSignal
847 private void OnHidden()
849 HiddenEventArgs e = new HiddenEventArgs();
851 if (_popUpHiddenEventHandler != null)
853 //here we send all data to user event handlers
854 _popUpHiddenEventHandler(this, e);
858 internal new class Property
860 internal static readonly int TITLE = NDalicPINVOKE.Popup_Property_TITLE_get();
861 internal static readonly int CONTENT = NDalicPINVOKE.Popup_Property_CONTENT_get();
862 internal static readonly int FOOTER = NDalicPINVOKE.Popup_Property_FOOTER_get();
863 internal static readonly int DISPLAY_STATE = NDalicPINVOKE.Popup_Property_DISPLAY_STATE_get();
864 internal static readonly int TOUCH_TRANSPARENT = NDalicPINVOKE.Popup_Property_TOUCH_TRANSPARENT_get();
865 internal static readonly int TAIL_VISIBILITY = NDalicPINVOKE.Popup_Property_TAIL_VISIBILITY_get();
866 internal static readonly int TAIL_POSITION = NDalicPINVOKE.Popup_Property_TAIL_POSITION_get();
867 internal static readonly int CONTEXTUAL_MODE = NDalicPINVOKE.Popup_Property_CONTEXTUAL_MODE_get();
868 internal static readonly int ANIMATION_DURATION = NDalicPINVOKE.Popup_Property_ANIMATION_DURATION_get();
869 internal static readonly int ANIMATION_MODE = NDalicPINVOKE.Popup_Property_ANIMATION_MODE_get();
870 internal static readonly int ENTRY_ANIMATION = NDalicPINVOKE.Popup_Property_ENTRY_ANIMATION_get();
871 internal static readonly int EXIT_ANIMATION = NDalicPINVOKE.Popup_Property_EXIT_ANIMATION_get();
872 internal static readonly int AUTO_HIDE_DELAY = NDalicPINVOKE.Popup_Property_AUTO_HIDE_DELAY_get();
873 internal static readonly int BACKING_ENABLED = NDalicPINVOKE.Popup_Property_BACKING_ENABLED_get();
874 internal static readonly int BACKING_COLOR = NDalicPINVOKE.Popup_Property_BACKING_COLOR_get();
875 internal static readonly int POPUP_BACKGROUND_IMAGE = NDalicPINVOKE.Popup_Property_POPUP_BACKGROUND_IMAGE_get();
876 internal static readonly int POPUP_BACKGROUND_BORDER = NDalicPINVOKE.Popup_Property_POPUP_BACKGROUND_BORDER_get();
877 internal static readonly int TAIL_UP_IMAGE = NDalicPINVOKE.Popup_Property_TAIL_UP_IMAGE_get();
878 internal static readonly int TAIL_DOWN_IMAGE = NDalicPINVOKE.Popup_Property_TAIL_DOWN_IMAGE_get();
879 internal static readonly int TAIL_LEFT_IMAGE = NDalicPINVOKE.Popup_Property_TAIL_LEFT_IMAGE_get();
880 internal static readonly int TAIL_RIGHT_IMAGE = NDalicPINVOKE.Popup_Property_TAIL_RIGHT_IMAGE_get();
884 /// Creates the popup.
886 /// <since_tizen> 3 </since_tizen>
887 public Popup() : this(NDalicPINVOKE.Popup_New(), true)
889 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
894 /// Sets the title for this popup.
896 /// <param name="titleView">The actor to set the title.</param>
897 /// <since_tizen> 3 </since_tizen>
898 public void SetTitle(View titleView)
900 NDalicPINVOKE.Popup_SetTitle(swigCPtr, View.getCPtr(titleView));
901 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
904 internal View GetTitle()
906 //to fix memory leak issue, match the handle count with native side.
907 IntPtr cPtr = NDalicPINVOKE.Popup_GetTitle(swigCPtr);
908 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
909 View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View;
910 NDalicPINVOKE.delete_BaseHandle(CPtr);
911 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
913 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
918 /// Sets the content actor.
920 /// <param name="content">The actor to use.</param>
921 /// <since_tizen> 3 </since_tizen>
922 public void SetContent(View content)
924 NDalicPINVOKE.Popup_SetContent(swigCPtr, View.getCPtr(content));
925 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
928 internal View GetContent()
930 //to fix memory leak issue, match the handle count with native side.
931 IntPtr cPtr = NDalicPINVOKE.Popup_GetContent(swigCPtr);
932 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
933 View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View;
934 NDalicPINVOKE.delete_BaseHandle(CPtr);
935 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
937 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
942 /// Sets the actor to use for the footer in this popup.
944 /// <param name="footer">The footer actor to be added to this popup.</param>
945 /// <since_tizen> 3 </since_tizen>
946 public void SetFooter(View footer)
948 NDalicPINVOKE.Popup_SetFooter(swigCPtr, View.getCPtr(footer));
949 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
952 internal View GetFooter()
954 //to fix memory leak issue, match the handle count with native side.
955 IntPtr cPtr = NDalicPINVOKE.Popup_GetFooter(swigCPtr);
956 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
957 View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View;
958 NDalicPINVOKE.delete_BaseHandle(CPtr);
959 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
961 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
966 /// Sets the display state of popup.<br />
967 /// There are 4 total display states.<br />
968 /// Only 2 can be set, but all four can be read for better inspection of the current popup state.<br />
970 /// The other two states are getable, but not setable, and are there for consistency.<br />
972 /// | Value | Setting the state | Getting the state |<br />
973 /// |----------|--------------------------------|--------------------------------|<br />
974 /// | SHOWN | Show the popup | The popup is fully shown |<br />
975 /// | HIDDEN | Hide the popup | The popup is fully hidden |<br />
976 /// | SHOWING | | The popup is transitioning in |<br />
977 /// | HIDING | | The popup is transitioning out |<br />
979 /// All 4 states changes cause notifications via 4 respective signals that can be connected to.<br />
981 /// <param name="displayState">The desired display state to change to.</param>
982 /// <since_tizen> 3 </since_tizen>
983 public void SetDisplayState(Popup.DisplayStateType displayState)
985 NDalicPINVOKE.Popup_SetDisplayState(swigCPtr, (int)displayState);
986 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
989 internal Popup.DisplayStateType GetDisplayState()
991 Popup.DisplayStateType ret = (Popup.DisplayStateType)NDalicPINVOKE.Popup_GetDisplayState(swigCPtr);
992 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
996 internal VoidSignal OutsideTouchedSignal()
998 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Popup_OutsideTouchedSignal(swigCPtr), false);
999 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1003 internal VoidSignal ShowingSignal()
1005 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Popup_ShowingSignal(swigCPtr), false);
1006 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1010 internal VoidSignal ShownSignal()
1012 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Popup_ShownSignal(swigCPtr), false);
1013 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1017 internal VoidSignal HidingSignal()
1019 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Popup_HidingSignal(swigCPtr), false);
1020 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1024 internal VoidSignal HiddenSignal()
1026 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Popup_HiddenSignal(swigCPtr), false);
1027 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1032 /// The display states of the popup.
1034 /// <since_tizen> 3 </since_tizen>
1035 public enum DisplayStateType
1038 /// The popup is transitioning in
1040 /// <since_tizen> 3 </since_tizen>
1043 /// The popup is fully shown
1045 /// <since_tizen> 3 </since_tizen>
1048 /// The popup is transitioning out
1050 /// <since_tizen> 3 </since_tizen>
1053 /// The popup is fully hidden
1055 /// <since_tizen> 3 </since_tizen>
1060 /// The animation modes within the popup.<br />
1061 /// Choose from a predefined mode or "CUSTOM" to use the ANIMATION_IN and ANIMATION_OUT properties.<br />
1063 /// <since_tizen> 3 </since_tizen>
1064 public enum AnimationModeType
1069 /// <since_tizen> 3 </since_tizen>
1072 /// Popup zooms in and out animating the scale property.
1074 /// <since_tizen> 3 </since_tizen>
1077 /// Popup fades in and out
1079 /// <since_tizen> 3 </since_tizen>
1082 /// Use the EntryAnimation and ExitAnimation animation properties.
1084 /// <since_tizen> 3 </since_tizen>
1089 /// The types of the contextual layout.<br />
1090 /// The popup is positioned adjacent to it's parent in the direction specified by this mode.<br />
1091 /// NON_CONTEXTUAL disables any contextual positioning.<br />
1093 /// <since_tizen> 3 </since_tizen>
1094 public enum ContextualModeType
1097 /// any contextual positioning
1099 /// <since_tizen> 3 </since_tizen>
1104 /// <since_tizen> 3 </since_tizen>
1109 /// <since_tizen> 3 </since_tizen>
1114 /// <since_tizen> 3 </since_tizen>
1119 /// <since_tizen> 3 </since_tizen>
1124 /// The popup title.
1126 /// <since_tizen> 3 </since_tizen>
1127 public PropertyMap Title
1131 return (PropertyMap)GetValue(TitleProperty);
1135 SetValue(TitleProperty, value);
1139 /// The popup content.
1141 /// <since_tizen> 3 </since_tizen>
1142 public PropertyMap Content
1146 return (PropertyMap)GetValue(ContentProperty);
1150 SetValue(ContentProperty, value);
1154 /// The popup footer.
1156 /// <since_tizen> 3 </since_tizen>
1157 public PropertyMap Footer
1161 return (PropertyMap)GetValue(FooterProperty);
1165 SetValue(FooterProperty, value);
1169 /// The popup display state.
1171 /// <since_tizen> 3 </since_tizen>
1172 public DisplayStateType DisplayState
1176 return (DisplayStateType)GetValue(DisplayStateProperty);
1180 SetValue(DisplayStateProperty, value);
1184 /// The touch transparent.
1186 /// <since_tizen> 3 </since_tizen>
1187 public bool TouchTransparent
1191 return (bool)GetValue(TouchTransparentProperty);
1195 SetValue(TouchTransparentProperty, value);
1199 /// The popup tail visibility.
1201 /// <since_tizen> 3 </since_tizen>
1202 public bool TailVisibility
1206 return (bool)GetValue(TailVisibilityProperty);
1210 SetValue(TailVisibilityProperty, value);
1214 /// The popup tail position.
1216 /// <since_tizen> 3 </since_tizen>
1217 public Vector3 TailPosition
1221 return (Vector3)GetValue(TailPositionProperty);
1225 SetValue(TailPositionProperty, value);
1229 /// The contextual mode.
1231 /// <since_tizen> 3 </since_tizen>
1232 public ContextualModeType ContextualMode
1236 return (ContextualModeType)GetValue(ContextualModeProperty);
1240 SetValue(ContextualModeProperty, value);
1244 /// The animation duration.
1246 /// <since_tizen> 3 </since_tizen>
1247 public float AnimationDuration
1251 return (float)GetValue(AnimationDurationProperty);
1255 SetValue(AnimationDurationProperty, value);
1259 /// The animation mode.
1261 /// <since_tizen> 3 </since_tizen>
1262 public AnimationModeType AnimationMode
1266 return (AnimationModeType)GetValue(AnimationModeProperty);
1270 SetValue(AnimationModeProperty, value);
1274 /// The entry animation.
1276 /// <since_tizen> 3 </since_tizen>
1277 public PropertyMap EntryAnimation
1281 return (PropertyMap)GetValue(EntryAnimationProperty);
1285 SetValue(EntryAnimationProperty, value);
1289 /// The exit animation.
1291 /// <since_tizen> 3 </since_tizen>
1292 public PropertyMap ExitAnimation
1296 return (PropertyMap)GetValue(ExitAnimationProperty);
1300 SetValue(ExitAnimationProperty, value);
1304 /// The auto hide delay.
1306 /// <since_tizen> 3 </since_tizen>
1307 public int AutoHideDelay
1311 return (int)GetValue(AutoHideDelayProperty);
1315 SetValue(AutoHideDelayProperty, value);
1319 /// The backing enabled.
1321 /// <since_tizen> 3 </since_tizen>
1322 public bool BackingEnabled
1326 return (bool)GetValue(BackingEnabledProperty);
1330 SetValue(BackingEnabledProperty, value);
1334 /// The backing color.
1336 /// <since_tizen> 3 </since_tizen>
1337 public Vector4 BackingColor
1341 return (Vector4)GetValue(BackingColorProperty);
1345 SetValue(BackingColorProperty, value);
1349 /// The background image.
1351 /// <since_tizen> 3 </since_tizen>
1352 public string PopupBackgroundImage
1356 return (string)GetValue(PopupBackgroundImageProperty);
1360 SetValue(PopupBackgroundImageProperty, value);
1364 /// The background border.
1366 /// <since_tizen> 3 </since_tizen>
1367 public Rectangle PopupBackgroundBorder
1371 return (Rectangle)GetValue(PopupBackgroundBorderProperty);
1375 SetValue(PopupBackgroundBorderProperty, value);
1379 /// The tail up image.
1381 /// <since_tizen> 3 </since_tizen>
1382 public string TailUpImage
1386 return (string)GetValue(TailUpImageProperty);
1390 SetValue(TailUpImageProperty, value);
1394 /// The tail down image.
1396 /// <since_tizen> 3 </since_tizen>
1397 public string TailDownImage
1401 return (string)GetValue(TailDownImageProperty);
1405 SetValue(TailDownImageProperty, value);
1409 /// The tail left image.
1411 /// <since_tizen> 3 </since_tizen>
1412 public string TailLeftImage
1416 return (string)GetValue(TailLeftImageProperty);
1420 SetValue(TailLeftImageProperty, value);
1424 /// The tail right image.
1426 /// <since_tizen> 3 </since_tizen>
1427 public string TailRightImage
1431 return (string)GetValue(TailRightImageProperty);
1435 SetValue(TailRightImageProperty, value);