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