[NUI] Add protect codes in Dispose()
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / UIComponents / Popup.cs
1 /*
2  * Copyright(c) 2017 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17 using System;
18 using System.ComponentModel;
19 using System.Runtime.InteropServices;
20 using Tizen.NUI.BaseComponents;
21
22 namespace Tizen.NUI.UIComponents
23 {
24     /// <summary>
25     /// The Popup widget provides a configurable popup dialog with a built-in layout of three main fields.
26     /// </summary>
27     /// <since_tizen> 3 </since_tizen>
28     public class Popup : View
29     {
30         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
31
32         internal Popup(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Popup_SWIGUpcast(cPtr), cMemoryOwn)
33         {
34             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
35         }
36
37         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Popup obj)
38         {
39             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
40         }
41
42         /// <summary>
43         /// Dispose.
44         /// </summary>
45         /// <param name="type">The dispose type</param>
46         /// <since_tizen> 3 </since_tizen>
47         protected override void Dispose(DisposeTypes type)
48         {
49             if (disposed)
50             {
51                 return;
52             }
53
54             if (type == DisposeTypes.Explicit)
55             {
56                 //Called by User
57                 //Release your own managed resources here.
58                 //You should release all of your own disposable objects here.
59
60             }
61
62             //Release your own unmanaged resources here.
63             //You should not access any managed member here except static instance.
64             //because the execution order of Finalizes is non-deterministic.
65             if (this != null)
66             {
67                 if (_popUpHiddenEventCallbackDelegate != null)
68                 {
69                     HiddenSignal().Disconnect(_popUpHiddenEventCallbackDelegate);
70                 }
71
72                 if (_popUpHidingEventCallbackDelegate != null)
73                 {
74                     HidingSignal().Disconnect(_popUpHidingEventCallbackDelegate);
75                 }
76             }
77
78             if (_popUpShownEventCallbackDelegate != null)
79             {
80                 ShownSignal().Disconnect(_popUpShownEventCallbackDelegate);
81             }
82
83             if (_popUpShowingEventCallbackDelegate != null)
84             {
85                 ShowingSignal().Disconnect(_popUpShowingEventCallbackDelegate);
86             }
87
88             if (_popUpOutsideTouchedEventCallbackDelegate != null)
89             {
90                 this.OutsideTouchedSignal().Disconnect(_popUpOutsideTouchedEventCallbackDelegate);
91             }
92
93             if (swigCPtr.Handle != global::System.IntPtr.Zero)
94             {
95                 if (swigCMemOwn)
96                 {
97                     swigCMemOwn = false;
98                     NDalicPINVOKE.delete_Popup(swigCPtr);
99                 }
100                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
101             }
102
103             base.Dispose(type);
104         }
105
106
107
108
109         /// <summary>
110         /// Event arguments that passed via the OutsideTouchedEvent.
111         /// </summary>
112         /// <since_tizen> 3 </since_tizen>
113         public class TouchedOutsideEventArgs : EventArgs
114         {
115         }
116
117         /// <summary>
118         /// Event arguments that passed via the ShowingEventArgs.
119         /// </summary>
120         /// <since_tizen> 3 </since_tizen>
121         public class ShowingEventArgs : EventArgs
122         {
123         }
124
125         /// <summary>
126         /// Event arguments that passed via the ShownEventArgs.
127         /// </summary>
128         /// <since_tizen> 3 </since_tizen>
129         public class ShownEventArgs : EventArgs
130         {
131         }
132
133         /// <summary>
134         /// Event arguments that passed via the HidingEventArgs.
135         /// </summary>
136         /// <since_tizen> 3 </since_tizen>
137         public class HidingEventArgs : EventArgs
138         {
139         }
140
141         /// <summary>
142         /// Event arguments that passed via the HiddenEventArgs.
143         /// </summary>
144         /// <since_tizen> 3 </since_tizen>
145         public class HiddenEventArgs : EventArgs
146         {
147         }
148
149         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
150         private delegate void OutsideTouchedEventCallbackDelegate();
151         private EventHandler<TouchedOutsideEventArgs> _popUpOutsideTouchedEventHandler;
152         private OutsideTouchedEventCallbackDelegate _popUpOutsideTouchedEventCallbackDelegate;
153
154         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
155         private delegate void ShowingEventCallbackDelegate();
156         private EventHandler<ShowingEventArgs> _popUpShowingEventHandler;
157         private ShowingEventCallbackDelegate _popUpShowingEventCallbackDelegate;
158
159         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
160         private delegate void ShownEventCallbackDelegate();
161         private EventHandler<ShownEventArgs> _popUpShownEventHandler;
162         private ShownEventCallbackDelegate _popUpShownEventCallbackDelegate;
163
164         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
165         private delegate void HidingEventCallbackDelegate();
166         private EventHandler<HidingEventArgs> _popUpHidingEventHandler;
167         private HidingEventCallbackDelegate _popUpHidingEventCallbackDelegate;
168
169         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
170         private delegate void HiddenEventCallbackDelegate();
171         private EventHandler<HiddenEventArgs> _popUpHiddenEventHandler;
172         private HiddenEventCallbackDelegate _popUpHiddenEventCallbackDelegate;
173
174         /// <summary>
175         /// An event is sent when the user has touched outside the dialog.
176         /// </summary>
177         /// <since_tizen> 3 </since_tizen>
178         public event EventHandler<TouchedOutsideEventArgs> TouchedOutside
179         {
180             add
181             {
182                 if (_popUpOutsideTouchedEventHandler == null)
183                 {
184                     _popUpOutsideTouchedEventCallbackDelegate = (OnOutsideTouched);
185                     OutsideTouchedSignal().Connect(_popUpOutsideTouchedEventCallbackDelegate);
186                 }
187                 _popUpOutsideTouchedEventHandler += value;
188             }
189             remove
190             {
191                 _popUpOutsideTouchedEventHandler -= value;
192                 if (_popUpOutsideTouchedEventHandler == null && OutsideTouchedSignal().Empty() == false)
193                 {
194                     this.OutsideTouchedSignal().Disconnect(_popUpOutsideTouchedEventCallbackDelegate);
195                 }
196             }
197         }
198
199         // Callback for Popup OutsideTouchedSignal
200         private void OnOutsideTouched()
201         {
202             TouchedOutsideEventArgs e = new TouchedOutsideEventArgs();
203
204             if (_popUpOutsideTouchedEventHandler != null)
205             {
206                 //here we send all data to user event handlers
207                 _popUpOutsideTouchedEventHandler(this, e);
208             }
209         }
210
211         /// <summary>
212         /// An event is sent when the popup starts showing.
213         /// </summary>
214         /// <since_tizen> 3 </since_tizen>
215         public event EventHandler<ShowingEventArgs> Showing
216         {
217             add
218             {
219                 if (_popUpShowingEventHandler == null)
220                 {
221                     _popUpShowingEventCallbackDelegate = (OnShowing);
222                     ShowingSignal().Connect(_popUpShowingEventCallbackDelegate);
223                 }
224                 _popUpShowingEventHandler += value;
225             }
226             remove
227             {
228                 _popUpShowingEventHandler -= value;
229                 if (_popUpShowingEventHandler == null && ShowingSignal().Empty() == false)
230                 {
231                     ShowingSignal().Disconnect(_popUpShowingEventCallbackDelegate);
232                 }
233             }
234         }
235
236         // Callback for ShowingSignal
237         private void OnShowing()
238         {
239             ShowingEventArgs e = new ShowingEventArgs();
240
241             if (_popUpShowingEventHandler != null)
242             {
243                 //here we send all data to user event handlers
244                 _popUpShowingEventHandler(this, e);
245             }
246         }
247
248
249         /// <summary>
250         /// An event is sent when the popup has been fully displayed.
251         /// </summary>
252         /// <since_tizen> 3 </since_tizen>
253         public event EventHandler<ShownEventArgs> Shown
254         {
255             add
256             {
257                 if (_popUpShownEventHandler == null)
258                 {
259                     _popUpShownEventCallbackDelegate = (OnShown);
260                     ShownSignal().Connect(_popUpShownEventCallbackDelegate);
261                 }
262                 _popUpShownEventHandler += value;
263             }
264             remove
265             {
266                 _popUpShownEventHandler -= value;
267                 if (_popUpShownEventHandler == null && ShownSignal().Empty() == false)
268                 {
269                     ShownSignal().Disconnect(_popUpShownEventCallbackDelegate);
270                 }
271             }
272         }
273
274         // Callback for ShownSignal
275         private void OnShown()
276         {
277             ShownEventArgs e = new ShownEventArgs();
278
279             if (_popUpShownEventHandler != null)
280             {
281                 //here we send all data to user event handlers
282                 _popUpShownEventHandler(this, e);
283             }
284         }
285
286         /// <summary>
287         /// An event is sent when the popup starts to hide.
288         /// </summary>
289         /// <since_tizen> 3 </since_tizen>
290         public event EventHandler<HidingEventArgs> Hiding
291         {
292             add
293             {
294                 if (_popUpHidingEventHandler == null)
295                 {
296                     _popUpHidingEventCallbackDelegate = (OnHiding);
297                     HidingSignal().Connect(_popUpHidingEventCallbackDelegate);
298                 }
299                 _popUpHidingEventHandler += value;
300             }
301             remove
302             {
303                 _popUpHidingEventHandler -= value;
304                 if (_popUpHidingEventHandler == null && HidingSignal().Empty() == false)
305                 {
306                     HidingSignal().Disconnect(_popUpHidingEventCallbackDelegate);
307                 }
308             }
309         }
310
311         // Callback for HidingSignal
312         private void OnHiding()
313         {
314             HidingEventArgs e = new HidingEventArgs();
315
316             if (_popUpHidingEventHandler != null)
317             {
318                 //here we send all data to user event handlers
319                 _popUpHidingEventHandler(this, e);
320             }
321         }
322
323         /// <summary>
324         /// An event is sent when the popup has been completely hidden.
325         /// </summary>
326         /// <since_tizen> 3 </since_tizen>
327         public event EventHandler<HiddenEventArgs> Hidden
328         {
329             add
330             {
331                 if (_popUpHiddenEventHandler == null)
332                 {
333                     _popUpHiddenEventCallbackDelegate = (OnHidden);
334                     HiddenSignal().Connect(_popUpHiddenEventCallbackDelegate);
335                 }
336                 _popUpHiddenEventHandler += value;
337             }
338             remove
339             {
340                 _popUpHiddenEventHandler -= value;
341                 if (_popUpHiddenEventHandler == null && HiddenSignal().Empty() == false)
342                 {
343                     HiddenSignal().Disconnect(_popUpHiddenEventCallbackDelegate);
344                 }
345             }
346         }
347
348         // Callback for HiddenSignal
349         private void OnHidden()
350         {
351             HiddenEventArgs e = new HiddenEventArgs();
352
353             if (_popUpHiddenEventHandler != null)
354             {
355                 //here we send all data to user event handlers
356                 _popUpHiddenEventHandler(this, e);
357             }
358         }
359
360         internal new class Property
361         {
362             internal static readonly int TITLE = NDalicPINVOKE.Popup_Property_TITLE_get();
363             internal static readonly int CONTENT = NDalicPINVOKE.Popup_Property_CONTENT_get();
364             internal static readonly int FOOTER = NDalicPINVOKE.Popup_Property_FOOTER_get();
365             internal static readonly int DISPLAY_STATE = NDalicPINVOKE.Popup_Property_DISPLAY_STATE_get();
366             internal static readonly int TOUCH_TRANSPARENT = NDalicPINVOKE.Popup_Property_TOUCH_TRANSPARENT_get();
367             internal static readonly int TAIL_VISIBILITY = NDalicPINVOKE.Popup_Property_TAIL_VISIBILITY_get();
368             internal static readonly int TAIL_POSITION = NDalicPINVOKE.Popup_Property_TAIL_POSITION_get();
369             internal static readonly int CONTEXTUAL_MODE = NDalicPINVOKE.Popup_Property_CONTEXTUAL_MODE_get();
370             internal static readonly int ANIMATION_DURATION = NDalicPINVOKE.Popup_Property_ANIMATION_DURATION_get();
371             internal static readonly int ANIMATION_MODE = NDalicPINVOKE.Popup_Property_ANIMATION_MODE_get();
372             internal static readonly int ENTRY_ANIMATION = NDalicPINVOKE.Popup_Property_ENTRY_ANIMATION_get();
373             internal static readonly int EXIT_ANIMATION = NDalicPINVOKE.Popup_Property_EXIT_ANIMATION_get();
374             internal static readonly int AUTO_HIDE_DELAY = NDalicPINVOKE.Popup_Property_AUTO_HIDE_DELAY_get();
375             internal static readonly int BACKING_ENABLED = NDalicPINVOKE.Popup_Property_BACKING_ENABLED_get();
376             internal static readonly int BACKING_COLOR = NDalicPINVOKE.Popup_Property_BACKING_COLOR_get();
377             internal static readonly int POPUP_BACKGROUND_IMAGE = NDalicPINVOKE.Popup_Property_POPUP_BACKGROUND_IMAGE_get();
378             internal static readonly int POPUP_BACKGROUND_BORDER = NDalicPINVOKE.Popup_Property_POPUP_BACKGROUND_BORDER_get();
379             internal static readonly int TAIL_UP_IMAGE = NDalicPINVOKE.Popup_Property_TAIL_UP_IMAGE_get();
380             internal static readonly int TAIL_DOWN_IMAGE = NDalicPINVOKE.Popup_Property_TAIL_DOWN_IMAGE_get();
381             internal static readonly int TAIL_LEFT_IMAGE = NDalicPINVOKE.Popup_Property_TAIL_LEFT_IMAGE_get();
382             internal static readonly int TAIL_RIGHT_IMAGE = NDalicPINVOKE.Popup_Property_TAIL_RIGHT_IMAGE_get();
383         }
384
385         /// <summary>
386         /// Creates the popup.
387         /// </summary>
388         /// <since_tizen> 3 </since_tizen>
389         public Popup() : this(NDalicPINVOKE.Popup_New(), true)
390         {
391             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
392
393         }
394
395         /// <summary>
396         /// Sets the title for this popup.
397         /// </summary>
398         /// <param name="titleView">The actor to set the title.</param>
399         /// <since_tizen> 3 </since_tizen>
400         public void SetTitle(View titleView)
401         {
402             NDalicPINVOKE.Popup_SetTitle(swigCPtr, View.getCPtr(titleView));
403             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
404         }
405
406         internal View GetTitle()
407         {
408             IntPtr cPtr = NDalicPINVOKE.Popup_GetTitle(swigCPtr);
409             View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
410
411             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
412             return ret;
413         }
414
415         /// <summary>
416         /// Sets the content actor.
417         /// </summary>
418         /// <param name="content">The actor to use.</param>
419         /// <since_tizen> 3 </since_tizen>
420         public void SetContent(View content)
421         {
422             NDalicPINVOKE.Popup_SetContent(swigCPtr, View.getCPtr(content));
423             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
424         }
425
426         internal View GetContent()
427         {
428             IntPtr cPtr = NDalicPINVOKE.Popup_GetContent(swigCPtr);
429             View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
430
431             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
432             return ret;
433         }
434
435         /// <summary>
436         /// Sets the actor to use for the footer in this popup.
437         /// </summary>
438         /// <param name="footer">The footer actor to be added to this popup.</param>
439         /// <since_tizen> 3 </since_tizen>
440         public void SetFooter(View footer)
441         {
442             NDalicPINVOKE.Popup_SetFooter(swigCPtr, View.getCPtr(footer));
443             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
444         }
445
446         internal View GetFooter()
447         {
448             IntPtr cPtr = NDalicPINVOKE.Popup_GetFooter(swigCPtr);
449             View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
450
451             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
452             return ret;
453         }
454
455         /// <summary>
456         /// Sets the display state of popup.<br />
457         /// There are 4 total display states.<br />
458         /// Only 2 can be set, but all four can be read for better inspection of the current popup state.<br />
459         /// <br />
460         /// The other two states are getable, but not setable, and are there for consistency.<br />
461         /// <br />
462         /// | Value    | Setting the state              | Getting the state              |<br />
463         /// |----------|--------------------------------|--------------------------------|<br />
464         /// | SHOWN    | Show the popup                 | The popup is fully shown       |<br />
465         /// | HIDDEN   | Hide the popup                 | The popup is fully hidden      |<br />
466         /// | SHOWING  |                                | The popup is transitioning in  |<br />
467         /// | HIDING   |                                | The popup is transitioning out |<br />
468         /// <br />
469         /// All 4 states changes cause notifications via 4 respective signals that can be connected to.<br />
470         /// </summary>
471         /// <param name="displayState">The desired display state to change to.</param>
472         /// <since_tizen> 3 </since_tizen>
473         public void SetDisplayState(Popup.DisplayStateType displayState)
474         {
475             NDalicPINVOKE.Popup_SetDisplayState(swigCPtr, (int)displayState);
476             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
477         }
478
479         internal Popup.DisplayStateType GetDisplayState()
480         {
481             Popup.DisplayStateType ret = (Popup.DisplayStateType)NDalicPINVOKE.Popup_GetDisplayState(swigCPtr);
482             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
483             return ret;
484         }
485
486         internal VoidSignal OutsideTouchedSignal()
487         {
488             VoidSignal ret = new VoidSignal(NDalicPINVOKE.Popup_OutsideTouchedSignal(swigCPtr), false);
489             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
490             return ret;
491         }
492
493         internal VoidSignal ShowingSignal()
494         {
495             VoidSignal ret = new VoidSignal(NDalicPINVOKE.Popup_ShowingSignal(swigCPtr), false);
496             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
497             return ret;
498         }
499
500         internal VoidSignal ShownSignal()
501         {
502             VoidSignal ret = new VoidSignal(NDalicPINVOKE.Popup_ShownSignal(swigCPtr), false);
503             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
504             return ret;
505         }
506
507         internal VoidSignal HidingSignal()
508         {
509             VoidSignal ret = new VoidSignal(NDalicPINVOKE.Popup_HidingSignal(swigCPtr), false);
510             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
511             return ret;
512         }
513
514         internal VoidSignal HiddenSignal()
515         {
516             VoidSignal ret = new VoidSignal(NDalicPINVOKE.Popup_HiddenSignal(swigCPtr), false);
517             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
518             return ret;
519         }
520
521         /// <summary>
522         /// The display states of the popup.
523         /// </summary>
524         /// <since_tizen> 3 </since_tizen>
525         public enum DisplayStateType
526         {
527             /// <summary>
528             /// The popup is transitioning in
529             /// </summary>
530             /// <since_tizen> 3 </since_tizen>
531             Showing,
532             /// <summary>
533             /// The popup is fully shown
534             /// </summary>
535             /// <since_tizen> 3 </since_tizen>
536             Shown,
537             /// <summary>
538             /// The popup is transitioning out
539             /// </summary>
540             /// <since_tizen> 3 </since_tizen>
541             Hiding,
542             /// <summary>
543             /// The popup is fully hidden
544             /// </summary>
545             /// <since_tizen> 3 </since_tizen>
546             Hidden
547         }
548
549         /// <summary>
550         /// The animation modes within the popup.<br />
551         /// Choose from a predefined mode or "CUSTOM" to use the ANIMATION_IN and ANIMATION_OUT properties.<br />
552         /// </summary>
553         /// <since_tizen> 3 </since_tizen>
554         public enum AnimationModeType
555         {
556             /// <summary>
557             /// No animation.
558             /// </summary>
559             /// <since_tizen> 3 </since_tizen>
560             None,
561             /// <summary>
562             /// Popup zooms in and out animating the scale property.
563             /// </summary>
564             /// <since_tizen> 3 </since_tizen>
565             Zoom,
566             /// <summary>
567             /// Popup fades in and out
568             /// </summary>
569             /// <since_tizen> 3 </since_tizen>
570             Fade,
571             /// <summary>
572             /// Use the EntryAnimation and ExitAnimation animation properties.
573             /// </summary>
574             /// <since_tizen> 3 </since_tizen>
575             Custom
576         }
577
578         /// <summary>
579         /// The types of the contextual layout.<br />
580         /// The popup is positioned adjacent to it's parent in the direction specified by this mode.<br />
581         /// NON_CONTEXTUAL disables any contextual positioning.<br />
582         /// </summary>
583         /// <since_tizen> 3 </since_tizen>
584         public enum ContextualModeType
585         {
586             /// <summary>
587             /// any contextual positioning
588             /// </summary>
589             /// <since_tizen> 3 </since_tizen>
590             NonContextual,
591             /// <summary>
592             /// Above
593             /// </summary>
594             /// <since_tizen> 3 </since_tizen>
595             Above,
596             /// <summary>
597             /// Rright
598             /// </summary>
599             /// <since_tizen> 3 </since_tizen>
600             Rright,
601             /// <summary>
602             /// Below
603             /// </summary>
604             /// <since_tizen> 3 </since_tizen>
605             Below,
606             /// <summary>
607             /// Left
608             /// </summary>
609             /// <since_tizen> 3 </since_tizen>
610             Left
611         }
612
613         /// <summary>
614         /// The popup title.
615         /// </summary>
616         /// <since_tizen> 3 </since_tizen>
617         public PropertyMap Title
618         {
619             get
620             {
621                 PropertyMap temp = new PropertyMap();
622                 GetProperty(Popup.Property.TITLE).Get(temp);
623                 return temp;
624             }
625             set
626             {
627                 SetProperty(Popup.Property.TITLE, new Tizen.NUI.PropertyValue(value));
628             }
629         }
630         /// <summary>
631         /// The popup content.
632         /// </summary>
633         /// <since_tizen> 3 </since_tizen>
634         public PropertyMap Content
635         {
636             get
637             {
638                 PropertyMap temp = new PropertyMap();
639                 GetProperty(Popup.Property.CONTENT).Get(temp);
640                 return temp;
641             }
642             set
643             {
644                 SetProperty(Popup.Property.CONTENT, new Tizen.NUI.PropertyValue(value));
645             }
646         }
647         /// <summary>
648         /// The popup footer.
649         /// </summary>
650         /// <since_tizen> 3 </since_tizen>
651         public PropertyMap Footer
652         {
653             get
654             {
655                 PropertyMap temp = new PropertyMap();
656                 GetProperty(Popup.Property.FOOTER).Get(temp);
657                 return temp;
658             }
659             set
660             {
661                 SetProperty(Popup.Property.FOOTER, new Tizen.NUI.PropertyValue(value));
662             }
663         }
664         /// <summary>
665         /// The popup display state.
666         /// </summary>
667         /// <since_tizen> 3 </since_tizen>
668         public DisplayStateType DisplayState
669         {
670             get
671             {
672                 string temp;
673                 if (GetProperty(Popup.Property.DISPLAY_STATE).Get(out temp) == false)
674                 {
675                     NUILog.Error("DisplayState get error!");
676                 }
677                 switch (temp)
678                 {
679                     case "SHOWING":
680                         return DisplayStateType.Showing;
681                     case "SHOWN":
682                         return DisplayStateType.Shown;
683                     case "HIDING":
684                         return DisplayStateType.Hiding;
685                     case "HIDDEN":
686                         return DisplayStateType.Hidden;
687                     default:
688                         return DisplayStateType.Hidden;
689                 }
690             }
691             set
692             {
693                 string valueToString = "";
694                 switch (value)
695                 {
696                     case DisplayStateType.Showing:
697                         {
698                             valueToString = "SHOWING";
699                             break;
700                         }
701                     case DisplayStateType.Shown:
702                         {
703                             valueToString = "SHOWN";
704                             break;
705                         }
706                     case DisplayStateType.Hiding:
707                         {
708                             valueToString = "HIDING";
709                             break;
710                         }
711                     case DisplayStateType.Hidden:
712                         {
713                             valueToString = "HIDDEN";
714                             break;
715                         }
716                     default:
717                         {
718                             valueToString = "HIDDEN";
719                             break;
720                         }
721                 }
722                 SetProperty(Popup.Property.DISPLAY_STATE, new Tizen.NUI.PropertyValue(valueToString));
723             }
724         }
725         /// <summary>
726         /// The touch transparent.
727         /// </summary>
728         /// <since_tizen> 3 </since_tizen>
729         public bool TouchTransparent
730         {
731             get
732             {
733                 bool temp = false;
734                 GetProperty(Popup.Property.TOUCH_TRANSPARENT).Get(out temp);
735                 return temp;
736             }
737             set
738             {
739                 SetProperty(Popup.Property.TOUCH_TRANSPARENT, new Tizen.NUI.PropertyValue(value));
740             }
741         }
742         /// <summary>
743         /// The popup tail visibility.
744         /// </summary>
745         /// <since_tizen> 3 </since_tizen>
746         public bool TailVisibility
747         {
748             get
749             {
750                 bool temp = false;
751                 GetProperty(Popup.Property.TAIL_VISIBILITY).Get(out temp);
752                 return temp;
753             }
754             set
755             {
756                 SetProperty(Popup.Property.TAIL_VISIBILITY, new Tizen.NUI.PropertyValue(value));
757             }
758         }
759         /// <summary>
760         /// The popup tail position.
761         /// </summary>
762         /// <since_tizen> 3 </since_tizen>
763         public Vector3 TailPosition
764         {
765             get
766             {
767                 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
768                 GetProperty(Popup.Property.TAIL_POSITION).Get(temp);
769                 return temp;
770             }
771             set
772             {
773                 SetProperty(Popup.Property.TAIL_POSITION, new Tizen.NUI.PropertyValue(value));
774             }
775         }
776         /// <summary>
777         /// The contextual mode.
778         /// </summary>
779         /// <since_tizen> 3 </since_tizen>
780         public ContextualModeType ContextualMode
781         {
782             get
783             {
784                 string temp;
785                 if (GetProperty(Popup.Property.CONTEXTUAL_MODE).Get(out temp) == false)
786                 {
787                     NUILog.Error("ContextualMode get error!");
788                 }
789                 switch (temp)
790                 {
791                     case "NON_CONTEXTUAL":
792                         return ContextualModeType.NonContextual;
793                     case "ABOVE":
794                         return ContextualModeType.Above;
795                     case "RIGHT":
796                         return ContextualModeType.Rright;
797                     case "BELOW":
798                         return ContextualModeType.Below;
799                     case "LEFT":
800                         return ContextualModeType.Left;
801                     default:
802                         return ContextualModeType.Below;
803                 }
804             }
805             set
806             {
807                 string valueToString = "";
808                 switch (value)
809                 {
810                     case ContextualModeType.NonContextual:
811                         {
812                             valueToString = "NON_CONTEXTUAL";
813                             break;
814                         }
815                     case ContextualModeType.Above:
816                         {
817                             valueToString = "ABOVE";
818                             break;
819                         }
820                     case ContextualModeType.Rright:
821                         {
822                             valueToString = "RIGHT";
823                             break;
824                         }
825                     case ContextualModeType.Below:
826                         {
827                             valueToString = "BELOW";
828                             break;
829                         }
830                     case ContextualModeType.Left:
831                         {
832                             valueToString = "LEFT";
833                             break;
834                         }
835                     default:
836                         {
837                             valueToString = "BELOW";
838                             break;
839                         }
840                 }
841                 SetProperty(Popup.Property.CONTEXTUAL_MODE, new Tizen.NUI.PropertyValue(valueToString));
842             }
843         }
844         /// <summary>
845         /// The animation duration.
846         /// </summary>
847         /// <since_tizen> 3 </since_tizen>
848         public float AnimationDuration
849         {
850             get
851             {
852                 float temp = 0.0f;
853                 GetProperty(Popup.Property.ANIMATION_DURATION).Get(out temp);
854                 return temp;
855             }
856             set
857             {
858                 SetProperty(Popup.Property.ANIMATION_DURATION, new Tizen.NUI.PropertyValue(value));
859             }
860         }
861         /// <summary>
862         /// The animation mode.
863         /// </summary>
864         /// <since_tizen> 3 </since_tizen>
865         public AnimationModeType AnimationMode
866         {
867             get
868             {
869                 string temp;
870                 if (GetProperty(Popup.Property.ANIMATION_MODE).Get(out temp) == false)
871                 {
872                     NUILog.Error("AnimationMode get error!");
873                 }
874                 switch (temp)
875                 {
876                     case "NONE":
877                         return AnimationModeType.None;
878                     case "ZOOM":
879                         return AnimationModeType.Zoom;
880                     case "FADE":
881                         return AnimationModeType.Fade;
882                     case "CUSTOM":
883                         return AnimationModeType.Custom;
884                     default:
885                         return AnimationModeType.Fade;
886                 }
887             }
888             set
889             {
890                 string valueToString = "";
891                 switch (value)
892                 {
893                     case AnimationModeType.None:
894                         {
895                             valueToString = "NONE";
896                             break;
897                         }
898                     case AnimationModeType.Zoom:
899                         {
900                             valueToString = "ZOOM";
901                             break;
902                         }
903                     case AnimationModeType.Fade:
904                         {
905                             valueToString = "FADE";
906                             break;
907                         }
908                     case AnimationModeType.Custom:
909                         {
910                             valueToString = "CUSTOM";
911                             break;
912                         }
913                     default:
914                         {
915                             valueToString = "FADE";
916                             break;
917                         }
918                 }
919                 SetProperty(Popup.Property.ANIMATION_MODE, new Tizen.NUI.PropertyValue(valueToString));
920             }
921         }
922         /// <summary>
923         /// The entry animation.
924         /// </summary>
925         /// <since_tizen> 3 </since_tizen>
926         public PropertyMap EntryAnimation
927         {
928             get
929             {
930                 PropertyMap temp = new PropertyMap();
931                 GetProperty(Popup.Property.ENTRY_ANIMATION).Get(temp);
932                 return temp;
933             }
934             set
935             {
936                 SetProperty(Popup.Property.ENTRY_ANIMATION, new Tizen.NUI.PropertyValue(value));
937             }
938         }
939         /// <summary>
940         /// The exit animation.
941         /// </summary>
942         /// <since_tizen> 3 </since_tizen>
943         public PropertyMap ExitAnimation
944         {
945             get
946             {
947                 PropertyMap temp = new PropertyMap();
948                 GetProperty(Popup.Property.EXIT_ANIMATION).Get(temp);
949                 return temp;
950             }
951             set
952             {
953                 SetProperty(Popup.Property.EXIT_ANIMATION, new Tizen.NUI.PropertyValue(value));
954             }
955         }
956         /// <summary>
957         /// The auto hide delay.
958         /// </summary>
959         /// <since_tizen> 3 </since_tizen>
960         public int AutoHideDelay
961         {
962             get
963             {
964                 int temp = 0;
965                 GetProperty(Popup.Property.AUTO_HIDE_DELAY).Get(out temp);
966                 return temp;
967             }
968             set
969             {
970                 SetProperty(Popup.Property.AUTO_HIDE_DELAY, new Tizen.NUI.PropertyValue(value));
971             }
972         }
973         /// <summary>
974         /// The backing enabled.
975         /// </summary>
976         /// <since_tizen> 3 </since_tizen>
977         public bool BackingEnabled
978         {
979             get
980             {
981                 bool temp = false;
982                 GetProperty(Popup.Property.BACKING_ENABLED).Get(out temp);
983                 return temp;
984             }
985             set
986             {
987                 SetProperty(Popup.Property.BACKING_ENABLED, new Tizen.NUI.PropertyValue(value));
988             }
989         }
990         /// <summary>
991         /// The backing color.
992         /// </summary>
993         /// <since_tizen> 3 </since_tizen>
994         public Vector4 BackingColor
995         {
996             get
997             {
998                 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
999                 GetProperty(Popup.Property.BACKING_COLOR).Get(temp);
1000                 return temp;
1001             }
1002             set
1003             {
1004                 SetProperty(Popup.Property.BACKING_COLOR, new Tizen.NUI.PropertyValue(value));
1005             }
1006         }
1007         /// <summary>
1008         /// The background image.
1009         /// </summary>
1010         /// <since_tizen> 3 </since_tizen>
1011         public string PopupBackgroundImage
1012         {
1013             get
1014             {
1015                 string temp;
1016                 GetProperty(Popup.Property.POPUP_BACKGROUND_IMAGE).Get(out temp);
1017                 return temp;
1018             }
1019             set
1020             {
1021                 SetProperty(Popup.Property.POPUP_BACKGROUND_IMAGE, new Tizen.NUI.PropertyValue(value));
1022             }
1023         }
1024         /// <summary>
1025         /// The background border.
1026         /// </summary>
1027         /// <since_tizen> 3 </since_tizen>
1028         public Rectangle PopupBackgroundBorder
1029         {
1030             get
1031             {
1032                 Rectangle temp = new Rectangle(0, 0, 0, 0);
1033                 GetProperty(Popup.Property.POPUP_BACKGROUND_BORDER).Get(temp);
1034                 return temp;
1035             }
1036             set
1037             {
1038                 SetProperty(Popup.Property.POPUP_BACKGROUND_BORDER, new Tizen.NUI.PropertyValue(value));
1039             }
1040         }
1041         /// <summary>
1042         /// The tail up image.
1043         /// </summary>
1044         /// <since_tizen> 3 </since_tizen>
1045         public string TailUpImage
1046         {
1047             get
1048             {
1049                 string temp;
1050                 GetProperty(Popup.Property.TAIL_UP_IMAGE).Get(out temp);
1051                 return temp;
1052             }
1053             set
1054             {
1055                 SetProperty(Popup.Property.TAIL_UP_IMAGE, new Tizen.NUI.PropertyValue(value));
1056             }
1057         }
1058         /// <summary>
1059         /// The tail down image.
1060         /// </summary>
1061         /// <since_tizen> 3 </since_tizen>
1062         public string TailDownImage
1063         {
1064             get
1065             {
1066                 string temp;
1067                 GetProperty(Popup.Property.TAIL_DOWN_IMAGE).Get(out temp);
1068                 return temp;
1069             }
1070             set
1071             {
1072                 SetProperty(Popup.Property.TAIL_DOWN_IMAGE, new Tizen.NUI.PropertyValue(value));
1073             }
1074         }
1075         /// <summary>
1076         /// The tail left image.
1077         /// </summary>
1078         /// <since_tizen> 3 </since_tizen>
1079         public string TailLeftImage
1080         {
1081             get
1082             {
1083                 string temp;
1084                 GetProperty(Popup.Property.TAIL_LEFT_IMAGE).Get(out temp);
1085                 return temp;
1086             }
1087             set
1088             {
1089                 SetProperty(Popup.Property.TAIL_LEFT_IMAGE, new Tizen.NUI.PropertyValue(value));
1090             }
1091         }
1092         /// <summary>
1093         /// The tail right image.
1094         /// </summary>
1095         /// <since_tizen> 3 </since_tizen>
1096         public string TailRightImage
1097         {
1098             get
1099             {
1100                 string temp;
1101                 GetProperty(Popup.Property.TAIL_RIGHT_IMAGE).Get(out temp);
1102                 return temp;
1103             }
1104             set
1105             {
1106                 SetProperty(Popup.Property.TAIL_RIGHT_IMAGE, new Tizen.NUI.PropertyValue(value));
1107             }
1108         }
1109
1110     }
1111
1112 }