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