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