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