[NUI] Clean NUI codes from Adaptor.cs to Window.cs (#652)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / VideoView.cs
index 544a5a9..c881947 100755 (executable)
@@ -37,7 +37,7 @@ namespace Tizen.NUI.BaseComponents
                 Tizen.NUI.Object.SetProperty(videoView.swigCPtr, VideoView.Property.VIDEO, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
             }
         },
-        defaultValueCreator:(bindable) =>
+        defaultValueCreator: (bindable) =>
         {
             var videoView = (VideoView)bindable;
             PropertyMap temp = new PropertyMap();
@@ -54,7 +54,7 @@ namespace Tizen.NUI.BaseComponents
                 Tizen.NUI.Object.SetProperty(videoView.swigCPtr, VideoView.Property.LOOPING, new Tizen.NUI.PropertyValue((bool)newValue));
             }
         },
-        defaultValueCreator:(bindable) =>
+        defaultValueCreator: (bindable) =>
         {
             var videoView = (VideoView)bindable;
             bool temp = false;
@@ -71,7 +71,7 @@ namespace Tizen.NUI.BaseComponents
                 Tizen.NUI.Object.SetProperty(videoView.swigCPtr, VideoView.Property.MUTED, new Tizen.NUI.PropertyValue((bool)newValue));
             }
         },
-        defaultValueCreator:(bindable) =>
+        defaultValueCreator: (bindable) =>
         {
             var videoView = (VideoView)bindable;
             bool temp = false;
@@ -88,7 +88,7 @@ namespace Tizen.NUI.BaseComponents
                 Tizen.NUI.Object.SetProperty(videoView.swigCPtr, VideoView.Property.VOLUME, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
             }
         },
-        defaultValueCreator:(bindable) =>
+        defaultValueCreator: (bindable) =>
         {
             var videoView = (VideoView)bindable;
             PropertyMap temp = new PropertyMap();
@@ -105,7 +105,7 @@ namespace Tizen.NUI.BaseComponents
                 Tizen.NUI.Object.SetProperty(videoView.swigCPtr, VideoView.Property.UNDERLAY, new Tizen.NUI.PropertyValue((bool)newValue));
             }
         },
-        defaultValueCreator:(bindable) =>
+        defaultValueCreator: (bindable) =>
         {
             var videoView = (VideoView)bindable;
             bool temp = false;
@@ -122,7 +122,7 @@ namespace Tizen.NUI.BaseComponents
                 Tizen.NUI.Object.SetProperty(videoView.swigCPtr, VideoView.Property.VIDEO, new Tizen.NUI.PropertyValue((string)newValue));
             }
         },
-        defaultValueCreator:(bindable) =>
+        defaultValueCreator: (bindable) =>
         {
             var videoView = (VideoView)bindable;
             string temp;
@@ -131,89 +131,41 @@ namespace Tizen.NUI.BaseComponents
         });
 
         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
-
-        internal VideoView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.VideoView_SWIGUpcast(cPtr), cMemoryOwn)
-        {
-            swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
-        }
-
-        internal static global::System.Runtime.InteropServices.HandleRef getCPtr(VideoView obj)
-        {
-            return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
-        }
+        private FinishedCallbackDelegate _videoViewFinishedCallbackDelegate;
+        private EventHandler<FinishedEventArgs> _videoViewFinishedEventHandler;
 
         /// <summary>
-        /// Dispose.
+        /// Creates an initialized VideoView.
         /// </summary>
-        /// <param name="type">DisposeTypes</param>
         /// <since_tizen> 3 </since_tizen>
-        protected override void Dispose(DisposeTypes type)
+        public VideoView() : this(NDalicPINVOKE.VideoView_New__SWIG_0(), true)
         {
-            if(disposed)
-            {
-                return;
-            }
-
-            if(type == DisposeTypes.Explicit)
-            {
-                //Called by User
-                //Release your own managed resources here.
-                //You should release all of your own disposable objects here.
-            }
-
-            //Release your own unmanaged resources here.
-            //You should not access any managed member here except static instance.
-            //because the execution order of Finalizes is non-deterministic.
-
-            if (this != null && _videoViewFinishedCallbackDelegate != null)
-            {
-                FinishedSignal().Disconnect(_videoViewFinishedCallbackDelegate);
-            }
-
-            if (swigCPtr.Handle != global::System.IntPtr.Zero)
-            {
-                if (swigCMemOwn)
-                {
-                    swigCMemOwn = false;
-                    NDalicPINVOKE.delete_VideoView(swigCPtr);
-                }
-                swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-            }
-
-            base.Dispose(type);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
         /// <summary>
-        /// Event arguments that passed via the finished signal.
+        /// Creates an initialized VideoView.<br />
+        /// If the string is empty, VideoView will not display anything.<br />
         /// </summary>
+        /// <param name="url">The URL of the video resource to display.</param>
         /// <since_tizen> 3 </since_tizen>
-        public class FinishedEventArgs : EventArgs
+        public VideoView(string url) : this(NDalicPINVOKE.VideoView_New__SWIG_1(url), true)
         {
-            private VideoView _videoView;
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
 
-            /// <summary>
-            /// The view for video playback and display.
-            /// </summary>
-            /// <since_tizen> 3 </since_tizen>
-            public VideoView VideoView
-            {
-                get
-                {
-                    return _videoView;
-                }
-                set
-                {
-                    _videoView = value;
-                }
-            }
+        internal VideoView(VideoView videoView) : this(NDalicPINVOKE.new_VideoView__SWIG_1(VideoView.getCPtr(videoView)), true)
+        {
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
+        internal VideoView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.VideoView_SWIGUpcast(cPtr), cMemoryOwn)
+        {
+            swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+        }
 
         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
         private delegate void FinishedCallbackDelegate(IntPtr data);
-        private EventHandler<FinishedEventArgs> _videoViewFinishedEventHandler;
-        private FinishedCallbackDelegate _videoViewFinishedCallbackDelegate;
-
 
         /// <summary>
         /// Event for the finished signal which can be used to subscribe or unsubscribe the event handler
@@ -241,54 +193,107 @@ namespace Tizen.NUI.BaseComponents
             }
         }
 
