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 //------------------------------------------------------------------------------
27 namespace Tizen.NUI.BaseComponents
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);
43 // By default, we do not want the position to use the anchor point
44 PositionUsesAnchorPoint = false;
47 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(VideoView obj)
49 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
52 protected override void Dispose(DisposeTypes type)
59 if(type == DisposeTypes.Explicit)
62 //Release your own managed resources here.
63 //You should release all of your own disposable objects here.
66 //Release your own unmanaged resources here.
67 //You should not access any managed member here except static instance.
68 //because the execution order of Finalizes is non-deterministic.
70 if (swigCPtr.Handle != global::System.IntPtr.Zero)
75 NDalicPINVOKE.delete_VideoView(swigCPtr);
77 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
84 /// Event arguments that passed via Finished signal
86 public class FinishedEventArgs : EventArgs
88 private VideoView _videoView;
91 /// The view for video playback and display.
93 public VideoView VideoView
107 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
108 private delegate void FinishedCallbackDelegate(IntPtr data);
109 private EventHandler<FinishedEventArgs> _videoViewFinishedEventHandler;
110 private FinishedCallbackDelegate _videoViewFinishedCallbackDelegate;
114 /// Event for Finished signal which can be used to subscribe/unsubscribe the event handler
115 /// (in the type of FinishedEventHandler-DaliEventHandler<object,FinishedEventArgs>) provided by the user.<br>
116 /// Finished signal is emitted when a video playback have finished.<br>
118 public event EventHandler<FinishedEventArgs> Finished
122 if (_videoViewFinishedEventHandler == null)
124 _videoViewFinishedCallbackDelegate = (OnFinished);
125 FinishedSignal().Connect(_videoViewFinishedCallbackDelegate);
127 _videoViewFinishedEventHandler += value;
131 _videoViewFinishedEventHandler -= value;
132 if (_videoViewFinishedEventHandler == null && FinishedSignal().Empty() == false)
134 FinishedSignal().Disconnect(_videoViewFinishedCallbackDelegate);
139 // Callback for VideoView Finished signal
140 private void OnFinished(IntPtr data)
142 FinishedEventArgs e = new FinishedEventArgs();
144 // Populate all members of "e" (FinishedEventArgs) with real data
145 e.VideoView = VideoView.GetVideoViewFromPtr(data);
147 if (_videoViewFinishedEventHandler != null)
149 //here we send all data to user event handlers
150 _videoViewFinishedEventHandler(this, e);
154 internal static VideoView GetVideoViewFromPtr(global::System.IntPtr cPtr)
156 VideoView ret = new VideoView(cPtr, false);
157 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
162 internal class Property
164 internal static readonly int VIDEO = NDalicPINVOKE.VideoView_Property_VIDEO_get();
165 internal static readonly int LOOPING = NDalicPINVOKE.VideoView_Property_LOOPING_get();
166 internal static readonly int MUTED = NDalicPINVOKE.VideoView_Property_MUTED_get();
167 internal static readonly int VOLUME = NDalicPINVOKE.VideoView_Property_VOLUME_get();
171 /// Creates an initialized VideoView.
173 public VideoView() : this(NDalicPINVOKE.VideoView_New__SWIG_0(), true)
175 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
180 /// Creates an initialized VideoView.<br>
181 /// If the string is empty, VideoView will not display anything.<br>
183 /// <param name="url">The url of the video resource to display</param>
184 public VideoView(string url) : this(NDalicPINVOKE.VideoView_New__SWIG_1(url), true)
186 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
189 internal VideoView(VideoView videoView) : this(NDalicPINVOKE.new_VideoView__SWIG_1(VideoView.getCPtr(videoView)), true)
191 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
195 /// Downcasts a handle to VideoView handle.<br>
196 /// If handle points to a VideoView, the downcast produces valid handle.<br>
197 /// If not, the returned handle is left uninitialized.<br>
199 /// <param name="handle">Handle to an object</param>
200 /// <returns>Handle to a VideoView or an uninitialized handle</returns>
201 internal new static VideoView DownCast(BaseHandle handle)
203 VideoView ret = new VideoView(NDalicPINVOKE.VideoView_DownCast(BaseHandle.getCPtr(handle)), true);
204 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
209 /// Starts the video playback.
213 NDalicPINVOKE.VideoView_Play(swigCPtr);
214 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
218 /// Pauses the video playback.
222 NDalicPINVOKE.VideoView_Pause(swigCPtr);
223 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
227 /// Stops the video playback.
231 NDalicPINVOKE.VideoView_Stop(swigCPtr);
232 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
236 /// Seeks forward by the specified number of milliseconds.
238 /// <param name="millisecond">The position for forward playback</param>
239 public void Forward(int millisecond)
241 NDalicPINVOKE.VideoView_Forward(swigCPtr, millisecond);
242 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
246 /// Seeks backward by the specified number of milliseconds.
248 /// <param name="millisecond">The position for backward playback</param>
249 public void Backward(int millisecond)
251 NDalicPINVOKE.VideoView_Backward(swigCPtr, millisecond);
252 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
255 internal VideoViewSignal FinishedSignal()
257 VideoViewSignal ret = new VideoViewSignal(NDalicPINVOKE.VideoView_FinishedSignal(swigCPtr), false);
258 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
263 /// video file url as string type or PropertyMap.
265 public PropertyMap Video
269 PropertyMap temp = new PropertyMap();
270 GetProperty(VideoView.Property.VIDEO).Get(temp);
275 SetProperty(VideoView.Property.VIDEO, new Tizen.NUI.PropertyValue(value));
280 /// looping status, true or false.
287 GetProperty(VideoView.Property.LOOPING).Get(out temp);
292 SetProperty(VideoView.Property.LOOPING, new Tizen.NUI.PropertyValue(value));
297 /// mute status, true or false.
304 GetProperty(VideoView.Property.MUTED).Get(out temp);
309 SetProperty(VideoView.Property.MUTED, new Tizen.NUI.PropertyValue(value));
314 /// left and right volume scalar as float type, PropertyMap with two values ( "left" and "right" ).
316 public PropertyMap Volume
320 PropertyMap temp = new PropertyMap();
321 GetProperty(VideoView.Property.VOLUME).Get(temp);
326 SetProperty(VideoView.Property.VOLUME, new PropertyValue(value));