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 //------------------------------------------------------------------------------
30 using System.Runtime.InteropServices;
33 public class VideoView : View {
34 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
36 internal VideoView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.VideoView_SWIGUpcast(cPtr), cMemoryOwn) {
37 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
40 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(VideoView obj) {
41 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
45 DisposeQueue.Instance.Add(this);
48 public override void Dispose() {
49 if (!Window.IsInstalled()) {
50 DisposeQueue.Instance.Add(this);
55 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
58 NDalicPINVOKE.delete_VideoView(swigCPtr);
60 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
62 global::System.GC.SuppressFinalize(this);
70 * @brief Event arguments that passed via Finished signal
73 public class FinishedEventArgs : EventArgs
75 private VideoView _videoView;
78 * @brief VideoView - VideoView is a control for video playback and display.
81 public VideoView VideoView
95 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
96 private delegate void FinishedCallbackDelegate(IntPtr data);
97 private DaliEventHandler<object,FinishedEventArgs> _videoViewFinishedEventHandler;
98 private FinishedCallbackDelegate _videoViewFinishedCallbackDelegate;
101 * @brief Event for Finished signal which can be used to subscribe/unsubscribe the event handler
102 * (in the type of FinishedEventHandler-DaliEventHandler<object,FinishedEventArgs>) provided by the user.
103 * Finished signal is emitted when a video playback have finished.
105 public event DaliEventHandler<object,FinishedEventArgs> Finished
111 // Restricted to only one listener
112 if (_videoViewFinishedEventHandler == null)
114 _videoViewFinishedEventHandler += value;
116 _videoViewFinishedCallbackDelegate = new FinishedCallbackDelegate(OnFinished);
117 this.FinishedSignal().Connect(_videoViewFinishedCallbackDelegate);
126 if (_videoViewFinishedEventHandler != null)
128 this.FinishedSignal().Disconnect(_videoViewFinishedCallbackDelegate);
131 _videoViewFinishedEventHandler -= value;
136 // Callback for VideoView Finished signal
137 private void OnFinished(IntPtr data)
139 FinishedEventArgs e = new FinishedEventArgs();
141 // Populate all members of "e" (FinishedEventArgs) with real data
142 e.VideoView = VideoView.GetVideoViewFromPtr( data );
144 if (_videoViewFinishedEventHandler != null)
146 //here we send all data to user event handlers
147 _videoViewFinishedEventHandler(this, e);
151 public static VideoView GetVideoViewFromPtr(global::System.IntPtr cPtr) {
152 VideoView ret = new VideoView(cPtr, false);
153 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
158 public class Property : global::System.IDisposable {
159 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
160 protected bool swigCMemOwn;
162 internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) {
163 swigCMemOwn = cMemoryOwn;
164 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
167 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj) {
168 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
175 public virtual void Dispose() {
177 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
180 NDalicPINVOKE.delete_VideoView_Property(swigCPtr);
182 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
184 global::System.GC.SuppressFinalize(this);
188 public Property() : this(NDalicPINVOKE.new_VideoView_Property(), true) {
189 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
192 public static readonly int VIDEO = NDalicPINVOKE.VideoView_Property_VIDEO_get();
193 public static readonly int LOOPING = NDalicPINVOKE.VideoView_Property_LOOPING_get();
194 public static readonly int MUTED = NDalicPINVOKE.VideoView_Property_MUTED_get();
195 public static readonly int VOLUME = NDalicPINVOKE.VideoView_Property_VOLUME_get();
199 public VideoView () : this (NDalicPINVOKE.VideoView_New__SWIG_0(), true) {
200 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
203 public VideoView (string url) : this (NDalicPINVOKE.VideoView_New__SWIG_1(url), true) {
204 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
207 public VideoView(VideoView videoView) : this(NDalicPINVOKE.new_VideoView__SWIG_1(VideoView.getCPtr(videoView)), true) {
208 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
211 public VideoView Assign(VideoView videoView) {
212 VideoView ret = new VideoView(NDalicPINVOKE.VideoView_Assign(swigCPtr, VideoView.getCPtr(videoView)), false);
213 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
217 public new static VideoView DownCast(BaseHandle handle) {
218 VideoView ret = new VideoView(NDalicPINVOKE.VideoView_DownCast(BaseHandle.getCPtr(handle)), true);
219 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
224 NDalicPINVOKE.VideoView_Play(swigCPtr);
225 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
228 public void Pause() {
229 NDalicPINVOKE.VideoView_Pause(swigCPtr);
230 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
234 NDalicPINVOKE.VideoView_Stop(swigCPtr);
235 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
238 public void Forward(int millisecond) {
239 NDalicPINVOKE.VideoView_Forward(swigCPtr, millisecond);
240 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
243 public void Backward(int millisecond) {
244 NDalicPINVOKE.VideoView_Backward(swigCPtr, millisecond);
245 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
248 public VideoViewSignal FinishedSignal() {
249 VideoViewSignal ret = new VideoViewSignal(NDalicPINVOKE.VideoView_FinishedSignal(swigCPtr), false);
250 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
254 public enum PropertyRange {
255 PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX
258 public Dali.Property.Map Video
262 Dali.Property.Map temp = new Dali.Property.Map();
263 GetProperty( VideoView.Property.VIDEO).Get( temp );
268 SetProperty( VideoView.Property.VIDEO, new Dali.Property.Value( value ) );
276 GetProperty( VideoView.Property.LOOPING).Get( ref temp );
281 SetProperty( VideoView.Property.LOOPING, new Dali.Property.Value( value ) );
289 GetProperty( VideoView.Property.MUTED).Get( ref temp );
294 SetProperty( VideoView.Property.MUTED, new Dali.Property.Value( value ) );
297 public Dali.Property.Map Volume
301 Dali.Property.Map temp = new Dali.Property.Map();
302 GetProperty( VideoView.Property.VOLUME).Get( temp );
307 SetProperty( VideoView.Property.VOLUME, new Dali.Property.Value( value ) );