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 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 public class Property
160 public static readonly int VIDEO = NDalicPINVOKE.VideoView_Property_VIDEO_get();
161 public static readonly int LOOPING = NDalicPINVOKE.VideoView_Property_LOOPING_get();
162 public static readonly int MUTED = NDalicPINVOKE.VideoView_Property_MUTED_get();
163 public static readonly int VOLUME = NDalicPINVOKE.VideoView_Property_VOLUME_get();
167 public VideoView () : this (NDalicPINVOKE.VideoView_New__SWIG_0(), true) {
168 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
171 public VideoView (string url) : this (NDalicPINVOKE.VideoView_New__SWIG_1(url), true) {
172 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
175 public VideoView(VideoView videoView) : this(NDalicPINVOKE.new_VideoView__SWIG_1(VideoView.getCPtr(videoView)), true) {
176 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
179 internal new static VideoView DownCast(BaseHandle handle) {
180 VideoView ret = new VideoView(NDalicPINVOKE.VideoView_DownCast(BaseHandle.getCPtr(handle)), true);
181 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
186 NDalicPINVOKE.VideoView_Play(swigCPtr);
187 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
190 public void Pause() {
191 NDalicPINVOKE.VideoView_Pause(swigCPtr);
192 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
196 NDalicPINVOKE.VideoView_Stop(swigCPtr);
197 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
200 public void Forward(int millisecond) {
201 NDalicPINVOKE.VideoView_Forward(swigCPtr, millisecond);
202 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
205 public void Backward(int millisecond) {
206 NDalicPINVOKE.VideoView_Backward(swigCPtr, millisecond);
207 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
210 internal VideoViewSignal FinishedSignal() {
211 VideoViewSignal ret = new VideoViewSignal(NDalicPINVOKE.VideoView_FinishedSignal(swigCPtr), false);
212 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
216 public Dali.Property.Map Video
220 Dali.Property.Map temp = new Dali.Property.Map();
221 GetProperty( VideoView.Property.VIDEO).Get( temp );
226 SetProperty( VideoView.Property.VIDEO, new Dali.Property.Value( value ) );
234 GetProperty( VideoView.Property.LOOPING).Get( out temp );
239 SetProperty( VideoView.Property.LOOPING, new Dali.Property.Value( value ) );
247 GetProperty( VideoView.Property.MUTED).Get( out temp );
252 SetProperty( VideoView.Property.MUTED, new Dali.Property.Value( value ) );
255 public Dali.Property.Map Volume
259 Dali.Property.Map temp = new Dali.Property.Map();
260 GetProperty( VideoView.Property.VOLUME).Get( temp );
265 SetProperty( VideoView.Property.VOLUME, new Dali.Property.Value( value ) );