New directory structure for C#
[platform/core/uifw/dali-toolkit.git] / plugins / dali-sharp / sharp / internal / VideoView.cs
1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
2 *
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
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
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.
14 *
15 */
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
18 // <auto-generated />
19 //
20 // This file was automatically generated by SWIG (http://www.swig.org).
21 // Version 3.0.10
22 //
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
26
27 namespace Dali {
28
29 using System;
30 using System.Runtime.InteropServices;
31
32
33 public class VideoView : View {
34   private global::System.Runtime.InteropServices.HandleRef swigCPtr;
35
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);
38   }
39
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;
42   }
43
44   ~VideoView() {
45     DisposeQueue.Instance.Add(this);
46   }
47
48   public override void Dispose() {
49     if (!Stage.IsInstalled()) {
50       DisposeQueue.Instance.Add(this);
51       return;
52     }
53
54     lock(this) {
55       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
56         if (swigCMemOwn) {
57           swigCMemOwn = false;
58           NDalicPINVOKE.delete_VideoView(swigCPtr);
59         }
60         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
61       }
62       global::System.GC.SuppressFinalize(this);
63       base.Dispose();
64     }
65   }
66
67
68
69 /**
70   * @brief Event arguments that passed via Finished signal
71   *
72   */
73 public class FinishedEventArgs : EventArgs
74 {
75    private VideoView _videoView;
76
77    /**
78      * @brief VideoView - VideoView is a control for video playback and display.
79      *
80      */
81    public VideoView VideoView
82    {
83       get
84       {
85          return _videoView;
86       }
87       set
88       {
89          _videoView = value;
90       }
91    }
92 }
93
94
95   [UnmanagedFunctionPointer(CallingConvention.StdCall)]
96   private delegate void FinishedCallbackDelegate(IntPtr data);
97   private DaliEventHandler<object,FinishedEventArgs> _videoViewFinishedEventHandler;
98   private FinishedCallbackDelegate _videoViewFinishedCallbackDelegate;
99
100   /**
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.
104     */
105   public event DaliEventHandler<object,FinishedEventArgs> Finished
106   {
107      add
108      {
109         lock(this)
110         {
111            // Restricted to only one listener
112            if (_videoViewFinishedEventHandler == null)
113            {
114               _videoViewFinishedEventHandler += value;
115
116               _videoViewFinishedCallbackDelegate = new FinishedCallbackDelegate(OnFinished);
117               this.FinishedSignal().Connect(_videoViewFinishedCallbackDelegate);
118            }
119         }
120      }
121
122      remove
123      {
124         lock(this)
125         {
126            if (_videoViewFinishedEventHandler != null)
127            {
128               this.FinishedSignal().Disconnect(_videoViewFinishedCallbackDelegate);
129            }
130
131            _videoViewFinishedEventHandler -= value;
132         }
133      }
134   }
135
136   // Callback for VideoView Finished signal
137   private void OnFinished(IntPtr data)
138   {
139      FinishedEventArgs e = new FinishedEventArgs();
140
141      // Populate all members of "e" (FinishedEventArgs) with real data
142      e.VideoView = VideoView.GetVideoViewFromPtr( data );
143
144      if (_videoViewFinishedEventHandler != null)
145      {
146         //here we send all data to user event handlers
147         _videoViewFinishedEventHandler(this, e);
148      }
149   }
150
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();
154     return ret;
155   }
156
157
158   public class Property : global::System.IDisposable {
159     private global::System.Runtime.InteropServices.HandleRef swigCPtr;
160     protected bool swigCMemOwn;
161   
162     internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) {
163       swigCMemOwn = cMemoryOwn;
164       swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
165     }
166   
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;
169     }
170   
171     ~Property() {
172       Dispose();
173     }
174   
175     public virtual void Dispose() {
176       lock(this) {
177         if (swigCPtr.Handle != global::System.IntPtr.Zero) {
178           if (swigCMemOwn) {
179             swigCMemOwn = false;
180             NDalicPINVOKE.delete_VideoView_Property(swigCPtr);
181           }
182           swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
183         }
184         global::System.GC.SuppressFinalize(this);
185       }
186     }
187   
188     public Property() : this(NDalicPINVOKE.new_VideoView_Property(), true) {
189       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
190     }
191   
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();
196   
197   }
198
199   public VideoView () : this (NDalicPINVOKE.VideoView_New__SWIG_0(), true) {
200       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
201
202   }
203   public VideoView (string url) : this (NDalicPINVOKE.VideoView_New__SWIG_1(url), true) {
204       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
205
206   }
207   public VideoView(VideoView videoView) : this(NDalicPINVOKE.new_VideoView__SWIG_1(VideoView.getCPtr(videoView)), true) {
208     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
209   }
210
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();
214     return ret;
215   }
216
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();
220     return ret;
221   }
222
223   public void Play() {
224     NDalicPINVOKE.VideoView_Play(swigCPtr);
225     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
226   }
227
228   public void Pause() {
229     NDalicPINVOKE.VideoView_Pause(swigCPtr);
230     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
231   }
232
233   public void Stop() {
234     NDalicPINVOKE.VideoView_Stop(swigCPtr);
235     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
236   }
237
238   public void Forward(int millisecond) {
239     NDalicPINVOKE.VideoView_Forward(swigCPtr, millisecond);
240     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
241   }
242
243   public void Backward(int millisecond) {
244     NDalicPINVOKE.VideoView_Backward(swigCPtr, millisecond);
245     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
246   }
247
248   public VideoViewSignal FinishedSignal() {
249     VideoViewSignal ret = new VideoViewSignal(NDalicPINVOKE.VideoView_FinishedSignal(swigCPtr), false);
250     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
251     return ret;
252   }
253
254   public enum PropertyRange {
255     PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX
256   }
257
258   public Dali.Property.Map Video
259   {
260     get
261     {
262       Dali.Property.Map temp = new Dali.Property.Map();
263       GetProperty( VideoView.Property.VIDEO).Get(  temp );
264       return temp;
265     }
266     set
267     {
268       SetProperty( VideoView.Property.VIDEO, new Dali.Property.Value( value ) );
269     }
270   }
271   public bool Looping
272   {
273     get
274     {
275       bool temp = false;
276       GetProperty( VideoView.Property.LOOPING).Get( ref temp );
277       return temp;
278     }
279     set
280     {
281       SetProperty( VideoView.Property.LOOPING, new Dali.Property.Value( value ) );
282     }
283   }
284   public bool Muted
285   {
286     get
287     {
288       bool temp = false;
289       GetProperty( VideoView.Property.MUTED).Get( ref temp );
290       return temp;
291     }
292     set
293     {
294       SetProperty( VideoView.Property.MUTED, new Dali.Property.Value( value ) );
295     }
296   }
297   public Dali.Property.Map Volume
298   {
299     get
300     {
301       Dali.Property.Map temp = new Dali.Property.Map();
302       GetProperty( VideoView.Property.VOLUME).Get(  temp );
303       return temp;
304     }
305     set
306     {
307       SetProperty( VideoView.Property.VOLUME, new Dali.Property.Value( value ) );
308     }
309   }
310
311 }
312
313 }