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