dali 1.2.28 version upgrade
[platform/core/csapi/nui.git] / Tizen.NUI / src / public / VideoView.cs
1 // Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
2 // PROPRIETARY/CONFIDENTIAL 
3 // This software is the confidential and proprietary
4 // information of SAMSUNG ELECTRONICS ("Confidential Information"). You shall
5 // not disclose such Confidential Information and shall use it only in
6 // accordance with the terms of the license agreement you entered into with
7 // SAMSUNG ELECTRONICS. SAMSUNG make no representations or warranties about the
8 // suitability of the software, either express or implied, including but not
9 // limited to the implied warranties of merchantability, fitness for a
10 // particular purpose, or non-infringement. SAMSUNG shall not be liable for any
11 // damages suffered by licensee as a result of using, modifying or distributing
12 // this software or its derivatives.
13
14 // Copyright (c) 2017 Samsung Electronics Co., Ltd.
15 //
16 // Licensed under the Apache License, Version 2.0 (the "License");
17 // you may not use this file except in compliance with the License.
18 // You may obtain a copy of the License at
19 //
20 // http://www.apache.org/licenses/LICENSE-2.0
21 //
22 // Unless required by applicable law or agreed to in writing, software
23 // distributed under the License is distributed on an "AS IS" BASIS,
24 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25 // See the License for the specific language governing permissions and
26 // limitations under the License.
27 //
28
29 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
30 // Some have been manually changed
31
32
33 namespace Tizen.NUI
34 {
35
36     using System;
37     using System.Runtime.InteropServices;
38
39
40     public class VideoView : View
41     {
42         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
43
44         internal VideoView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.VideoView_SWIGUpcast(cPtr), cMemoryOwn)
45         {
46             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
47         }
48
49         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(VideoView obj)
50         {
51             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
52         }
53
54         ~VideoView()
55         {
56             DisposeQueue.Instance.Add(this);
57         }
58
59         public override void Dispose()
60         {
61             if (!Stage.IsInstalled())
62             {
63                 DisposeQueue.Instance.Add(this);
64                 return;
65             }
66
67             lock (this)
68             {
69                 if (swigCPtr.Handle != global::System.IntPtr.Zero)
70                 {
71                     if (swigCMemOwn)
72                     {
73                         swigCMemOwn = false;
74                         NDalicPINVOKE.delete_VideoView(swigCPtr);
75                     }
76                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
77                 }
78                 global::System.GC.SuppressFinalize(this);
79                 base.Dispose();
80             }
81         }
82
83
84
85         /**
86           * @brief Event arguments that passed via Finished signal
87           *
88           */
89         public class FinishedEventArgs : EventArgs
90         {
91             private VideoView _videoView;
92
93             /**
94               * @brief VideoView - VideoView is a control for video playback and display.
95               *
96               */
97             public VideoView VideoView
98             {
99                 get
100                 {
101                     return _videoView;
102                 }
103                 set
104                 {
105                     _videoView = value;
106                 }
107             }
108         }
109
110
111         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
112         private delegate void FinishedCallback(IntPtr data);
113         private FinishedCallback _videoViewFinishedCallback;
114         private EventHandler<FinishedEventArgs> _videoViewFinishedEventHandler;
115
116
117         /**
118           * @brief Event for Finished signal which can be used to subscribe/unsubscribe the event handler
119           * (in the type of FinishedEventHandler-DaliEventHandler<object,FinishedEventArgs>) provided by the user.
120           * Finished signal is emitted when a video playback have finished.
121           */
122         public event EventHandler<FinishedEventArgs> Finished
123         {
124             add
125             {
126                 if (_videoViewFinishedCallback == null)
127                 {
128                     _videoViewFinishedCallback = OnFinished;
129                     FinishedSignal().Connect(_videoViewFinishedCallback);
130                 }
131                 _videoViewFinishedEventHandler += value;
132             }
133             remove
134             {
135                 if (_videoViewFinishedCallback != null)
136                 {
137                     FinishedSignal().Disconnect(_videoViewFinishedCallback);
138                 }
139                 _videoViewFinishedEventHandler -= value;
140             }
141         }
142
143         private void OnFinished(IntPtr data)
144         {
145             FinishedEventArgs e = new FinishedEventArgs();
146
147             e.VideoView = VideoView.GetVideoViewFromPtr(data);
148
149             if (_videoViewFinishedEventHandler != null)
150             {
151                 _videoViewFinishedEventHandler(this, e);
152             }
153         }
154
155         internal static VideoView GetVideoViewFromPtr(global::System.IntPtr cPtr)
156         {
157             VideoView ret = new VideoView(cPtr, false);
158             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
159             return ret;
160         }
161
162
163         internal class Property : global::System.IDisposable
164         {
165             private global::System.Runtime.InteropServices.HandleRef swigCPtr;
166             protected bool swigCMemOwn;
167
168             internal Property(global::System.IntPtr cPtr, bool cMemoryOwn)
169             {
170                 swigCMemOwn = cMemoryOwn;
171                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
172             }
173
174             internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj)
175             {
176                 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
177             }
178
179             ~Property()
180             {
181                 Dispose();
182             }
183
184             public virtual void Dispose()
185             {
186                 lock (this)
187                 {
188                     if (swigCPtr.Handle != global::System.IntPtr.Zero)
189                     {
190                         if (swigCMemOwn)
191                         {
192                             swigCMemOwn = false;
193                             NDalicPINVOKE.delete_VideoView_Property(swigCPtr);
194                         }
195                         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
196                     }
197                     global::System.GC.SuppressFinalize(this);
198                 }
199             }
200
201             internal Property() : this(NDalicPINVOKE.new_VideoView_Property(), true)
202             {
203                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
204             }
205
206             internal static readonly int VIDEO = NDalicPINVOKE.VideoView_Property_VIDEO_get();
207             internal static readonly int LOOPING = NDalicPINVOKE.VideoView_Property_LOOPING_get();
208             internal static readonly int MUTED = NDalicPINVOKE.VideoView_Property_MUTED_get();
209             internal static readonly int VOLUME = NDalicPINVOKE.VideoView_Property_VOLUME_get();
210
211         }
212
213         public VideoView() : this(NDalicPINVOKE.VideoView_New__SWIG_0(), true)
214         {
215             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
216
217         }
218         public VideoView(string url) : this(NDalicPINVOKE.VideoView_New__SWIG_1(url), true)
219         {
220             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
221
222         }
223         internal VideoView(VideoView videoView) : this(NDalicPINVOKE.new_VideoView__SWIG_1(VideoView.getCPtr(videoView)), true)
224         {
225             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
226         }
227
228         internal VideoView Assign(VideoView videoView)
229         {
230             VideoView ret = new VideoView(NDalicPINVOKE.VideoView_Assign(swigCPtr, VideoView.getCPtr(videoView)), false);
231             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
232             return ret;
233         }
234
235         public new static VideoView DownCast(BaseHandle handle)
236         {
237             VideoView ret = new VideoView(NDalicPINVOKE.VideoView_DownCast(BaseHandle.getCPtr(handle)), true);
238             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
239             return ret;
240         }
241
242         public void Play()
243         {
244             NDalicPINVOKE.VideoView_Play(swigCPtr);
245             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
246         }
247
248         public void Pause()
249         {
250             NDalicPINVOKE.VideoView_Pause(swigCPtr);
251             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
252         }
253
254         public void Stop()
255         {
256             NDalicPINVOKE.VideoView_Stop(swigCPtr);
257             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
258         }
259
260         public void Forward(int millisecond)
261         {
262             NDalicPINVOKE.VideoView_Forward(swigCPtr, millisecond);
263             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
264         }
265
266         public void Backward(int millisecond)
267         {
268             NDalicPINVOKE.VideoView_Backward(swigCPtr, millisecond);
269             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
270         }
271
272         internal VideoViewSignal FinishedSignal()
273         {
274             VideoViewSignal ret = new VideoViewSignal(NDalicPINVOKE.VideoView_FinishedSignal(swigCPtr), false);
275             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
276             return ret;
277         }
278
279         internal enum PropertyRange
280         {
281             PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX
282         }
283
284         public PropertyMap Video
285         {
286             get
287             {
288                 PropertyMap temp = new PropertyMap();
289                 GetProperty(VideoView.Property.VIDEO).Get(temp);
290                 return temp;
291             }
292             set
293             {
294                 SetProperty(VideoView.Property.VIDEO, new Tizen.NUI.PropertyValue(value));
295             }
296         }
297         public bool Looping
298         {
299             get
300             {
301                 bool temp = false;
302                 GetProperty(VideoView.Property.LOOPING).Get(ref temp);
303                 return temp;
304             }
305             set
306             {
307                 SetProperty(VideoView.Property.LOOPING, new Tizen.NUI.PropertyValue(value));
308             }
309         }
310         public bool Muted
311         {
312             get
313             {
314                 bool temp = false;
315                 GetProperty(VideoView.Property.MUTED).Get(ref temp);
316                 return temp;
317             }
318             set
319             {
320                 SetProperty(VideoView.Property.MUTED, new Tizen.NUI.PropertyValue(value));
321             }
322         }
323         public PropertyMap Volume
324         {
325             get
326             {
327                 PropertyMap temp = new PropertyMap();
328                 GetProperty(VideoView.Property.VOLUME).Get(temp);
329                 return temp;
330             }
331             set
332             {
333                 SetProperty(VideoView.Property.VOLUME, new Tizen.NUI.PropertyValue(value));
334             }
335         }
336
337     }
338
339 }