Calculate a new height when text was changed.
[platform/core/uifw/dali-toolkit.git] / plugins / dali-sharp / sharp / public / 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 (!Window.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   internal 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
159   {
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();
164   
165   }
166
167   public VideoView () : this (NDalicPINVOKE.VideoView_New__SWIG_0(), true) {
168       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
169
170   }
171   public VideoView (string url) : this (NDalicPINVOKE.VideoView_New__SWIG_1(url), true) {
172       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
173
174   }
175   public VideoView(VideoView videoView) : this(NDalicPINVOKE.new_VideoView__SWIG_1(VideoView.getCPtr(videoView)), true) {
176     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
177   }
178
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();
182     return ret;
183   }
184
185   public void Play() {
186     NDalicPINVOKE.VideoView_Play(swigCPtr);
187     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
188   }
189
190   public void Pause() {
191     NDalicPINVOKE.VideoView_Pause(swigCPtr);
192     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
193   }
194
195   public void Stop() {
196     NDalicPINVOKE.VideoView_Stop(swigCPtr);
197     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
198   }
199
200   public void Forward(int millisecond) {
201     NDalicPINVOKE.VideoView_Forward(swigCPtr, millisecond);
202     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
203   }
204
205   public void Backward(int millisecond) {
206     NDalicPINVOKE.VideoView_Backward(swigCPtr, millisecond);
207     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
208   }
209
210   internal VideoViewSignal FinishedSignal() {
211     VideoViewSignal ret = new VideoViewSignal(NDalicPINVOKE.VideoView_FinishedSignal(swigCPtr), false);
212     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
213     return ret;
214   }
215
216   public Dali.Property.Map Video
217   {
218     get
219     {
220       Dali.Property.Map temp = new Dali.Property.Map();
221       GetProperty( VideoView.Property.VIDEO).Get(  temp );
222       return temp;
223     }
224     set
225     {
226       SetProperty( VideoView.Property.VIDEO, new Dali.Property.Value( value ) );
227     }
228   }
229   public bool Looping
230   {
231     get
232     {
233       bool temp = false;
234       GetProperty( VideoView.Property.LOOPING).Get( out temp );
235       return temp;
236     }
237     set
238     {
239       SetProperty( VideoView.Property.LOOPING, new Dali.Property.Value( value ) );
240     }
241   }
242   public bool Muted
243   {
244     get
245     {
246       bool temp = false;
247       GetProperty( VideoView.Property.MUTED).Get( out temp );
248       return temp;
249     }
250     set
251     {
252       SetProperty( VideoView.Property.MUTED, new Dali.Property.Value( value ) );
253     }
254   }
255   public Dali.Property.Map Volume
256   {
257     get
258     {
259       Dali.Property.Map temp = new Dali.Property.Map();
260       GetProperty( VideoView.Property.VOLUME).Get(  temp );
261       return temp;
262     }
263     set
264     {
265       SetProperty( VideoView.Property.VOLUME, new Dali.Property.Value( value ) );
266     }
267   }
268
269 }
270
271 }