1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
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
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
20 // This file was automatically generated by SWIG (http://www.swig.org).
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
31 using System.Runtime.InteropServices;
34 /// VideoView is a control for video playback and display.
36 public class VideoView : View
38 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
40 internal VideoView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.VideoView_SWIGUpcast(cPtr), cMemoryOwn)
42 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
45 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(VideoView obj)
47 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
52 DisposeQueue.Instance.Add(this);
55 public override void Dispose()
57 if (!Stage.IsInstalled())
59 DisposeQueue.Instance.Add(this);
65 if (swigCPtr.Handle != global::System.IntPtr.Zero)
70 NDalicPINVOKE.delete_VideoView(swigCPtr);
72 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
74 global::System.GC.SuppressFinalize(this);
80 /// Event arguments that passed via Finished signal
82 public class FinishedEventArgs : EventArgs
84 private VideoView _videoView;
87 /// The view for video playback and display.
89 public VideoView VideoView
103 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
104 private delegate void FinishedCallbackDelegate(IntPtr data);
105 private EventHandler<FinishedEventArgs> _videoViewFinishedEventHandler;
106 private FinishedCallbackDelegate _videoViewFinishedCallbackDelegate;
110 /// Event for Finished signal which can be used to subscribe/unsubscribe the event handler
111 /// (in the type of FinishedEventHandler-DaliEventHandler<object,FinishedEventArgs>) provided by the user.
112 /// Finished signal is emitted when a video playback have finished.
114 public event EventHandler<FinishedEventArgs> Finished
118 if (_videoViewFinishedEventHandler == null)
120 _videoViewFinishedCallbackDelegate = (OnFinished);
121 FinishedSignal().Connect(_videoViewFinishedCallbackDelegate);
123 _videoViewFinishedEventHandler += value;
127 _videoViewFinishedEventHandler -= value;
128 if (_videoViewFinishedEventHandler == null && _videoViewFinishedCallbackDelegate != null)
130 FinishedSignal().Disconnect(_videoViewFinishedCallbackDelegate);
135 // Callback for VideoView Finished signal
136 private void OnFinished(IntPtr data)
138 FinishedEventArgs e = new FinishedEventArgs();
140 // Populate all members of "e" (FinishedEventArgs) with real data
141 e.VideoView = VideoView.GetVideoViewFromPtr(data);
143 if (_videoViewFinishedEventHandler != null)
145 //here we send all data to user event handlers
146 _videoViewFinishedEventHandler(this, e);
150 internal static VideoView GetVideoViewFromPtr(global::System.IntPtr cPtr)
152 VideoView ret = new VideoView(cPtr, false);
153 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
158 internal class Property : global::System.IDisposable
160 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
161 protected bool swigCMemOwn;
163 internal Property(global::System.IntPtr cPtr, bool cMemoryOwn)
165 swigCMemOwn = cMemoryOwn;
166 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
169 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj)
171 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
179 public virtual void Dispose()
183 if (swigCPtr.Handle != global::System.IntPtr.Zero)
188 NDalicPINVOKE.delete_VideoView_Property(swigCPtr);
190 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
192 global::System.GC.SuppressFinalize(this);
196 internal Property() : this(NDalicPINVOKE.new_VideoView_Property(), true)
198 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
201 internal static readonly int VIDEO = NDalicPINVOKE.VideoView_Property_VIDEO_get();
202 internal static readonly int LOOPING = NDalicPINVOKE.VideoView_Property_LOOPING_get();
203 internal static readonly int MUTED = NDalicPINVOKE.VideoView_Property_MUTED_get();
204 internal static readonly int VOLUME = NDalicPINVOKE.VideoView_Property_VOLUME_get();
209 /// Creates an initialized VideoView.
211 public VideoView() : this(NDalicPINVOKE.VideoView_New__SWIG_0(), true)
213 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
218 /// Creates an initialized VideoView.
219 /// If the string is empty, VideoView will not display anything.
221 /// <param name="url">The url of the video resource to display</param>
222 public VideoView(string url) : this(NDalicPINVOKE.VideoView_New__SWIG_1(url), true)
224 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
227 internal VideoView(VideoView videoView) : this(NDalicPINVOKE.new_VideoView__SWIG_1(VideoView.getCPtr(videoView)), true)
229 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
232 internal VideoView Assign(VideoView videoView)
234 VideoView ret = new VideoView(NDalicPINVOKE.VideoView_Assign(swigCPtr, VideoView.getCPtr(videoView)), false);
235 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
240 /// Downcasts a handle to VideoView handle.
241 /// If handle points to a VideoView, the downcast produces valid handle.
242 /// If not, the returned handle is left uninitialized.
244 /// <param name="handle">Handle to an object</param>
245 /// <returns>Handle to a VideoView or an uninitialized handle</returns>
246 public new static VideoView DownCast(BaseHandle handle)
248 VideoView ret = new VideoView(NDalicPINVOKE.VideoView_DownCast(BaseHandle.getCPtr(handle)), true);
249 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
254 /// Starts the video playback.
258 NDalicPINVOKE.VideoView_Play(swigCPtr);
259 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
263 /// Pauses the video playback.
267 NDalicPINVOKE.VideoView_Pause(swigCPtr);
268 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
272 /// Stops the video playback.
276 NDalicPINVOKE.VideoView_Stop(swigCPtr);
277 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
281 /// Seeks forward by the specified number of milliseconds.
283 /// <param name="millisecond">The position for forward playback</param>
284 public void Forward(int millisecond)
286 NDalicPINVOKE.VideoView_Forward(swigCPtr, millisecond);
287 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
291 /// Seeks backward by the specified number of milliseconds.
293 /// <param name="millisecond">The position for backward playback</param>
294 public void Backward(int millisecond)
296 NDalicPINVOKE.VideoView_Backward(swigCPtr, millisecond);
297 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
300 internal VideoViewSignal FinishedSignal()
302 VideoViewSignal ret = new VideoViewSignal(NDalicPINVOKE.VideoView_FinishedSignal(swigCPtr), false);
303 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
307 internal enum PropertyRange
309 PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX
313 /// video file url as string type or PropertyMap.
315 public PropertyMap Video
319 PropertyMap temp = new PropertyMap();
320 GetProperty(VideoView.Property.VIDEO).Get(temp);
325 SetProperty(VideoView.Property.VIDEO, new Tizen.NUI.PropertyValue(value));
330 /// looping status, true or false.
337 GetProperty(VideoView.Property.LOOPING).Get(ref temp);
342 SetProperty(VideoView.Property.LOOPING, new Tizen.NUI.PropertyValue(value));
347 /// mute status, true or false.
354 GetProperty(VideoView.Property.MUTED).Get(ref temp);
359 SetProperty(VideoView.Property.MUTED, new Tizen.NUI.PropertyValue(value));
364 /// left and right volume scalar as float type, PropertyMap with two values ( "left" and "right" ).
366 public PropertyMap Volume
370 PropertyMap temp = new PropertyMap();
371 GetProperty(VideoView.Property.VOLUME).Get(temp);
376 SetProperty(VideoView.Property.VOLUME, new PropertyValue(value));