1 /** Copyright (c) 2016 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;
48 public override void Dispose() {
50 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
53 NDalicPINVOKE.delete_VideoView(swigCPtr);
55 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
57 global::System.GC.SuppressFinalize(this);
64 * @brief Event arguments that passed via Finished signal
67 public class FinishedEventArgs : EventArgs
69 private VideoView _videoView;
72 * @brief VideoView - VideoView is a control for video playback and display.
75 public VideoView VideoView
89 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
90 private delegate void FinishedCallbackDelegate(IntPtr data);
91 private DaliEventHandler<object,FinishedEventArgs> _videoViewFinishedEventHandler;
92 private FinishedCallbackDelegate _videoViewFinishedCallbackDelegate;
95 * @brief Event for Finished signal which can be used to subscribe/unsubscribe the event handler
96 * (in the type of FinishedEventHandler-DaliEventHandler<object,FinishedEventArgs>) provided by the user.
97 * Finished signal is emitted when a video playback have finished.
99 public event DaliEventHandler<object,FinishedEventArgs> Finished
105 // Restricted to only one listener
106 if (_videoViewFinishedEventHandler == null)
108 _videoViewFinishedEventHandler += value;
110 _videoViewFinishedCallbackDelegate = new FinishedCallbackDelegate(OnFinished);
111 this.FinishedSignal().Connect(_videoViewFinishedCallbackDelegate);
120 if (_videoViewFinishedEventHandler != null)
122 this.FinishedSignal().Disconnect(_videoViewFinishedCallbackDelegate);
125 _videoViewFinishedEventHandler -= value;
130 // Callback for VideoView Finished signal
131 private void OnFinished(IntPtr data)
133 FinishedEventArgs e = new FinishedEventArgs();
135 // Populate all members of "e" (FinishedEventArgs) with real data
136 e.VideoView = VideoView.GetVideoViewFromPtr( data );
138 if (_videoViewFinishedEventHandler != null)
140 //here we send all data to user event handlers
141 _videoViewFinishedEventHandler(this, e);
145 public static VideoView GetVideoViewFromPtr(global::System.IntPtr cPtr) {
146 VideoView ret = new VideoView(cPtr, false);
147 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
152 public class Property : global::System.IDisposable {
153 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
154 protected bool swigCMemOwn;
156 internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) {
157 swigCMemOwn = cMemoryOwn;
158 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
161 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj) {
162 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
169 public virtual void Dispose() {
171 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
174 NDalicPINVOKE.delete_VideoView_Property(swigCPtr);
176 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
178 global::System.GC.SuppressFinalize(this);
182 public Property() : this(NDalicPINVOKE.new_VideoView_Property(), true) {
183 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
186 public static readonly int VIDEO = NDalicPINVOKE.VideoView_Property_VIDEO_get();
187 public static readonly int LOOPING = NDalicPINVOKE.VideoView_Property_LOOPING_get();
188 public static readonly int MUTED = NDalicPINVOKE.VideoView_Property_MUTED_get();
189 public static readonly int VOLUME = NDalicPINVOKE.VideoView_Property_VOLUME_get();
193 public VideoView () : this (NDalicPINVOKE.VideoView_New__SWIG_0(), true) {
194 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
197 public VideoView (string url) : this (NDalicPINVOKE.VideoView_New__SWIG_1(url), true) {
198 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
201 public VideoView(VideoView videoView) : this(NDalicPINVOKE.new_VideoView__SWIG_1(VideoView.getCPtr(videoView)), true) {
202 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
205 public VideoView Assign(VideoView videoView) {
206 VideoView ret = new VideoView(NDalicPINVOKE.VideoView_Assign(swigCPtr, VideoView.getCPtr(videoView)), false);
207 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
211 public new static VideoView DownCast(BaseHandle handle) {
212 VideoView ret = new VideoView(NDalicPINVOKE.VideoView_DownCast(BaseHandle.getCPtr(handle)), true);
213 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
218 NDalicPINVOKE.VideoView_Play(swigCPtr);
219 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
222 public void Pause() {
223 NDalicPINVOKE.VideoView_Pause(swigCPtr);
224 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
228 NDalicPINVOKE.VideoView_Stop(swigCPtr);
229 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
232 public void Forward(int millisecond) {
233 NDalicPINVOKE.VideoView_Forward(swigCPtr, millisecond);
234 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
237 public void Backward(int millisecond) {
238 NDalicPINVOKE.VideoView_Backward(swigCPtr, millisecond);
239 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
242 public VideoViewSignal FinishedSignal() {
243 VideoViewSignal ret = new VideoViewSignal(NDalicPINVOKE.VideoView_FinishedSignal(swigCPtr), false);
244 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
248 public enum PropertyRange {
249 PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX
252 public Dali.Property.Map Video
256 Dali.Property.Map temp = new Dali.Property.Map();
257 GetProperty( VideoView.Property.VIDEO).Get( temp );
262 SetProperty( VideoView.Property.VIDEO, new Dali.Property.Value( value ) );
270 GetProperty( VideoView.Property.LOOPING).Get( ref temp );
275 SetProperty( VideoView.Property.LOOPING, new Dali.Property.Value( value ) );
283 GetProperty( VideoView.Property.MUTED).Get( ref temp );
288 SetProperty( VideoView.Property.MUTED, new Dali.Property.Value( value ) );
291 public Dali.Property.Map Volume
295 Dali.Property.Map temp = new Dali.Property.Map();
296 GetProperty( VideoView.Property.VOLUME).Get( temp );
301 SetProperty( VideoView.Property.VOLUME, new Dali.Property.Value( value ) );