Revert "[NUI] Add BindableProperties to all public Properties"
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Widget / WidgetView.cs
1 /*
2  * Copyright(c) 2021 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 using System.ComponentModel;
18
19 namespace Tizen.NUI
20 {
21     using System;
22     using System.Runtime.InteropServices;
23     using Tizen.NUI.BaseComponents;
24
25     /// <summary>
26     /// The WidgetView is a class for displaying the widget image and controlling the widget.<br />
27     /// Input events that the WidgetView gets are delivered to the widget.
28     /// </summary>
29     /// <since_tizen> 3 </since_tizen>
30     public class WidgetView : View
31     {
32         private EventHandler<WidgetViewEventArgs> widgetAddedEventHandler;
33         private WidgetAddedEventCallbackType widgetAddedEventCallback;
34         private EventHandler<WidgetViewEventArgs> widgetContentUpdatedEventHandler;
35         private WidgetContentUpdatedEventCallbackType widgetContentUpdatedEventCallback;
36         private EventHandler<WidgetViewEventArgs> widgetDeletedEventHandler;
37         private WidgetDeletedEventCallbackType widgetDeletedEventCallback;
38         private EventHandler<WidgetViewEventArgs> widgetCreationAbortedEventHandler;
39         private WidgetCreationAbortedEventCallbackType widgetCreationAbortedEventCallback;
40         private EventHandler<WidgetViewEventArgs> widgetUpdatePeriodChangedEventHandler;
41         private WidgetUpdatePeriodChangedEventCallbackType widgetUpdatePeriodChangedEventCallback;
42         private EventHandler<WidgetViewEventArgs> widgetFaultedEventHandler;
43         private WidgetFaultedEventCallbackType widgetFaultedEventCallback;
44
45         /// <summary>
46         /// Used in xaml as factory method to create WidgetView.
47         /// </summary>
48         /// <param name="widgetId"></param>
49         /// <param name="contentInfo"></param>
50         /// <param name="width"></param>
51         /// <param name="height"></param>
52         /// <param name="updatePeriod"></param>
53         /// <returns></returns>
54         [EditorBrowsable(EditorBrowsableState.Never)]
55         public static WidgetView CreateWidgetView(string widgetId, string contentInfo, int width, int height, float updatePeriod)
56         {
57             return WidgetViewManager.Instance.AddWidget(widgetId, contentInfo, width, height, updatePeriod);
58         }
59
60         /// <summary>
61         /// Creates a new WidgetView.
62         /// </summary>
63         /// <since_tizen> 3 </since_tizen>
64         public WidgetView(string widgetId, string contentInfo, int width, int height, float updatePeriod) : this(Interop.WidgetView.New(widgetId, contentInfo, width, height, updatePeriod), true)
65         {
66             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
67
68         }
69
70         internal WidgetView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
71         {
72         }
73         internal WidgetView(WidgetView handle) : this(Interop.WidgetView.NewWidgetView(WidgetView.getCPtr(handle)), true)
74         {
75             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
76         }
77
78         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
79         private delegate void WidgetAddedEventCallbackType(IntPtr data);
80         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
81         private delegate void WidgetContentUpdatedEventCallbackType(IntPtr data);
82         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
83         private delegate void WidgetDeletedEventCallbackType(IntPtr data);
84         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
85         private delegate void WidgetCreationAbortedEventCallbackType(IntPtr data);
86         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
87         private delegate void WidgetUpdatePeriodChangedEventCallbackType(IntPtr data);
88         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
89         private delegate void WidgetFaultedEventCallbackType(IntPtr data);
90
91         /// <summary>
92         /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
93         /// This signal is emitted after all resources required by a control are loaded and ready.<br />
94         /// Most resources are only loaded when the control is placed on the stage.<br />
95         /// </summary>
96         /// <since_tizen> 3 </since_tizen>
97         public event EventHandler<WidgetViewEventArgs> WidgetAdded
98         {
99             add
100             {
101                 if (widgetAddedEventHandler == null)
102                 {
103                     widgetAddedEventCallback = OnWidgetAdded;
104                     WidgetViewSignal widgetAdded = WidgetAddedSignal();
105                     widgetAdded?.Connect(widgetAddedEventCallback);
106                     widgetAdded?.Dispose();
107                 }
108
109                 widgetAddedEventHandler += value;
110             }
111
112             remove
113             {
114                 widgetAddedEventHandler -= value;
115
116                 WidgetViewSignal widgetAdded = WidgetAddedSignal();
117                 if (widgetAddedEventHandler == null && widgetAdded?.Empty() == false)
118                 {
119                     widgetAdded?.Disconnect(widgetAddedEventCallback);
120                 }
121                 widgetAdded?.Dispose();
122             }
123         }
124
125         /// <summary>
126         /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
127         /// This signal is emitted after all resources required by a control are loaded and ready.<br />
128         /// Most resources are only loaded when the control is placed on the stage.<br />
129         /// </summary>
130         /// <since_tizen> 3 </since_tizen>
131         public event EventHandler<WidgetViewEventArgs> WidgetContentUpdated
132         {
133             add
134             {
135                 if (widgetContentUpdatedEventHandler == null)
136                 {
137                     widgetContentUpdatedEventCallback = OnWidgetContentUpdated;
138                     WidgetViewSignal widgetContentUpdated = WidgetContentUpdatedSignal();
139                     widgetContentUpdated?.Connect(widgetContentUpdatedEventCallback);
140                     widgetContentUpdated?.Dispose();
141                 }
142
143                 widgetContentUpdatedEventHandler += value;
144             }
145
146             remove
147             {
148                 widgetContentUpdatedEventHandler -= value;
149
150                 WidgetViewSignal widgetContentUpdated = WidgetContentUpdatedSignal();
151                 if (widgetContentUpdatedEventHandler == null && widgetContentUpdated?.Empty() == false)
152                 {
153                     widgetContentUpdated?.Disconnect(widgetContentUpdatedEventCallback);
154                 }
155                 widgetContentUpdated?.Dispose();
156             }
157         }
158
159         /// <summary>
160         /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
161         /// This signal is emitted after all resources required by a control are loaded and ready.<br />
162         /// Most resources are only loaded when the control is placed on the stage.<br />
163         /// </summary>
164         /// <since_tizen> 3 </since_tizen>
165         public event EventHandler<WidgetViewEventArgs> WidgetDeleted
166         {
167             add
168             {
169                 if (widgetDeletedEventHandler == null)
170                 {
171                     widgetDeletedEventCallback = OnWidgetDeleted;
172                     WidgetViewSignal widgetDeleted = WidgetDeletedSignal();
173                     widgetDeleted?.Connect(widgetDeletedEventCallback);
174                     widgetDeleted?.Dispose();
175                 }
176
177                 widgetDeletedEventHandler += value;
178             }
179
180             remove
181             {
182                 widgetDeletedEventHandler -= value;
183
184                 WidgetViewSignal widgetDeleted = WidgetDeletedSignal();
185                 if (widgetDeletedEventHandler == null && widgetDeleted?.Empty() == false)
186                 {
187                     widgetDeleted?.Disconnect(widgetDeletedEventCallback);
188                 }
189                 widgetDeleted?.Dispose();
190             }
191         }
192
193         /// <summary>
194         /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
195         /// This signal is emitted after all resources required by a control are loaded and ready.<br />
196         /// Most resources are only loaded when the control is placed on the stage.<br />
197         /// </summary>
198         /// <since_tizen> 3 </since_tizen>
199         public event EventHandler<WidgetViewEventArgs> WidgetCreationAborted
200         {
201             add
202             {
203                 if (widgetCreationAbortedEventHandler == null)
204                 {
205                     widgetCreationAbortedEventCallback = OnWidgetCreationAborted;
206                     WidgetViewSignal widgetCreationAborted = WidgetCreationAbortedSignal();
207                     widgetCreationAborted?.Connect(widgetCreationAbortedEventCallback);
208                     widgetCreationAborted?.Dispose();
209                 }
210
211                 widgetCreationAbortedEventHandler += value;
212             }
213
214             remove
215             {
216                 widgetCreationAbortedEventHandler -= value;
217
218                 WidgetViewSignal widgetCreationAborted = WidgetCreationAbortedSignal();
219                 if (widgetCreationAbortedEventHandler == null && widgetCreationAborted?.Empty() == false)
220                 {
221                     widgetCreationAborted?.Disconnect(widgetCreationAbortedEventCallback);
222                 }
223                 widgetCreationAborted?.Dispose();
224             }
225         }
226
227         /// <summary>
228         /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
229         /// This signal is emitted after all resources required by a control are loaded and ready.<br />
230         /// Most resources are only loaded when the control is placed on the stage.<br />
231         /// </summary>
232         /// <since_tizen> 3 </since_tizen>
233         public event EventHandler<WidgetViewEventArgs> WidgetUpdatePeriodChanged
234         {
235             add
236             {
237                 if (widgetUpdatePeriodChangedEventHandler == null)
238                 {
239                     widgetUpdatePeriodChangedEventCallback = OnWidgetUpdatePeriodChanged;
240                     WidgetViewSignal widgetUpdatePeriodChanged = WidgetUpdatePeriodChangedSignal();
241                     widgetUpdatePeriodChanged?.Connect(widgetUpdatePeriodChangedEventCallback);
242                     widgetUpdatePeriodChanged?.Dispose();
243                 }
244
245                 widgetUpdatePeriodChangedEventHandler += value;
246             }
247
248             remove
249             {
250                 widgetUpdatePeriodChangedEventHandler -= value;
251
252                 WidgetViewSignal widgetUpdatePeriodChanged = WidgetUpdatePeriodChangedSignal();
253                 if (widgetUpdatePeriodChangedEventHandler == null && widgetUpdatePeriodChanged?.Empty() == false)
254                 {
255                     widgetUpdatePeriodChanged?.Disconnect(widgetUpdatePeriodChangedEventCallback);
256                 }
257                 widgetUpdatePeriodChanged?.Dispose();
258             }
259         }
260
261         /// <summary>
262         /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
263         /// This signal is emitted after all resources required by a control are loaded and ready.<br />
264         /// Most resources are only loaded when the control is placed on the stage.<br />
265         /// </summary>
266         /// <since_tizen> 3 </since_tizen>
267         public event EventHandler<WidgetViewEventArgs> WidgetFaulted
268         {
269             add
270             {
271                 if (widgetFaultedEventHandler == null)
272                 {
273                     widgetFaultedEventCallback = OnWidgetFaulted;
274                     WidgetViewSignal widgetFaulted = WidgetFaultedSignal();
275                     widgetFaulted?.Connect(widgetFaultedEventCallback);
276                     widgetFaulted?.Dispose();
277                 }
278
279                 widgetFaultedEventHandler += value;
280             }
281
282             remove
283             {
284                 widgetFaultedEventHandler -= value;
285
286                 WidgetViewSignal widgetFaulted = WidgetFaultedSignal();
287                 if (widgetFaultedEventHandler == null && widgetFaulted?.Empty() == false)
288                 {
289                     widgetFaulted?.Disconnect(widgetFaultedEventCallback);
290                 }
291                 widgetFaulted?.Dispose();
292             }
293         }
294
295         /// <summary>
296         /// Gets the ID of the widget.
297         /// </summary>
298         /// <since_tizen> 3 </since_tizen>
299         public string WidgetID
300         {
301             get
302             {
303                 string retValue = "";
304                 PropertyValue widgetId = GetProperty(WidgetView.Property.WidgetId);
305                 widgetId?.Get(out retValue);
306                 widgetId?.Dispose();
307                 return retValue;
308             }
309         }
310
311         /// <summary>
312         /// Gets the ID of the instance.
313         /// </summary>
314         /// <since_tizen> 3 </since_tizen>
315         public string InstanceID
316         {
317             get
318             {
319                 string retValue = "";
320                 PropertyValue instanceId = GetProperty(WidgetView.Property.InstanceId);
321                 instanceId?.Get(out retValue);
322                 instanceId?.Dispose();
323                 return retValue;
324             }
325         }
326
327         /// <summary>
328         /// Gets the content info.
329         /// </summary>
330         /// <since_tizen> 3 </since_tizen>
331         public string ContentInfo
332         {
333             get
334             {
335                 string retValue = "";
336                 PropertyValue contentInfo = GetProperty(WidgetView.Property.ContentInfo);
337                 contentInfo?.Get(out retValue);
338                 contentInfo?.Dispose();
339                 return retValue;
340             }
341         }
342
343         /// <summary>
344         /// Gets the title.
345         /// </summary>
346         /// <since_tizen> 3 </since_tizen>
347         public string Title
348         {
349             get
350             {
351                 string retValue = "";
352                 PropertyValue title = GetProperty(WidgetView.Property.TITLE);
353                 title?.Get(out retValue);
354                 title?.Dispose();
355                 return retValue;
356             }
357         }
358
359         /// <summary>
360         /// Gets the update period.
361         /// </summary>
362         /// <since_tizen> 3 </since_tizen>
363         public float UpdatePeriod
364         {
365             get
366             {
367                 float retValue = 0;
368                 PropertyValue updatePeriod = GetProperty(WidgetView.Property.UpdatePeriod);
369                 updatePeriod?.Get(out retValue);
370                 updatePeriod?.Dispose();
371                 return retValue;
372             }
373         }
374
375         /// <summary>
376         /// Gets or sets the preview.
377         /// </summary>
378         /// <since_tizen> 3 </since_tizen>
379         public bool Preview
380         {
381             get
382             {
383                 bool retValue = false;
384                 PropertyValue preview = GetProperty(WidgetView.Property.PREVIEW);
385                 preview?.Get(out retValue);
386                 preview?.Dispose();
387                 return retValue;
388             }
389             set
390             {
391                 PropertyValue setValue = new Tizen.NUI.PropertyValue(value);
392                 SetProperty(WidgetView.Property.PREVIEW, setValue);
393                 setValue?.Dispose();
394             }
395         }
396
397         /// <summary>
398         /// Gets or sets the loading text.
399         /// </summary>
400         /// <since_tizen> 3 </since_tizen>
401         public bool LoadingText
402         {
403             get
404             {
405                 bool retValue = false;
406                 PropertyValue loadingText = GetProperty(WidgetView.Property.LoadingText);
407                 loadingText?.Get(out retValue);
408                 loadingText?.Dispose();
409                 return retValue;
410             }
411             set
412             {
413                 PropertyValue setValue = new Tizen.NUI.PropertyValue(value);
414                 SetProperty(WidgetView.Property.LoadingText, setValue);
415                 setValue?.Dispose();
416             }
417         }
418
419         /// <summary>
420         /// Gets or sets whether the widget state is faulted or not.
421         /// </summary>
422         /// <since_tizen> 3 </since_tizen>
423         public bool WidgetStateFaulted
424         {
425             get
426             {
427                 bool retValue = false;
428                 PropertyValue widgetStateFaulted = GetProperty(WidgetView.Property.WidgetStateFaulted);
429                 widgetStateFaulted?.Get(out retValue);
430                 widgetStateFaulted?.Dispose();
431                 return retValue;
432             }
433             set
434             {
435                 PropertyValue setValue = new Tizen.NUI.PropertyValue(value);
436                 SetProperty(WidgetView.Property.WidgetStateFaulted, setValue);
437                 setValue?.Dispose();
438             }
439         }
440
441         /// <summary>
442         /// Gets or sets whether the widget is to delete permanently or not.
443         /// </summary>
444         /// <since_tizen> 3 </since_tizen>
445         public bool PermanentDelete
446         {
447             get
448             {
449                 bool retValue = false;
450                 PropertyValue permanentDelete = GetProperty(WidgetView.Property.PermanentDelete);
451                 permanentDelete?.Get(out retValue);
452                 permanentDelete?.Dispose();
453                 return retValue;
454             }
455             set
456             {
457                 PropertyValue setValue = new Tizen.NUI.PropertyValue(value);
458                 SetProperty(WidgetView.Property.PermanentDelete, setValue);
459                 setValue.Dispose();
460             }
461         }
462
463         /// <summary>
464         /// Gets or sets retry text.
465         /// </summary>
466         /// <since_tizen> 4 </since_tizen>
467         public PropertyMap RetryText
468         {
469             get
470             {
471                 PropertyMap retValue = new PropertyMap();
472                 PropertyValue retryText = GetProperty(WidgetView.Property.RetryText);
473                 retryText?.Get(retValue);
474                 retryText?.Dispose();
475                 return retValue;
476             }
477             set
478             {
479                 PropertyValue setValue = new Tizen.NUI.PropertyValue(value);
480                 SetProperty(WidgetView.Property.RetryText, setValue);
481                 setValue?.Dispose();
482             }
483         }
484
485         /// <summary>
486         /// Gets or sets effect.
487         /// </summary>
488         /// <since_tizen> 4 </since_tizen>
489         public PropertyMap Effect
490         {
491             get
492             {
493                 PropertyMap retValue = new PropertyMap();
494                 PropertyValue effect = GetProperty(WidgetView.Property.EFFECT);
495                 effect?.Get(retValue);
496                 effect?.Dispose();
497                 return retValue;
498             }
499             set
500             {
501                 PropertyValue setValue = new Tizen.NUI.PropertyValue(value);
502                 SetProperty(WidgetView.Property.EFFECT, setValue);
503                 setValue?.Dispose();
504             }
505         }
506
507         /// <summary>
508         /// Pauses a given widget.
509         /// </summary>
510         /// <returns>True on success, false otherwise.</returns>
511         /// <since_tizen> 3 </since_tizen>
512         public bool PauseWidget()
513         {
514             bool ret = Interop.WidgetView.PauseWidget(SwigCPtr);
515             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
516             return ret;
517         }
518
519         /// <summary>
520         /// Resumes a given widget.
521         /// </summary>
522         /// <returns>True on success, false otherwise.</returns>
523         /// <since_tizen> 3 </since_tizen>
524         public bool ResumeWidget()
525         {
526             bool ret = Interop.WidgetView.ResumeWidget(SwigCPtr);
527             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
528             return ret;
529         }
530
531         /// <summary>
532         /// Cancels the touch event procedure.
533         /// If you call this function after feed the touch down event, the widget will get ON_HOLD events.
534         ///  If a widget gets ON_HOLD event, it will not do anything even if you feed touch up event.
535         /// </summary>
536         /// <returns>True on success, false otherwise.</returns>
537         /// <since_tizen> 3 </since_tizen>
538         public bool CancelTouchEvent()
539         {
540             bool ret = Interop.WidgetView.CancelTouchEvent(SwigCPtr);
541             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
542             return ret;
543         }
544
545         /// <summary>
546         /// Activates a widget in the faulted state.
547         /// A widget in faulted state must be activated before adding the widget.
548         /// </summary>
549         /// <since_tizen> 3 </since_tizen>
550         public void ActivateFaultedWidget()
551         {
552             Interop.WidgetView.ActivateFaultedWidget(SwigCPtr);
553             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
554         }
555
556         /// <summary>
557         /// Terminate a widget instance.
558         /// </summary>
559         /// <returns>True on success, false otherwise</returns>
560         /// <since_tizen> 4 </since_tizen>
561         public bool TerminateWidget()
562         {
563             bool ret = Interop.WidgetView.TerminateWidget(SwigCPtr);
564             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
565             return ret;
566         }
567
568         internal static WidgetView DownCast(BaseHandle handle)
569         {
570             WidgetView ret = new WidgetView(Interop.WidgetView.DownCast(BaseHandle.getCPtr(handle)), true);
571             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
572             return ret;
573         }
574
575         internal static WidgetView GetWidgetViewFromPtr(global::System.IntPtr cPtr)
576         {
577             WidgetView ret = new WidgetView(cPtr, false);
578             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
579             return ret;
580         }
581
582         internal WidgetView Assign(WidgetView handle)
583         {
584             WidgetView ret = new WidgetView(Interop.WidgetView.Assign(SwigCPtr, WidgetView.getCPtr(handle)), false);
585             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
586             return ret;
587         }
588
589         internal WidgetViewSignal WidgetAddedSignal()
590         {
591             WidgetViewSignal ret = new WidgetViewSignal(Interop.WidgetView.WidgetAddedSignal(SwigCPtr), false);
592             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
593             return ret;
594         }
595
596         internal WidgetViewSignal WidgetDeletedSignal()
597         {
598             WidgetViewSignal ret = new WidgetViewSignal(Interop.WidgetView.WidgetDeletedSignal(SwigCPtr), false);
599             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
600             return ret;
601         }
602
603         internal WidgetViewSignal WidgetCreationAbortedSignal()
604         {
605             WidgetViewSignal ret = new WidgetViewSignal(Interop.WidgetView.WidgetCreationAbortedSignal(SwigCPtr), false);
606             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
607             return ret;
608         }
609
610         internal WidgetViewSignal WidgetContentUpdatedSignal()
611         {
612             WidgetViewSignal ret = new WidgetViewSignal(Interop.WidgetView.WidgetContentUpdatedSignal(SwigCPtr), false);
613             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
614             return ret;
615         }
616
617         internal WidgetViewSignal WidgetUpdatePeriodChangedSignal()
618         {
619             WidgetViewSignal ret = new WidgetViewSignal(Interop.WidgetView.WidgetUpdatePeriodChangedSignal(SwigCPtr), false);
620             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
621             return ret;
622         }
623
624         internal WidgetViewSignal WidgetFaultedSignal()
625         {
626             WidgetViewSignal ret = new WidgetViewSignal(Interop.WidgetView.WidgetFaultedSignal(SwigCPtr), false);
627             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
628             return ret;
629         }
630
631         /// <summary>
632         /// To make the Button instance be disposed.
633         /// </summary>
634         /// <since_tizen> 3 </since_tizen>
635         protected override void Dispose(DisposeTypes type)
636         {
637             if (disposed)
638             {
639                 return;
640             }
641
642             //Release your own unmanaged resources here.
643             //You should not access any managed member here except static instance.
644             //because the execution order of Finalizes is non-deterministic.
645
646             if (widgetAddedEventCallback != null)
647             {
648                 WidgetViewSignal widgetAdded = this.WidgetAddedSignal();
649                 widgetAdded?.Disconnect(widgetAddedEventCallback);
650                 widgetAdded?.Dispose();
651             }
652
653             if (widgetContentUpdatedEventCallback != null)
654             {
655                 WidgetViewSignal widgetContentUpdated = this.WidgetContentUpdatedSignal();
656                 widgetContentUpdated?.Disconnect(widgetContentUpdatedEventCallback);
657                 widgetContentUpdated?.Dispose();
658             }
659
660             if (widgetCreationAbortedEventCallback != null)
661             {
662                 WidgetViewSignal widgetCreationAborted = this.WidgetCreationAbortedSignal();
663                 widgetCreationAborted?.Disconnect(widgetCreationAbortedEventCallback);
664                 widgetCreationAborted?.Dispose();
665             }
666
667             if (widgetDeletedEventCallback != null)
668             {
669                 WidgetViewSignal widgetDeleted = this.WidgetDeletedSignal();
670                 widgetDeleted?.Disconnect(widgetDeletedEventCallback);
671                 widgetDeleted?.Dispose();
672             }
673
674             if (widgetFaultedEventCallback != null)
675             {
676                 WidgetViewSignal widgetFaulted = this.WidgetFaultedSignal();
677                 widgetFaulted?.Disconnect(widgetFaultedEventCallback);
678                 widgetFaulted?.Dispose();
679             }
680
681             if (widgetUpdatePeriodChangedEventCallback != null)
682             {
683                 WidgetViewSignal widgetUpdatePeriodChanged = this.WidgetUpdatePeriodChangedSignal();
684                 widgetUpdatePeriodChanged?.Disconnect(widgetUpdatePeriodChangedEventCallback);
685                 widgetUpdatePeriodChanged?.Dispose();
686             }
687
688             base.Dispose(type);
689         }
690
691         /// This will not be public opened.
692         [EditorBrowsable(EditorBrowsableState.Never)]
693         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
694         {
695             Interop.WidgetView.DeleteWidgetView(swigCPtr);
696         }
697
698         // Callback for WidgetView WidgetAdded signal
699         private void OnWidgetAdded(IntPtr data)
700         {
701             WidgetViewEventArgs e = new WidgetViewEventArgs();
702             if (data != null)
703             {
704                 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
705             }
706
707             if (widgetAddedEventHandler != null)
708             {
709                 widgetAddedEventHandler(this, e);
710             }
711         }
712
713         // Callback for WidgetView WidgetDeleted signal
714         private void OnWidgetDeleted(IntPtr data)
715         {
716             WidgetViewEventArgs e = new WidgetViewEventArgs();
717             if (data != null)
718             {
719                 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
720             }
721
722             if (widgetDeletedEventHandler != null)
723             {
724                 widgetDeletedEventHandler(this, e);
725             }
726         }
727
728         // Callback for WidgetView WidgetCreationAborted signal
729         private void OnWidgetCreationAborted(IntPtr data)
730         {
731             WidgetViewEventArgs e = new WidgetViewEventArgs();
732             if (data != null)
733             {
734                 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
735             }
736
737             if (widgetCreationAbortedEventHandler != null)
738             {
739                 widgetCreationAbortedEventHandler(this, e);
740             }
741         }
742
743
744
745         // Callback for WidgetView WidgetContentUpdated signal
746         private void OnWidgetContentUpdated(IntPtr data)
747         {
748             WidgetViewEventArgs e = new WidgetViewEventArgs();
749             if (data != null)
750             {
751                 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
752             }
753
754             if (widgetContentUpdatedEventHandler != null)
755             {
756                 widgetContentUpdatedEventHandler(this, e);
757             }
758         }
759
760         // Callback for WidgetView WidgetUpdatePeriodChanged signal
761         private void OnWidgetUpdatePeriodChanged(IntPtr data)
762         {
763             WidgetViewEventArgs e = new WidgetViewEventArgs();
764             if (data != null)
765             {
766                 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
767             }
768
769             if (widgetUpdatePeriodChangedEventHandler != null)
770             {
771                 widgetUpdatePeriodChangedEventHandler(this, e);
772             }
773         }
774
775         // Callback for WidgetView WidgetFaulted signal
776         private void OnWidgetFaulted(IntPtr data)
777         {
778             WidgetViewEventArgs e = new WidgetViewEventArgs();
779             if (data != null)
780             {
781                 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
782             }
783
784             if (widgetFaultedEventHandler != null)
785             {
786                 widgetFaultedEventHandler(this, e);
787             }
788         }
789
790         /// <summary>
791         /// Event arguments of the widget view.
792         /// </summary>
793         /// <since_tizen> 3 </since_tizen>
794         public class WidgetViewEventArgs : EventArgs
795         {
796             private WidgetView _widgetView;
797
798             /// <summary>
799             /// The widget view.
800             /// </summary>
801             /// <since_tizen> 3 </since_tizen>
802             public WidgetView WidgetView
803             {
804                 get
805                 {
806                     return _widgetView;
807                 }
808                 set
809                 {
810                     _widgetView = value;
811                 }
812             }
813         }
814
815         internal new class Property
816         {
817             internal static readonly int WidgetId = Interop.WidgetView.WidgetIdGet();
818             internal static readonly int InstanceId = Interop.WidgetView.InstanceIdGet();
819             internal static readonly int ContentInfo = Interop.WidgetView.ContentInfoGet();
820             internal static readonly int TITLE = Interop.WidgetView.TitleGet();
821             internal static readonly int UpdatePeriod = Interop.WidgetView.UpdatePeriodGet();
822             internal static readonly int PREVIEW = Interop.WidgetView.PreviewGet();
823             internal static readonly int LoadingText = Interop.WidgetView.LoadingTextGet();
824             internal static readonly int WidgetStateFaulted = Interop.WidgetView.WidgetStateFaultedGet();
825             internal static readonly int PermanentDelete = Interop.WidgetView.PermanentDeleteGet();
826             internal static readonly int RetryText = Interop.WidgetView.RetryTextGet();
827             internal static readonly int EFFECT = Interop.WidgetView.EffectGet();
828
829
830             [Obsolete("Please do not use this! Deprecated in API9, will be removed in API11! Please use WidgetId instead!")]
831             internal static readonly int WIDGET_ID = Interop.WidgetView.WidgetIdGet();
832             [Obsolete("Please do not use this! Deprecated in API9, will be removed in API11! Please use ContentInfo instead!")]
833             internal static readonly int CONTENT_INFO = Interop.WidgetView.ContentInfoGet();
834             [Obsolete("Please do not use this! Deprecated in API9, will be removed in API11! Please use UpdatePeriod instead!")]
835             internal static readonly int UPDATE_PERIOD = Interop.WidgetView.UpdatePeriodGet();
836             [Obsolete("Please do not use this! Deprecated in API9, will be removed in API11! Please use LoadingText instead!")]
837             internal static readonly int LOADING_TEXT = Interop.WidgetView.LoadingTextGet();
838         }
839     }
840
841 }