-        // Callback for VideoView Finished signal
-        private void OnFinished(IntPtr data)
+        /// <summary>
+        /// Video file setting type of PropertyMap.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public PropertyMap Video
         {
-            FinishedEventArgs e = new FinishedEventArgs();
-
-            // Populate all members of "e" (FinishedEventArgs) with real data
-            e.VideoView = Registry.GetManagedBaseHandleFromNativePtr(data) as VideoView;
-
-            if (_videoViewFinishedEventHandler != null)
+            get
             {
-                //here we send all data to user event handlers
-                _videoViewFinishedEventHandler(this, e);
+                return (PropertyMap)GetValue(VideoProperty);
+            }
+            set
+            {
+                SetValue(VideoProperty, value);
+                NotifyPropertyChanged();
             }
         }
 
-        internal new class Property
+        /// <summary>
+        /// The looping status, true or false.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        public bool Looping
         {
-            internal static readonly int VIDEO = NDalicPINVOKE.VideoView_Property_VIDEO_get();
-            internal static readonly int LOOPING = NDalicPINVOKE.VideoView_Property_LOOPING_get();
-            internal static readonly int MUTED = NDalicPINVOKE.VideoView_Property_MUTED_get();
-            internal static readonly int VOLUME = NDalicPINVOKE.VideoView_Property_VOLUME_get();
-            internal static readonly int UNDERLAY = NDalicPINVOKE.VideoView_Property_UNDERLAY_get();
+            get
+            {
+                return (bool)GetValue(LoopingProperty);
+            }
+            set
+            {
+                SetValue(LoopingProperty, value);
+                NotifyPropertyChanged();
+            }
         }
 
         /// <summary>
-        /// Creates an initialized VideoView.
+        /// The mute status, true or false.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        public VideoView() : this(NDalicPINVOKE.VideoView_New__SWIG_0(), true)
+        public bool Muted
         {
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
+            get
+            {
+                return (bool)GetValue(MutedProperty);
+            }
+            set
+            {
+                SetValue(MutedProperty, value);
+                NotifyPropertyChanged();
+            }
         }
 
         /// <summary>
-        /// Creates an initialized VideoView.<br />
-        /// If the string is empty, VideoView will not display anything.<br />
+        /// The left and the right volume scalar as float type, PropertyMap with two values ( "left" and "right" ).
         /// </summary>
-        /// <param name="url">The URL of the video resource to display.</param>
         /// <since_tizen> 3 </since_tizen>
-        public VideoView(string url) : this(NDalicPINVOKE.VideoView_New__SWIG_1(url), true)
+        public PropertyMap Volume
         {
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            get
+            {
+                return (PropertyMap)GetValue(VolumeProperty);
+            }
+            set
+            {
+                SetValue(VolumeProperty, value);
+                NotifyPropertyChanged();
+            }
+        }
 
+        /// <summary>
+        /// Video rendering by underlay, true or false.<br />
+        /// This shows video composited underneath the window by the system. This means it may ignore rotation of the video-view.
+        /// </summary>
+        /// <since_tizen> 4 </since_tizen>
+        public bool Underlay
+        {
+            get
+            {
+                return (bool)GetValue(UnderlayProperty);
+            }
+            set
+            {
+                SetValue(UnderlayProperty, value);
+                NotifyPropertyChanged();
+            }
         }
-        internal VideoView(VideoView videoView) : this(NDalicPINVOKE.new_VideoView__SWIG_1(VideoView.getCPtr(videoView)), true)
+
+        /// <summary>
+        /// Video file URL as string type.
+        /// </summary>
+        /// <since_tizen> 4 </since_tizen>
+        public string ResourceUrl
         {
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            get
+            {
+                return (string)GetValue(ResourceUrlProperty);
+            }
+            set
+            {
+                SetValue(ResourceUrlProperty, value);
+                NotifyPropertyChanged();
+            }
         }
 
         /// <summary>
