[NUI] Remove NUI dotnet 6.0 build warnings
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / ViewAccessibilityEvent.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
18 using System;
19 using System.ComponentModel;
20 using System.Runtime.InteropServices;
21 using Tizen.NUI.Components;
22 using Tizen.NUI;
23
24 namespace Tizen.NUI.BaseComponents
25 {
26     /// <summary>
27     /// Gesture information type containing all values needed to AccessibilityDoGestureSignal.
28     /// </summary>
29     [EditorBrowsable(EditorBrowsableState.Never)]
30     [StructLayout(LayoutKind.Sequential)]
31     public struct GestureInfoType : IEquatable<GestureInfoType>
32     {
33         /// <summary>
34         /// Accessibility enumerated gesture type.
35         /// </summary>
36         [EditorBrowsable(EditorBrowsableState.Never)]
37         public AccessibilityGesture Type { get; set; }
38
39         /// <summary>
40         /// The X position where the gesture begins.
41         /// </summary>
42         [EditorBrowsable(EditorBrowsableState.Never)]
43         public int StartPositionX { get; set; }
44
45         /// <summary>
46         /// The X position where the gesture ends.
47         /// </summary>
48         [EditorBrowsable(EditorBrowsableState.Never)]
49         public int EndPositionX { get; set; }
50
51         /// <summary>
52         /// The Y position where the gesture begins.
53         /// </summary>
54         [EditorBrowsable(EditorBrowsableState.Never)]
55         public int StartPositionY { get; set; }
56
57         /// <summary>
58         /// The Y position where the gesture ends.
59         /// </summary>
60         [EditorBrowsable(EditorBrowsableState.Never)]
61         public int EndPositionY { get; set; }
62
63         /// <summary>
64         /// The enumerated state of gesture.
65         /// </summary>
66         [EditorBrowsable(EditorBrowsableState.Never)]
67         public AccessibilityGestureState State { get; set; }
68
69         /// <summary>
70         /// The time when event occured.
71         /// </summary>
72         [EditorBrowsable(EditorBrowsableState.Never)]
73         public uint EventTime { get; set; }
74
75         /// <summary>
76         /// Determines whether the specified object is equal to the current object.
77         /// </summary>
78         /// <param name="obj">The object to compare with the current object</param>
79         /// <returns>True if the specified object is equal to the current object, otherwise false</returns>
80         [EditorBrowsable(EditorBrowsableState.Never)]
81         public override bool Equals(System.Object obj)
82         {
83             if (obj is GestureInfoType)
84             {
85                 return this.Equals((GestureInfoType)obj);
86             }
87             return false;
88         }
89
90         /// <summary>
91         /// Determines whether the specified object is equal to the current object.
92         /// </summary>
93         /// <param name="other">The GestureInfoType to compare with the current GestureInfoType</param>
94         /// <returns>True if equal GestureInfoType, otherwise false</returns>
95         public bool Equals(GestureInfoType other)
96         {
97             if (!this.GetType().Equals(other.GetType()))
98             {
99                 return false;
100             }
101
102             GestureInfoType compared = (GestureInfoType)other;
103             // Return true if the fields match:
104             return (Type == compared.Type &&
105                     StartPositionX == compared.StartPositionX &&
106                     EndPositionX == compared.EndPositionX &&
107                     StartPositionY == compared.StartPositionY &&
108                     EndPositionY == compared.EndPositionY &&
109                     State == compared.State &&
110                     EventTime == compared.EventTime);
111         }
112
113         /// <summary>
114         /// The == operator.
115         /// </summary>
116         /// <param name="arg1">The first value</param>
117         /// <param name="arg2">The second value</param>
118         /// <returns>True if GestureInfoTypes are equal</returns>
119         [EditorBrowsable(EditorBrowsableState.Never)]
120         public static bool operator ==(GestureInfoType arg1, GestureInfoType arg2)
121         {
122             return arg1.Equals(arg2);
123         }
124
125         /// <summary>
126         /// The != operator.
127         /// </summary>
128         /// <param name="arg1">The first value</param>
129         /// <param name="arg2">The second value</param>
130         /// <returns>True if GestureInfoTypes are not equal</returns>
131         [EditorBrowsable(EditorBrowsableState.Never)]
132         public static bool operator !=(GestureInfoType arg1, GestureInfoType arg2)
133         {
134             return !arg1.Equals(arg2);
135         }
136
137         /// <summary>
138         /// Gets the hash code of this baseHandle.
139         /// </summary>
140         /// <returns>The Hash Code</returns>
141         [EditorBrowsable(EditorBrowsableState.Never)]
142         public override int GetHashCode()
143         {
144             return Tuple.Create((int)Type, StartPositionX, EndPositionX, StartPositionY, EndPositionY, (int)State, EventTime).GetHashCode();
145         }
146     }
147
148     /// <summary>
149     /// Accessibility gesture information event arguments.
150     /// </summary>
151     [EditorBrowsable(EditorBrowsableState.Never)]
152     public class GestureInfoEventArgs : EventArgs
153     {
154         /// <summary>
155         /// The gesture information type.
156         /// </summary>
157         [EditorBrowsable(EditorBrowsableState.Never)]
158         public GestureInfoType GestureInfo { get; internal set; }
159
160         /// <summary>
161         /// True if the event is consumed.
162         /// </summary>
163         [EditorBrowsable(EditorBrowsableState.Never)]
164         public bool Consumed { get; set; }
165     }
166
167     /// <summary>
168     /// Accessibility description event arguments.
169     /// </summary>
170     [EditorBrowsable(EditorBrowsableState.Never)]
171     public class GetDescriptionEventArgs : EventArgs
172     {
173         /// <summary>
174         /// Accessibility description.
175         /// </summary>
176         public string Description { get; set; }
177     }
178
179     /// <summary>
180     /// Accessibility name event arguments.
181     /// </summary>
182     [EditorBrowsable(EditorBrowsableState.Never)]
183     public class GetNameEventArgs : EventArgs
184     {
185         /// <summary>
186         /// Accessibility name.
187         /// </summary>
188         public string Name { get; set; }
189     }
190
191     /// <summary>
192     /// View is the base class for all views.
193     /// </summary>
194     /// <since_tizen> 3 </since_tizen>
195     public partial class View
196     {
197         internal class ControlHandle : SafeHandle
198         {
199             public ControlHandle() : base(IntPtr.Zero, true) { }
200
201             public ControlHandle(IntPtr ptr) : base(ptr, true) { }
202
203             public override bool IsInvalid
204             {
205                 get
206                 {
207                     return this.handle == IntPtr.Zero;
208                 }
209             }
210
211             protected override bool ReleaseHandle()
212             {
213                 Interop.View.DeleteControlHandleView(handle);
214                 this.SetHandle(IntPtr.Zero);
215                 return true;
216             }
217         }
218
219         /// <summary>
220         /// Gets the control handle.
221         /// </summary>
222         /// <returns>The control handle of the view</returns>
223         [EditorBrowsable(EditorBrowsableState.Never)]
224         ControlHandle GetControl()
225         {
226             var result = new ControlHandle(Interop.View.DownCast(SwigCPtr));
227             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
228             return result;
229         }
230
231         ///////////////////////////////////////////////////////////////////
232         // ***************** AccessiblityDoGestureSignal ****************//
233         ///////////////////////////////////////////////////////////////////
234
235         private delegate void GestureInfoHandlerType(IntPtr data);
236         private GestureInfoHandlerType gestureInfoCallback;
237         private EventHandler<GestureInfoEventArgs> gestureInfoHandler;
238         private AccessibilityDoGestureSignal gestureInfoSignal;
239
240         private void OnAccessibilityGestureInfoEvent(IntPtr data)
241         {
242             if (data == IntPtr.Zero)
243             {
244                 return;
245             }
246
247             if (Marshal.SizeOf<GestureInfoType>() != AccessibilityDoGestureSignal.GetSizeOfGestureInfo())
248             {
249                 throw new global::System.ApplicationException("ABI mismatch SizeOf(C# GestureInfo) != SizeOf(c++ GestureInfo)");
250             }
251
252             var arg = new GestureInfoEventArgs()
253             {
254                 Consumed = AccessibilityDoGestureSignal.GetResult(data),
255                 GestureInfo = (GestureInfoType)Marshal.PtrToStructure(data, typeof(GestureInfoType)),
256             };
257             gestureInfoHandler?.Invoke(this, arg);
258
259             AccessibilityDoGestureSignal.SetResult(data, arg.Consumed);
260         }
261
262         /// <summary>
263         /// AccessibilityGestureInfo is received.
264         /// </summary>
265         [EditorBrowsable(EditorBrowsableState.Never)]
266         public event EventHandler<GestureInfoEventArgs> AccessibilityGestureInfoReceived
267         {
268             // This uses DoGestureInfo signal from C++ API.
269             add
270             {
271                 if (gestureInfoHandler == null)
272                 {
273                     gestureInfoCallback = OnAccessibilityGestureInfoEvent;
274                     gestureInfoSignal = this.AccessibilityGestureInfoSignal();
275                     gestureInfoSignal?.Connect(gestureInfoCallback);
276                 }
277                 gestureInfoHandler += value;
278             }
279             remove
280             {
281                 gestureInfoHandler -= value;
282                 if (gestureInfoHandler == null && gestureInfoCallback != null)
283                 {
284                     gestureInfoSignal?.Disconnect(gestureInfoCallback);
285                     gestureInfoSignal?.Dispose();
286                     gestureInfoSignal = null;
287                 }
288             }
289         }
290
291         internal AccessibilityDoGestureSignal AccessibilityGestureInfoSignal()
292         {
293             var handle = GetControl();
294             AccessibilityDoGestureSignal ret = new AccessibilityDoGestureSignal(Interop.ControlDevel.DaliToolkitDevelControlAccessibilityDoGestureSignal(handle), false);
295             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
296             return ret;
297         }
298
299         ///////////////////////////////////////////////////////////////////
300         // ************** AccessiblityGetDescriptionSignal ************* //
301         ///////////////////////////////////////////////////////////////////
302
303         private delegate void GetDescriptionHandlerType(IntPtr data);
304         private GetDescriptionHandlerType getDescriptionCallback;
305         private EventHandler<GetDescriptionEventArgs> getDescriptionHandler;
306         private StringToVoidSignal getDescriptionSignal;
307
308         private void OnGetAccessibilityDescriptionEvent(IntPtr data)
309         {
310             if (data == IntPtr.Zero)
311             {
312                 return;
313             }
314
315             var arg = new GetDescriptionEventArgs()
316             {
317                 Description = StringToVoidSignal.GetResult(data)
318             };
319             getDescriptionHandler?.Invoke(this, arg);
320
321             StringToVoidSignal.SetResult(data, arg.Description);
322         }
323
324         /// <summary>
325         /// AccessibilityDescription is requested.
326         /// </summary>
327         [EditorBrowsable(EditorBrowsableState.Never)]
328         public event EventHandler<GetDescriptionEventArgs> AccessibilityDescriptionRequested
329         {
330             // This uses GetDescription signal from C++ API.
331             add
332             {
333                 if (getDescriptionHandler == null)
334                 {
335                     getDescriptionCallback = OnGetAccessibilityDescriptionEvent;
336                     getDescriptionSignal = this.GetAccessibilityDescriptionSignal();
337                     getDescriptionSignal?.Connect(getDescriptionCallback);
338                 }
339                 getDescriptionHandler += value;
340             }
341             remove
342             {
343                 getDescriptionHandler -= value;
344                 if (getDescriptionHandler == null && getDescriptionCallback != null)
345                 {
346                     getDescriptionSignal?.Disconnect(getDescriptionCallback);
347                     getDescriptionSignal?.Dispose();
348                     getDescriptionSignal = null;
349                 }
350             }
351         }
352
353         internal StringToVoidSignal GetAccessibilityDescriptionSignal()
354         {
355             var handle = GetControl();
356             StringToVoidSignal ret = new StringToVoidSignal(Interop.ControlDevel.DaliToolkitDevelControlAccessibilityGetDescriptionSignal(handle), false);
357             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
358             return ret;
359         }
360
361         ///////////////////////////////////////////////////////////////////
362         // ***************** AccessiblityGetNameSignal ***************** //
363         ///////////////////////////////////////////////////////////////////
364
365         private delegate void GetNameHandlerType(IntPtr data);
366         private GetNameHandlerType getNameCallback;
367         private EventHandler<GetNameEventArgs> getNameHandler;
368         private StringToVoidSignal getNameSignal;
369
370         private void OnGetAccessibilityNameEvent(IntPtr data)
371         {
372             if (data == IntPtr.Zero)
373             {
374                 return;
375             }
376
377             var arg = new GetNameEventArgs()
378             {
379                 Name = StringToVoidSignal.GetResult(data)
380             };
381             getNameHandler?.Invoke(this, arg);
382
383             StringToVoidSignal.SetResult(data, arg.Name);
384         }
385
386         /// <summary>
387         /// AccessibilityName is requested.
388         /// </summary>
389         [EditorBrowsable(EditorBrowsableState.Never)]
390         public event EventHandler<GetNameEventArgs> AccessibilityNameRequested
391         {
392             // This uses GetName signal from C++ API.
393             add
394             {
395                 if (getNameHandler == null)
396                 {
397                     getNameCallback = OnGetAccessibilityNameEvent;
398                     getNameSignal = this.GetAccessibilityNameSignal();
399                     getNameSignal?.Connect(getNameCallback);
400                 }
401                 getNameHandler += value;
402             }
403             remove
404             {
405                 getNameHandler -= value;
406                 if (getNameHandler == null && getNameCallback != null)
407                 {
408                     getNameSignal?.Disconnect(getNameCallback);
409                     getNameSignal?.Dispose();
410                     getNameSignal = null;
411                 }
412             }
413         }
414
415         internal StringToVoidSignal GetAccessibilityNameSignal()
416         {
417             var handle = GetControl();
418             StringToVoidSignal ret = new StringToVoidSignal(Interop.ControlDevel.DaliToolkitDevelControlAccessibilityGetNameSignal(handle), false);
419             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
420             return ret;
421         }
422
423         // AccessibilityValueTextRequested
424
425         [EditorBrowsable(EditorBrowsableState.Never)]
426         public class AccessibilityValueTextRequestedEventArgs : EventArgs
427         {
428             [EditorBrowsable(EditorBrowsableState.Never)]
429             public string Text { get; set; }
430         }
431
432         [EditorBrowsable(EditorBrowsableState.Never)]
433         public event EventHandler<AccessibilityValueTextRequestedEventArgs> AccessibilityValueTextRequested;
434
435         ///////////////////////////////////////////////////////////////////
436         // **************** AccessibilityActivatedSignal **************** //
437         ///////////////////////////////////////////////////////////////////
438
439         private delegate void VoidHandlerType();
440         private VoidHandlerType activateCallback;
441         private EventHandler activateHandler;
442         internal VoidSignal ActivateSignal;
443
444         private void OnAccessibilityActivatedEvent()
445         {
446             activateHandler?.Invoke(this, null);
447         }
448
449         /// <summary>
450         /// Accessibility is activated.
451         /// </summary>
452         [EditorBrowsable(EditorBrowsableState.Never)]
453         public event EventHandler AccessibilityActivated
454         {
455             add
456             {
457                 if (activateHandler == null)
458                 {
459                     activateCallback = OnAccessibilityActivatedEvent;
460                     ActivateSignal = this.AccessibilityActivatedSignal();
461                     ActivateSignal?.Connect(activateCallback);
462                 }
463                 activateHandler += value;
464             }
465             remove
466             {
467                 activateHandler -= value;
468                 if (activateHandler == null && activateCallback != null)
469                 {
470                     ActivateSignal?.Disconnect(activateCallback);
471                     ActivateSignal?.Dispose();
472                     ActivateSignal = null;
473                 }
474             }
475         }
476
477         internal VoidSignal AccessibilityActivatedSignal()
478         {
479             var handle = GetControl();
480             VoidSignal ret = new VoidSignal(Interop.ControlDevel.DaliToolkitDevelControlAccessibilityActivateSignal(handle), false);
481             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
482             return ret;
483         }
484
485         ///////////////////////////////////////////////////////////////////
486         // ************ AccessibilityReadingSkippedSignal ************** //
487         ///////////////////////////////////////////////////////////////////
488
489         private VoidHandlerType readingSkippedCallback;
490         private EventHandler readingSkippedHandler;
491         internal VoidSignal ReadingSkippedSignal;
492
493         private void OnAccessibilityReadingSkippedEvent()
494         {
495             readingSkippedHandler?.Invoke(this, null);
496         }
497
498         /// <summary>
499         /// AccessibilityReading is skipped.
500         /// </summary>
501         [EditorBrowsable(EditorBrowsableState.Never)]
502         public event EventHandler AccessibilityReadingSkipped
503         {
504             add
505             {
506                 if (readingSkippedHandler == null)
507                 {
508                     readingSkippedCallback = OnAccessibilityReadingSkippedEvent;
509                     ReadingSkippedSignal = this.AccessibilityReadingSkippedSignal();
510                     ReadingSkippedSignal?.Connect(readingSkippedCallback);
511                 }
512                 readingSkippedHandler += value;
513             }
514             remove
515             {
516                 readingSkippedHandler -= value;
517                 if (readingSkippedHandler == null && readingSkippedCallback != null)
518                 {
519                     ReadingSkippedSignal?.Disconnect(readingSkippedCallback);
520                     ReadingSkippedSignal?.Dispose();
521                     ReadingSkippedSignal = null;
522                 }
523             }
524         }
525
526         internal VoidSignal AccessibilityReadingSkippedSignal()
527         {
528             var handle = GetControl();
529             VoidSignal ret = new VoidSignal(Interop.ControlDevel.DaliToolkitDevelControlAccessibilityReadingSkippedSignal(handle), false);
530             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
531             return ret;
532         }
533
534         ///////////////////////////////////////////////////////////////////
535         // ************* AccessibilityReadingPausedSignal ************** //
536         ///////////////////////////////////////////////////////////////////
537
538         private VoidHandlerType readingPausedCallback;
539         private EventHandler readingPausedHandler;
540         internal VoidSignal ReadingPausedSignal;
541
542         private void OnAccessibilityReadingPausedEvent()
543         {
544             readingPausedHandler?.Invoke(this, null);
545         }
546
547         /// <summary>
548         /// AccessibilityReading is paused.
549         /// </summary>
550         [EditorBrowsable(EditorBrowsableState.Never)]
551         public event EventHandler AccessibilityReadingPaused
552         {
553             add
554             {
555                 if (readingPausedHandler == null)
556                 {
557                     readingPausedCallback = OnAccessibilityReadingPausedEvent;
558                     ReadingPausedSignal = this.AccessibilityReadingPausedSignal();
559                     ReadingPausedSignal?.Connect(readingPausedCallback);
560                 }
561                 readingPausedHandler += value;
562             }
563             remove
564             {
565                 readingPausedHandler -= value;
566                 if (readingPausedHandler == null && readingPausedCallback != null)
567                 {
568                     ReadingPausedSignal?.Disconnect(readingPausedCallback);
569                     ReadingPausedSignal?.Dispose();
570                     ReadingPausedSignal = null;
571                 }
572             }
573         }
574
575         internal VoidSignal AccessibilityReadingPausedSignal()
576         {
577             var handle = GetControl();
578             VoidSignal ret = new VoidSignal(Interop.ControlDevel.DaliToolkitDevelControlAccessibilityReadingPausedSignal(handle), false);
579             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
580             return ret;
581         }
582
583         ///////////////////////////////////////////////////////////////////
584         // ************* AccessibilityReadingResumedSignal ************* //
585         ///////////////////////////////////////////////////////////////////
586
587         private VoidHandlerType readingResumedCallback;
588         private EventHandler readingResumedHandler;
589         internal VoidSignal ReadingResumedSignal;
590
591         private void OnAccessibilityReadingResumedEvent()
592         {
593             readingResumedHandler?.Invoke(this, null);
594         }
595
596         /// <summary>
597         /// AccessibilityReading is resumed.
598         /// </summary>
599         [EditorBrowsable(EditorBrowsableState.Never)]
600         public event EventHandler AccessibilityReadingResumed
601         {
602             add
603             {
604                 if (readingResumedHandler == null)
605                 {
606                     readingResumedCallback = OnAccessibilityReadingResumedEvent;
607                     ReadingResumedSignal = this.AccessibilityReadingResumedSignal();
608                     ReadingResumedSignal?.Connect(readingResumedCallback);
609                 }
610                 readingResumedHandler += value;
611             }
612             remove
613             {
614                 readingResumedHandler -= value;
615                 if (readingResumedHandler == null && readingResumedCallback != null)
616                 {
617                     ReadingResumedSignal?.Disconnect(readingResumedCallback);
618                     ReadingResumedSignal?.Dispose();
619                     ReadingResumedSignal = null;
620                 }
621             }
622         }
623
624         internal VoidSignal AccessibilityReadingResumedSignal()
625         {
626             var handle = GetControl();
627             VoidSignal ret = new VoidSignal(Interop.ControlDevel.DaliToolkitDevelControlAccessibilityReadingResumedSignal(handle), false);
628             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
629             return ret;
630         }
631
632         ///////////////////////////////////////////////////////////////////
633         // ************ AccessibilityReadingCancelledSignal ************ //
634         ///////////////////////////////////////////////////////////////////
635
636         private VoidHandlerType readingCancelledCallback;
637         private EventHandler readingCancelledHandler;
638         internal VoidSignal ReadingCancelledSignal;
639
640         private void OnAccessibilityReadingCancelledEvent()
641         {
642             readingCancelledHandler?.Invoke(this, null);
643         }
644
645         /// <summary>
646         /// AccessibilityReading is cancelled.
647         /// </summary>
648         [EditorBrowsable(EditorBrowsableState.Never)]
649         public event EventHandler AccessibilityReadingCancelled
650         {
651             add
652             {
653                 if (readingCancelledHandler == null)
654                 {
655                     readingCancelledCallback = OnAccessibilityReadingCancelledEvent;
656                     ReadingCancelledSignal = this.AccessibilityReadingCancelledSignal();
657                     ReadingCancelledSignal?.Connect(readingCancelledCallback);
658                 }
659                 readingCancelledHandler += value;
660             }
661             remove
662             {
663                 readingCancelledHandler -= value;
664                 if (readingCancelledHandler == null && readingCancelledCallback != null)
665                 {
666                     ReadingCancelledSignal?.Disconnect(readingCancelledCallback);
667                     ReadingCancelledSignal?.Dispose();
668                     ReadingCancelledSignal = null;
669                 }
670             }
671         }
672
673         internal VoidSignal AccessibilityReadingCancelledSignal()
674         {
675             var handle = GetControl();
676             VoidSignal ret = new VoidSignal(Interop.ControlDevel.DaliToolkitDevelControlAccessibilityReadingCancelledSignal(handle), false);
677             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
678             return ret;
679         }
680
681         ///////////////////////////////////////////////////////////////////
682         // ************* AccessibilityReadingStoppedSignal ************* //
683         ///////////////////////////////////////////////////////////////////
684
685         private VoidHandlerType readingStoppedCallback;
686         private EventHandler readingStoppedHandler;
687         internal VoidSignal ReadingStoppedSignal;
688
689         private void OnAccessibilityReadingStoppedEvent()
690         {
691             readingStoppedHandler?.Invoke(this, null);
692         }
693
694         /// <summary>
695         /// AccessibilityReading is stopped.
696         /// </summary>
697         [EditorBrowsable(EditorBrowsableState.Never)]
698         public event EventHandler AccessibilityReadingStopped
699         {
700             add
701             {
702                 if (readingStoppedHandler == null)
703                 {
704                     readingStoppedCallback = OnAccessibilityReadingStoppedEvent;
705                     ReadingStoppedSignal = this.AccessibilityReadingStoppedSignal();
706                     ReadingStoppedSignal?.Connect(readingStoppedCallback);
707                 }
708                 readingStoppedHandler += value;
709             }
710             remove
711             {
712                 readingStoppedHandler -= value;
713                 if (readingStoppedHandler == null && readingStoppedCallback != null)
714                 {
715                     ReadingStoppedSignal?.Disconnect(readingStoppedCallback);
716                     ReadingStoppedSignal?.Dispose();
717                     ReadingStoppedSignal = null;
718                 }
719             }
720         }
721
722         internal VoidSignal AccessibilityReadingStoppedSignal()
723         {
724             var handle = GetControl();
725             VoidSignal ret = new VoidSignal(Interop.ControlDevel.DaliToolkitDevelControlAccessibilityReadingStoppedSignal(handle), false);
726             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
727             return ret;
728         }
729     }
730 }