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;
32 using Tizen.NUI.BaseComponents;
35 /// VideoView is a control for video playback and display.
37 public class VideoView : View
39 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
41 internal VideoView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.VideoView_SWIGUpcast(cPtr), cMemoryOwn)
43 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
44 // By default, we do not want the position to use the anchor point
45 PositionUsesAnchorPoint = false;
48 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(VideoView obj)
50 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
53 protected override void Dispose(DisposeTypes type)
60 if(type == DisposeTypes.Explicit)
63 //Release your own managed resources here.
64 //You should release all of your own disposable objects here.
67 //Release your own unmanaged resources here.
68 //You should not access any managed member here except static instance.
69 //because the execution order of Finalizes is non-deterministic.
71 if (swigCPtr.Handle != global::System.IntPtr.Zero)
76 NDalicPINVOKE.delete_VideoView(swigCPtr);
78 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
85 /// Event arguments that passed via Finished signal
87 public class FinishedEventArgs : EventArgs
89 private VideoView _videoView;
92 /// The view for video playback and display.
94 public VideoView VideoView
108 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
109 private delegate void FinishedCallbackDelegate(IntPtr data);
110 private EventHandler<FinishedEventArgs> _videoViewFinishedEventHandler;
111 private FinishedCallbackDelegate _videoViewFinishedCallbackDelegate;
115 /// Event for Finished signal which can be used to subscribe/unsubscribe the event handler
116 /// (in the type of FinishedEventHandler-DaliEventHandler<object,FinishedEventArgs>) provided by the user.<br>
117 /// Finished signal is emitted when a video playback have finished.<br>
119 public event EventHandler<FinishedEventArgs> Finished
123 if (_videoViewFinishedEventHandler == null)
125 _videoViewFinishedCallbackDelegate = (OnFinished);
126 FinishedSignal().Connect(_videoViewFinishedCallbackDelegate);
128 _videoViewFinishedEventHandler += value;
132 _videoViewFinishedEventHandler -= value;
133 if (_videoViewFinishedEventHandler == null && FinishedSignal().Empty() == false)
135 FinishedSignal().Disconnect(_videoViewFinishedCallbackDelegate);
140 // Callback for VideoView Finished signal
141 private void OnFinished(IntPtr data)
143 FinishedEventArgs e = new FinishedEventArgs();
145 // Populate all members of "e" (FinishedEventArgs) with real data
146 e.VideoView = Registry.GetManagedBaseHandleFromNativePtr(data) as VideoView;
148 if (_videoViewFinishedEventHandler != null)
150 //here we send all data to user event handlers
151 _videoViewFinishedEventHandler(this, e);
155 internal class Property
157 internal static readonly int VIDEO = NDalicPINVOKE.VideoView_Property_VIDEO_get();
158 internal static readonly int LOOPING = NDalicPINVOKE.VideoView_Property_LOOPING_get();
159 internal static readonly int MUTED = NDalicPINVOKE.VideoView_Property_MUTED_get();
160 internal static readonly int VOLUME = NDalicPINVOKE.VideoView_Property_VOLUME_get();
164 /// Creates an initialized VideoView.
166 public VideoView() : this(NDalicPINVOKE.VideoView_New__SWIG_0(), true)
168 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
173 /// Creates an initialized VideoView.<br>
174 /// If the string is empty, VideoView will not display anything.<br>
176 /// <param name="url">The url of the video resource to display</param>
177 public VideoView(string url) : this(NDalicPINVOKE.VideoView_New__SWIG_1(url), true)
179 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
182 internal VideoView(VideoView videoView) : this(NDalicPINVOKE.new_VideoView__SWIG_1(VideoView.getCPtr(videoView)), true)
184 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
188 /// Starts the video playback.
192 NDalicPINVOKE.VideoView_Play(swigCPtr);
193 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
197 /// Pauses the video playback.
201 NDalicPINVOKE.VideoView_Pause(swigCPtr);
202 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
206 /// Stops the video playback.
210 NDalicPINVOKE.VideoView_Stop(swigCPtr);
211 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
215 /// Seeks forward by the specified number of milliseconds.
217 /// <param name="millisecond">The position for forward playback</param>
218 public void Forward(int millisecond)
220 NDalicPINVOKE.VideoView_Forward(swigCPtr, millisecond);
221 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
225 /// Seeks backward by the specified number of milliseconds.
227 /// <param name="millisecond">The position for backward playback</param>
228 public void Backward(int millisecond)
230 NDalicPINVOKE.VideoView_Backward(swigCPtr, millisecond);
231 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
234 internal VideoViewSignal FinishedSignal()
236 VideoViewSignal ret = new VideoViewSignal(NDalicPINVOKE.VideoView_FinishedSignal(swigCPtr), false);
237 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
242 /// video file url as string type or PropertyMap.
244 public PropertyMap Video
248 PropertyMap temp = new PropertyMap();
249 GetProperty(VideoView.Property.VIDEO).Get(temp);
254 SetProperty(VideoView.Property.VIDEO, new Tizen.NUI.PropertyValue(value));
259 /// looping status, true or false.
266 GetProperty(VideoView.Property.LOOPING).Get(out temp);
271 SetProperty(VideoView.Property.LOOPING, new Tizen.NUI.PropertyValue(value));
276 /// mute status, true or false.
283 GetProperty(VideoView.Property.MUTED).Get(out temp);
288 SetProperty(VideoView.Property.MUTED, new Tizen.NUI.PropertyValue(value));
293 /// left and right volume scalar as float type, PropertyMap with two values ( "left" and "right" ).
295 public PropertyMap Volume
299 PropertyMap temp = new PropertyMap();
300 GetProperty(VideoView.Property.VOLUME).Get(temp);
305 SetProperty(VideoView.Property.VOLUME, new PropertyValue(value));