@@ -350,109 +355,99 @@ namespace Tizen.NUI.BaseComponents
             return ret;
         }
 
-        /// <summary>
-        /// Video file setting type of PropertyMap.
-        /// </summary>
-        /// <since_tizen> 3 </since_tizen>
-        public PropertyMap Video
+        internal static global::System.Runtime.InteropServices.HandleRef getCPtr(VideoView obj)
         {
-            get
-            {
-                return (PropertyMap)GetValue(VideoProperty);
-            }
-            set
-            {
-                SetValue(VideoProperty, value);
-                NotifyPropertyChanged();
-            }
+            return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
         }
 
         /// <summary>
-        /// The looping status, true or false.
+        /// Dispose.
         /// </summary>
+        /// <param name="type">DisposeTypes</param>
         /// <since_tizen> 3 </since_tizen>
-        public bool Looping
+        protected override void Dispose(DisposeTypes type)
         {
-            get
+            if (disposed)
             {
-                return (bool)GetValue(LoopingProperty);
+                return;
             }
-            set
+
+            if (type == DisposeTypes.Explicit)
             {
-                SetValue(LoopingProperty, value);
-                NotifyPropertyChanged();
+                //Called by User
+                //Release your own managed resources here.
+                //You should release all of your own disposable objects here.
             }
-        }
 
-        /// <summary>
-        /// The mute status, true or false.
-        /// </summary>
-        /// <since_tizen> 3 </since_tizen>
-        public bool Muted
-        {
-            get
+            //Release your own unmanaged resources here.
+            //You should not access any managed member here except static instance.
+            //because the execution order of Finalizes is non-deterministic.
+
+            if (this != null && _videoViewFinishedCallbackDelegate != null)
             {
-                return (bool)GetValue(MutedProperty);
+                FinishedSignal().Disconnect(_videoViewFinishedCallbackDelegate);
             }
-            set
+
+            if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
-                SetValue(MutedProperty, value);
-                NotifyPropertyChanged();
+                if (swigCMemOwn)
+                {
+                    swigCMemOwn = false;
+                    NDalicPINVOKE.delete_VideoView(swigCPtr);
+                }
+                swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
             }
+
+            base.Dispose(type);
         }
 
-        /// <summary>
-        /// The left and the right volume scalar as float type, PropertyMap with two values ( "left" and "right" ).
-        /// </summary>
-        /// <since_tizen> 3 </since_tizen>
-        public PropertyMap Volume
+        // Callback for VideoView Finished signal
+        private void OnFinished(IntPtr data)
         {
-            get
-            {
-                return (PropertyMap)GetValue(VolumeProperty);
-            }
-            set
+            FinishedEventArgs e = new FinishedEventArgs();
+
+            // Populate all members of "e" (FinishedEventArgs) with real data
+            e.VideoView = Registry.GetManagedBaseHandleFromNativePtr(data) as VideoView;
+
+            if (_videoViewFinishedEventHandler != null)
             {
-                SetValue(VolumeProperty, value);
-                NotifyPropertyChanged();
+                //here we send all data to user event handlers
+                _videoViewFinishedEventHandler(this, e);
             }
         }
 
         /// <summary>
-        /// Video rendering by underlay, true or false.<br />
-        /// This shows video composited underneath the window by the system. This means it may ignore rotation of the video-view.
+        /// Event arguments that passed via the finished signal.
         /// </summary>
-        /// <since_tizen> 4 </since_tizen>
-        public bool Underlay
+        /// <since_tizen> 3 </since_tizen>
+        public class FinishedEventArgs : EventArgs
         {
-            get
-            {
-                return (bool)GetValue(UnderlayProperty);
-            }
-            set
+            private VideoView _videoView;
+
+            /// <summary>
+            /// The view for video playback and display.
+            /// </summary>
+            /// <since_tizen> 3 </since_tizen>
+            public VideoView VideoView
             {
-                SetValue(UnderlayProperty, value);
-                NotifyPropertyChanged();
+                get
+                {
+                    return _videoView;
+                }
+                set
+                {
+                    _videoView = value;
+                }
             }
         }
 
-        /// <summary>
-        /// Video file URL as string type.
-        /// </summary>
-        /// <since_tizen> 4 </since_tizen>
-        public string ResourceUrl
+        internal new class Property
         {
-            get
-            {
-                return (string)GetValue(ResourceUrlProperty);
-            }
-            set
-            {
-                SetValue(ResourceUrlProperty, value);
-                NotifyPropertyChanged();
-            }
+            internal static readonly int VIDEO = NDalicPINVOKE.VideoView_Property_VIDEO_get();
+            internal static readonly int LOOPING = NDalicPINVOKE.VideoView_Property_LOOPING_get();
+            internal static readonly int MUTED = NDalicPINVOKE.VideoView_Property_MUTED_get();
+            internal static readonly int VOLUME = NDalicPINVOKE.VideoView_Property_VOLUME_get();
+            internal static readonly int UNDERLAY = NDalicPINVOKE.VideoView_Property_UNDERLAY_get();
         }
-
     }
-
 }