[NUI] Fix build warning[CA1064]
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / WidgetView.cs
1 /*
2  * Copyright(c) 2017 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         /// <summary>
45         /// Creates a new WidgetView.
46         /// </summary>
47         /// <since_tizen> 3 </since_tizen>
48         public WidgetView(string widgetId, string contentInfo, int width, int height, float updatePeriod) : this(Interop.WidgetView.New(widgetId, contentInfo, width, height, updatePeriod), true)
49         {
50             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
51
52         }
53
54         internal WidgetView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.WidgetView.Upcast(cPtr), cMemoryOwn)
55         {
56         }
57         internal WidgetView(WidgetView handle) : this(Interop.WidgetView.NewWidgetView(WidgetView.getCPtr(handle)), true)
58         {
59             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
60         }
61
62         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
63         private delegate void WidgetAddedEventCallbackType(IntPtr data);
64         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
65         private delegate void WidgetContentUpdatedEventCallbackType(IntPtr data);
66         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
67         private delegate void WidgetDeletedEventCallbackType(IntPtr data);
68         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
69         private delegate void WidgetCreationAbortedEventCallbackType(IntPtr data);
70         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
71         private delegate void WidgetUpdatePeriodChangedEventCallbackType(IntPtr data);
72         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
73         private delegate void WidgetFaultedEventCallbackType(IntPtr data);
74
75         /// <summary>
76         /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
77         /// This signal is emitted after all resources required by a control are loaded and ready.<br />
78         /// Most resources are only loaded when the control is placed on the stage.<br />
79         /// </summary>
80         /// <since_tizen> 3 </since_tizen>
81         public event EventHandler<WidgetViewEventArgs> WidgetAdded
82         {
83             add
84             {
85                 if (_widgetAddedEventHandler == null)
86                 {
87                     _widgetAddedEventCallback = OnWidgetAdded;
88                     WidgetAddedSignal().Connect(_widgetAddedEventCallback);
89                 }
90
91                 _widgetAddedEventHandler += value;
92             }
93
94             remove
95             {
96                 _widgetAddedEventHandler -= value;
97
98                 if (_widgetAddedEventHandler == null && WidgetAddedSignal().Empty() == false)
99                 {
100                     WidgetAddedSignal().Disconnect(_widgetAddedEventCallback);
101                 }
102             }
103         }
104
105         /// <summary>
106         /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
107         /// This signal is emitted after all resources required by a control are loaded and ready.<br />
108         /// Most resources are only loaded when the control is placed on the stage.<br />
109         /// </summary>
110         /// <since_tizen> 3 </since_tizen>
111         public event EventHandler<WidgetViewEventArgs> WidgetContentUpdated
112         {
113             add
114             {
115                 if (_widgetContentUpdatedEventHandler == null)
116                 {
117                     _widgetContentUpdatedEventCallback = OnWidgetContentUpdated;
118                     WidgetContentUpdatedSignal().Connect(_widgetContentUpdatedEventCallback);
119                 }
120
121                 _widgetContentUpdatedEventHandler += value;
122             }
123
124             remove
125             {
126                 _widgetContentUpdatedEventHandler -= value;
127
128                 if (_widgetContentUpdatedEventHandler == null && WidgetContentUpdatedSignal().Empty() == false)
129                 {
130                     WidgetContentUpdatedSignal().Disconnect(_widgetContentUpdatedEventCallback);
131                 }
132             }
133         }
134
135         /// <summary>
136         /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
137         /// This signal is emitted after all resources required by a control are loaded and ready.<br />
138         /// Most resources are only loaded when the control is placed on the stage.<br />
139         /// </summary>
140         /// <since_tizen> 3 </since_tizen>
141         public event EventHandler<WidgetViewEventArgs> WidgetDeleted
142         {
143             add
144             {
145                 if (_widgetDeletedEventHandler == null)
146                 {
147                     _widgetDeletedEventCallback = OnWidgetDeleted;
148                     WidgetDeletedSignal().Connect(_widgetDeletedEventCallback);
149                 }
150
151                 _widgetDeletedEventHandler += value;
152             }
153
154             remove
155             {
156                 _widgetDeletedEventHandler -= value;
157
158                 if (_widgetDeletedEventHandler == null && WidgetDeletedSignal().Empty() == false)
159                 {
160                     WidgetDeletedSignal().Disconnect(_widgetDeletedEventCallback);
161                 }
162             }
163         }
164
165         /// <summary>
166         /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
167         /// This signal is emitted after all resources required by a control are loaded and ready.<br />
168         /// Most resources are only loaded when the control is placed on the stage.<br />
169         /// </summary>
170         /// <since_tizen> 3 </since_tizen>
171         public event EventHandler<WidgetViewEventArgs> WidgetCreationAborted
172         {
173             add
174             {
175                 if (_widgetCreationAbortedEventHandler == null)
176                 {
177                     _widgetCreationAbortedEventCallback = OnWidgetCreationAborted;
178                     WidgetCreationAbortedSignal().Connect(_widgetCreationAbortedEventCallback);
179                 }
180
181                 _widgetCreationAbortedEventHandler += value;
182             }
183
184             remove
185             {
186                 _widgetCreationAbortedEventHandler -= value;
187
188                 if (_widgetCreationAbortedEventHandler == null && WidgetCreationAbortedSignal().Empty() == false)
189                 {
190                     WidgetCreationAbortedSignal().Disconnect(_widgetCreationAbortedEventCallback);
191                 }
192             }
193         }
194
195         /// <summary>
196         /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
197         /// This signal is emitted after all resources required by a control are loaded and ready.<br />
198         /// Most resources are only loaded when the control is placed on the stage.<br />
199         /// </summary>
200         /// <since_tizen> 3 </since_tizen>
201         public event EventHandler<WidgetViewEventArgs> WidgetUpdatePeriodChanged
202         {
203             add
204             {
205                 if (_widgetUpdatePeriodChangedEventHandler == null)
206                 {
207                     _widgetUpdatePeriodChangedEventCallback = OnWidgetUpdatePeriodChanged;
208                     WidgetUpdatePeriodChangedSignal().Connect(_widgetUpdatePeriodChangedEventCallback);
209                 }
210
211                 _widgetUpdatePeriodChangedEventHandler += value;
212             }
213
214             remove
215             {
216                 _widgetUpdatePeriodChangedEventHandler -= value;
217
218                 if (_widgetUpdatePeriodChangedEventHandler == null && WidgetUpdatePeriodChangedSignal().Empty() == false)
219                 {
220                     WidgetUpdatePeriodChangedSignal().Disconnect(_widgetUpdatePeriodChangedEventCallback);
221                 }
222             }
223         }
224
225         /// <summary>
226         /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
227         /// This signal is emitted after all resources required by a control are loaded and ready.<br />
228         /// Most resources are only loaded when the control is placed on the stage.<br />
229         /// </summary>
230         /// <since_tizen> 3 </since_tizen>
231         public event EventHandler<WidgetViewEventArgs> WidgetFaulted
232         {
233             add
234             {
235                 if (_widgetFaultedEventHandler == null)
236                 {
237                     _widgetFaultedEventCallback = OnWidgetFaulted;
238                     WidgetFaultedSignal().Connect(_widgetFaultedEventCallback);
239                 }
240
241                 _widgetFaultedEventHandler += value;
242             }
243
244             remove
245             {
246                 _widgetFaultedEventHandler -= value;
247
248                 if (_widgetFaultedEventHandler == null && WidgetFaultedSignal().Empty() == false)
249                 {
250                     WidgetFaultedSignal().Disconnect(_widgetFaultedEventCallback);
251                 }
252             }
253         }
254
255         /// <summary>
256         /// Gets the ID of the widget.
257         /// </summary>
258         /// <since_tizen> 3 </since_tizen>
259         public string WidgetID
260         {
261             get
262             {
263                 string temp;
264                 GetProperty(WidgetView.Property.WidgetId).Get(out temp);
265                 return temp;
266             }
267         }
268
269         /// <summary>
270         /// Gets the ID of the instance.
271         /// </summary>
272         /// <since_tizen> 3 </since_tizen>
273         public string InstanceID
274         {
275             get
276             {
277                 string temp;
278                 GetProperty(WidgetView.Property.InstanceId).Get(out temp);
279                 return temp;
280             }
281         }
282
283         /// <summary>
284         /// Gets the content info.
285         /// </summary>
286         /// <since_tizen> 3 </since_tizen>
287         public string ContentInfo
288         {
289             get
290             {
291                 string temp;
292                 GetProperty(WidgetView.Property.ContentInfo).Get(out temp);
293                 return temp;
294             }
295         }
296
297         /// <summary>
298         /// Gets the title.
299         /// </summary>
300         /// <since_tizen> 3 </since_tizen>
301         public string Title
302         {
303             get
304             {
305                 string temp;
306                 GetProperty(WidgetView.Property.TITLE).Get(out temp);
307                 return temp;
308             }
309         }
310
311         /// <summary>
312         /// Gets the update peroid.
313         /// </summary>
314         /// <since_tizen> 3 </since_tizen>
315         public float UpdatePeriod
316         {
317             get
318             {
319                 float temp;
320                 GetProperty(WidgetView.Property.UpdatePeriod).Get(out temp);
321                 return temp;
322             }
323         }
324
325         /// <summary>
326         /// Gets or sets the preview.
327         /// </summary>
328         /// <since_tizen> 3 </since_tizen>
329         public bool Preview
330         {
331             get
332             {
333                 bool temp;
334                 GetProperty(WidgetView.Property.PREVIEW).Get(out temp);
335                 return temp;
336             }
337             set
338             {
339                 SetProperty(WidgetView.Property.PREVIEW, new Tizen.NUI.PropertyValue(value));
340             }
341         }
342
343         /// <summary>
344         /// Gets or sets the loading text.
345         /// </summary>
346         /// <since_tizen> 3 </since_tizen>
347         public bool LoadingText
348         {
349             get
350             {
351                 bool temp;
352                 GetProperty(WidgetView.Property.LoadingText).Get(out temp);
353                 return temp;
354             }
355             set
356             {
357                 SetProperty(WidgetView.Property.LoadingText, new Tizen.NUI.PropertyValue(value));
358             }
359         }
360
361         /// <summary>
362         /// Gets or sets whether the widget state is faulted or not.
363         /// </summary>
364         /// <since_tizen> 3 </since_tizen>
365         public bool WidgetStateFaulted
366         {
367             get
368             {
369                 bool temp;
370                 GetProperty(WidgetView.Property.WidgetStateFaulted).Get(out temp);
371                 return temp;
372             }
373             set
374             {
375                 SetProperty(WidgetView.Property.WidgetStateFaulted, new Tizen.NUI.PropertyValue(value));
376             }
377         }
378
379         /// <summary>
380         /// Gets or sets whether the widget is to delete permanently or not.
381         /// </summary>
382         /// <since_tizen> 3 </since_tizen>
383         public bool PermanentDelete
384         {
385             get
386             {
387                 bool temp;
388                 GetProperty(WidgetView.Property.PermanentDelete).Get(out temp);
389                 return temp;
390             }
391             set
392             {
393                 SetProperty(WidgetView.Property.PermanentDelete, new Tizen.NUI.PropertyValue(value));
394             }
395         }
396
397         /// <summary>
398         /// Gets or sets retry text.
399         /// </summary>
400         /// <since_tizen> 4 </since_tizen>
401         public PropertyMap RetryText
402         {
403             get
404             {
405                 PropertyMap temp = new PropertyMap();
406                 GetProperty(WidgetView.Property.RetryText).Get(temp);
407                 return temp;
408             }
409             set
410             {
411                 SetProperty(WidgetView.Property.RetryText, new Tizen.NUI.PropertyValue(value));
412             }
413         }
414
415         /// <summary>
416         /// Gets or sets effect.
417         /// </summary>
418         /// <since_tizen> 4 </since_tizen>
419         public PropertyMap Effect
420         {
421             get
422             {
423                 PropertyMap temp = new PropertyMap();
424                 GetProperty(WidgetView.Property.EFFECT).Get(temp);
425                 return temp;
426             }
427             set
428             {
429                 SetProperty(WidgetView.Property.EFFECT, new Tizen.NUI.PropertyValue(value));
430             }
431         }
432
433         /// <summary>
434         /// Pauses a given widget.
435         /// </summary>
436         /// <returns>True on success, false otherwise.</returns>
437         /// <since_tizen> 3 </since_tizen>
438         public bool PauseWidget()
439         {
440             bool ret = Interop.WidgetView.PauseWidget(swigCPtr);
441             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
442             return ret;
443         }
444
445         /// <summary>
446         /// Resumes a given widget.
447         /// </summary>
448         /// <returns>True on success, false otherwise.</returns>
449         /// <since_tizen> 3 </since_tizen>
450         public bool ResumeWidget()
451         {
452             bool ret = Interop.WidgetView.ResumeWidget(swigCPtr);
453             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
454             return ret;
455         }
456
457         /// <summary>
458         /// Cancels the touch event procedure.
459         /// If you call this function after feed the touch down event, the widget will get ON_HOLD events.
460         ///  If a widget gets ON_HOLD event, it will not do anything even if you feed touch up event.
461         /// </summary>
462         /// <returns>True on success, false otherwise.</returns>
463         /// <since_tizen> 3 </since_tizen>
464         public bool CancelTouchEvent()
465         {
466             bool ret = Interop.WidgetView.CancelTouchEvent(swigCPtr);
467             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
468             return ret;
469         }
470
471         /// <summary>
472         /// Activates a widget in the faulted state.
473         /// A widget in faulted state must be activated before adding the widget.
474         /// </summary>
475         /// <since_tizen> 3 </since_tizen>
476         public void ActivateFaultedWidget()
477         {
478             Interop.WidgetView.ActivateFaultedWidget(swigCPtr);
479             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
480         }
481
482         /// <summary>
483         /// Terminate a widget instance.
484         /// </summary>
485         /// <returns>True on success, false otherwise</returns>
486         /// <since_tizen> 4 </since_tizen>
487         public bool TerminateWidget()
488         {
489             bool ret = Interop.WidgetView.TerminateWidget(swigCPtr);
490             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
491             return ret;
492         }
493
494         internal static WidgetView DownCast(BaseHandle handle)
495         {
496             WidgetView ret = new WidgetView(Interop.WidgetView.DownCast(BaseHandle.getCPtr(handle)), true);
497             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
498             return ret;
499         }
500
501         internal static WidgetView GetWidgetViewFromPtr(global::System.IntPtr cPtr)
502         {
503             WidgetView ret = new WidgetView(cPtr, false);
504             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
505             return ret;
506         }
507
508         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WidgetView obj)
509         {
510             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
511         }
512
513         internal WidgetView Assign(WidgetView handle)
514         {
515             WidgetView ret = new WidgetView(Interop.WidgetView.Assign(swigCPtr, WidgetView.getCPtr(handle)), false);
516             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
517             return ret;
518         }
519
520         internal WidgetViewSignal WidgetAddedSignal()
521         {
522             WidgetViewSignal ret = new WidgetViewSignal(Interop.WidgetView.WidgetAddedSignal(swigCPtr), false);
523             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
524             return ret;
525         }
526
527         internal WidgetViewSignal WidgetDeletedSignal()
528         {
529             WidgetViewSignal ret = new WidgetViewSignal(Interop.WidgetView.WidgetDeletedSignal(swigCPtr), false);
530             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
531             return ret;
532         }
533
534         internal WidgetViewSignal WidgetCreationAbortedSignal()
535         {
536             WidgetViewSignal ret = new WidgetViewSignal(Interop.WidgetView.WidgetCreationAbortedSignal(swigCPtr), false);
537             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
538             return ret;
539         }
540
541         internal WidgetViewSignal WidgetContentUpdatedSignal()
542         {
543             WidgetViewSignal ret = new WidgetViewSignal(Interop.WidgetView.WidgetContentUpdatedSignal(swigCPtr), false);
544             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
545             return ret;
546         }
547
548         internal WidgetViewSignal WidgetUpdatePeriodChangedSignal()
549         {
550             WidgetViewSignal ret = new WidgetViewSignal(Interop.WidgetView.WidgetUpdatePeriodChangedSignal(swigCPtr), false);
551             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
552             return ret;
553         }
554
555         internal WidgetViewSignal WidgetFaultedSignal()
556         {
557             WidgetViewSignal ret = new WidgetViewSignal(Interop.WidgetView.WidgetFaultedSignal(swigCPtr), false);
558             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
559             return ret;
560         }
561
562         /// <summary>
563         /// To make the Button instance be disposed.
564         /// </summary>
565         /// <since_tizen> 3 </since_tizen>
566         protected override void Dispose(DisposeTypes type)
567         {
568             if (disposed)
569             {
570                 return;
571             }
572
573             //Release your own unmanaged resources here.
574             //You should not access any managed member here except static instance.
575             //because the execution order of Finalizes is non-deterministic.
576
577             if (_widgetAddedEventCallback != null)
578             {
579                 this.WidgetAddedSignal().Disconnect(_widgetAddedEventCallback);
580             }
581
582             if (_widgetContentUpdatedEventCallback != null)
583             {
584                 this.WidgetContentUpdatedSignal().Disconnect(_widgetContentUpdatedEventCallback);
585             }
586
587             if (_widgetCreationAbortedEventCallback != null)
588             {
589                 this.WidgetCreationAbortedSignal().Disconnect(_widgetCreationAbortedEventCallback);
590             }
591
592             if (_widgetDeletedEventCallback != null)
593             {
594                 this.WidgetDeletedSignal().Disconnect(_widgetDeletedEventCallback);
595             }
596
597             if (_widgetFaultedEventCallback != null)
598             {
599                 this.WidgetFaultedSignal().Disconnect(_widgetFaultedEventCallback);
600             }
601
602             if (_widgetUpdatePeriodChangedEventCallback != null)
603             {
604                 this.WidgetUpdatePeriodChangedSignal().Disconnect(_widgetUpdatePeriodChangedEventCallback);
605             }
606
607             base.Dispose(type);
608         }
609
610         /// This will not be public opened.
611         [EditorBrowsable(EditorBrowsableState.Never)]
612         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
613         {
614             Interop.WidgetView.DeleteWidgetView(swigCPtr);
615         }
616
617         // Callback for WidgetView WidgetAdded signal
618         private void OnWidgetAdded(IntPtr data)
619         {
620             WidgetViewEventArgs e = new WidgetViewEventArgs();
621             if (data != null)
622             {
623                 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
624             }
625
626             if (_widgetAddedEventHandler != null)
627             {
628                 _widgetAddedEventHandler(this, e);
629             }
630         }
631
632         // Callback for WidgetView WidgetDeleted signal
633         private void OnWidgetDeleted(IntPtr data)
634         {
635             WidgetViewEventArgs e = new WidgetViewEventArgs();
636             if (data != null)
637             {
638                 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
639             }
640
641             if (_widgetDeletedEventHandler != null)
642             {
643                 _widgetDeletedEventHandler(this, e);
644             }
645         }
646
647         // Callback for WidgetView WidgetCreationAborted signal
648         private void OnWidgetCreationAborted(IntPtr data)
649         {
650             WidgetViewEventArgs e = new WidgetViewEventArgs();
651             if (data != null)
652             {
653                 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
654             }
655
656             if (_widgetCreationAbortedEventHandler != null)
657             {
658                 _widgetCreationAbortedEventHandler(this, e);
659             }
660         }
661
662
663
664         // Callback for WidgetView WidgetContentUpdated signal
665         private void OnWidgetContentUpdated(IntPtr data)
666         {
667             WidgetViewEventArgs e = new WidgetViewEventArgs();
668             if (data != null)
669             {
670                 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
671             }
672
673             if (_widgetContentUpdatedEventHandler != null)
674             {
675                 _widgetContentUpdatedEventHandler(this, e);
676             }
677         }
678
679         // Callback for WidgetView WidgetUpdatePeriodChanged signal
680         private void OnWidgetUpdatePeriodChanged(IntPtr data)
681         {
682             WidgetViewEventArgs e = new WidgetViewEventArgs();
683             if (data != null)
684             {
685                 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
686             }
687
688             if (_widgetUpdatePeriodChangedEventHandler != null)
689             {
690                 _widgetUpdatePeriodChangedEventHandler(this, e);
691             }
692         }
693
694         // Callback for WidgetView WidgetFaulted signal
695         private void OnWidgetFaulted(IntPtr data)
696         {
697             WidgetViewEventArgs e = new WidgetViewEventArgs();
698             if (data != null)
699             {
700                 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
701             }
702
703             if (_widgetFaultedEventHandler != null)
704             {
705                 _widgetFaultedEventHandler(this, e);
706             }
707         }
708
709         /// <summary>
710         /// Event arguments of the widget view.
711         /// </summary>
712         /// <since_tizen> 3 </since_tizen>
713         public class WidgetViewEventArgs : EventArgs
714         {
715             private WidgetView _widgetView;
716
717             /// <summary>
718             /// The widet view.
719             /// </summary>
720             /// <since_tizen> 3 </since_tizen>
721             public WidgetView WidgetView
722             {
723                 get
724                 {
725                     return _widgetView;
726                 }
727                 set
728                 {
729                     _widgetView = value;
730                 }
731             }
732         }
733
734         internal new class Property
735         {
736             internal static readonly int WidgetId = Interop.WidgetView.WidgetIdGet();
737             internal static readonly int InstanceId = Interop.WidgetView.InstanceIdGet();
738             internal static readonly int ContentInfo = Interop.WidgetView.ContentInfoGet();
739             internal static readonly int TITLE = Interop.WidgetView.TitleGet();
740             internal static readonly int UpdatePeriod = Interop.WidgetView.UpdatePeriodGet();
741             internal static readonly int PREVIEW = Interop.WidgetView.PreviewGet();
742             internal static readonly int LoadingText = Interop.WidgetView.LoadingTextGet();
743             internal static readonly int WidgetStateFaulted = Interop.WidgetView.WidgetStateFaultedGet();
744             internal static readonly int PermanentDelete = Interop.WidgetView.PermanentDeleteGet();
745             internal static readonly int RetryText = Interop.WidgetView.RetryTextGet();
746             internal static readonly int EFFECT = Interop.WidgetView.EffectGet();
747         }
748     }
749
750 }