Merge "C# CustomView Implementation (C++ wrappers, manual bindings, C# wrappers)...
[platform/core/uifw/dali-toolkit.git] / plugins / dali-swig / automatic / csharp / VideoView.cs
1 /** Copyright (c) 2016 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.9
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     Dispose();
46   }
47
48   public override void Dispose() {
49     lock(this) {
50       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
51         if (swigCMemOwn) {
52           swigCMemOwn = false;
53           NDalicPINVOKE.delete_VideoView(swigCPtr);
54         }
55         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
56       }
57       global::System.GC.SuppressFinalize(this);
58       base.Dispose();
59     }
60   }
61
62
63 /**
64   * @brief Event arguments that passed via Finished signal
65   *
66   */
67 public class FinishedEventArgs : EventArgs
68 {
69    private VideoView _videoView;
70
71    /**
72      * @brief VideoView - VideoView is a control for video playback and display.
73      *
74      */
75    public VideoView VideoView
76    {
77       get
78       {
79          return _videoView;
80       }
81       set
82       {
83          _videoView = value;
84       }
85    }
86 }
87
88
89   [UnmanagedFunctionPointer(CallingConvention.StdCall)]
90   private delegate void FinishedCallbackDelegate(IntPtr data);
91   private DaliEventHandler<object,FinishedEventArgs> _videoViewFinishedEventHandler;
92   private FinishedCallbackDelegate _videoViewFinishedCallbackDelegate;
93
94   /**
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.
98     */
99   public event DaliEventHandler<object,FinishedEventArgs> Finished
100   {
101      add
102      {
103         lock(this)
104         {
105            // Restricted to only one listener
106            if (_videoViewFinishedEventHandler == null)
107            {
108               _videoViewFinishedEventHandler += value;
109
110               _videoViewFinishedCallbackDelegate = new FinishedCallbackDelegate(OnFinished);
111               this.FinishedSignal().Connect(_videoViewFinishedCallbackDelegate);
112            }
113         }
114      }
115
116      remove
117      {
118         lock(this)
119         {
120            if (_videoViewFinishedEventHandler != null)
121            {
122               this.FinishedSignal().Disconnect(_videoViewFinishedCallbackDelegate);
123            }
124
125            _videoViewFinishedEventHandler -= value;
126         }
127      }
128   }
129
130   // Callback for VideoView Finished signal
131   private void OnFinished(IntPtr data)
132   {
133      FinishedEventArgs e = new FinishedEventArgs();
134
135      // Populate all members of "e" (FinishedEventArgs) with real data
136      e.VideoView = VideoView.GetVideoViewFromPtr( data );
137
138      if (_videoViewFinishedEventHandler != null)
139      {
140         //here we send all data to user event handlers
141         _videoViewFinishedEventHandler(this, e);
142      }
143   }
144
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();
148     return ret;
149   }
150
151
152   public class Property : global::System.IDisposable {
153     private global::System.Runtime.InteropServices.HandleRef swigCPtr;
154     protected bool swigCMemOwn;
155   
156     internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) {
157       swigCMemOwn = cMemoryOwn;
158       swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
159     }
160   
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;
163     }
164   
165     ~Property() {
166       Dispose();
167     }
168   
169     public virtual void Dispose() {
170       lock(this) {
171         if (swigCPtr.Handle != global::System.IntPtr.Zero) {
172           if (swigCMemOwn) {
173             swigCMemOwn = false;
174             NDalicPINVOKE.delete_VideoView_Property(swigCPtr);
175           }
176           swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
177         }
178         global::System.GC.SuppressFinalize(this);
179       }
180     }
181   
182     public Property() : this(NDalicPINVOKE.new_VideoView_Property(), true) {
183       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
184     }
185   
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();
190   
191   }
192
193   public VideoView () : this (NDalicPINVOKE.VideoView_New__SWIG_0(), true) {
194       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
195
196   }
197   public VideoView (string url) : this (NDalicPINVOKE.VideoView_New__SWIG_1(url), true) {
198       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
199
200   }
201   public VideoView(VideoView videoView) : this(NDalicPINVOKE.new_VideoView__SWIG_1(VideoView.getCPtr(videoView)), true) {
202     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
203   }
204
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();
208     return ret;
209   }
210
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();
214     return ret;
215   }
216
217   public void Play() {
218     NDalicPINVOKE.VideoView_Play(swigCPtr);
219     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
220   }
221
222   public void Pause() {
223     NDalicPINVOKE.VideoView_Pause(swigCPtr);
224     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
225   }
226
227   public void Stop() {
228     NDalicPINVOKE.VideoView_Stop(swigCPtr);
229     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
230   }
231
232   public void Forward(int millisecond) {
233     NDalicPINVOKE.VideoView_Forward(swigCPtr, millisecond);
234     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
235   }
236
237   public void Backward(int millisecond) {
238     NDalicPINVOKE.VideoView_Backward(swigCPtr, millisecond);
239     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
240   }
241
242   public VideoViewSignal FinishedSignal() {
243     VideoViewSignal ret = new VideoViewSignal(NDalicPINVOKE.VideoView_FinishedSignal(swigCPtr), false);
244     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
245     return ret;
246   }
247
248   public enum PropertyRange {
249     PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX
250   }
251
252   public Dali.Property.Map Video 
253   { 
254     get 
255     {
256       Dali.Property.Map temp = new Dali.Property.Map();
257       GetProperty( VideoView.Property.VIDEO).Get(  temp );
258       return temp;
259     }
260     set 
261     { 
262       SetProperty( VideoView.Property.VIDEO, new Dali.Property.Value( value ) );
263     }
264   }
265   public bool Looping 
266   { 
267     get 
268     {
269       bool temp = false;
270       GetProperty( VideoView.Property.LOOPING).Get( ref temp );
271       return temp;
272     }
273     set 
274     { 
275       SetProperty( VideoView.Property.LOOPING, new Dali.Property.Value( value ) );
276     }
277   }
278   public bool Muted 
279   { 
280     get 
281     {
282       bool temp = false;
283       GetProperty( VideoView.Property.MUTED).Get( ref temp );
284       return temp;
285     }
286     set 
287     { 
288       SetProperty( VideoView.Property.MUTED, new Dali.Property.Value( value ) );
289     }
290   }
291   public Dali.Property.Map Volume 
292   { 
293     get 
294     {
295       Dali.Property.Map temp = new Dali.Property.Map();
296       GetProperty( VideoView.Property.VOLUME).Get(  temp );
297       return temp;
298     }
299     set 
300     { 
301       SetProperty( VideoView.Property.VOLUME, new Dali.Property.Value( value ) );
302     }
303   }
304
305 }
306
307 }