[NUI] Update ViewAccessibility according to the coding rule (#3022)
[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 ((other == null) || !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 int 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, Convert.ToInt32(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         ///////////////////////////////////////////////////////////////////
424         // **************** AccessibilityActivatedSignal **************** //
425         ///////////////////////////////////////////////////////////////////
426
427         private delegate void VoidHandlerType();
428         private VoidHandlerType activateCallback;
429         private EventHandler activateHandler;
430         internal VoidSignal ActivateSignal;
431
432         private void OnAccessibilityActivatedEvent()
433         {
434             activateHandler?.Invoke(this, null);
435         }
436
437         /// <summary>
438         /// Accessibility is activated.
439         /// </summary>
440         [EditorBrowsable(EditorBrowsableState.Never)]
441         public event EventHandler AccessibilityActivated
442         {
443             add
444             {
445                 if (activateHandler == null)
446                 {
447                     activateCallback = OnAccessibilityActivatedEvent;
448                     ActivateSignal = this.AccessibilityActivatedSignal();
449                     ActivateSignal?.Connect(activateCallback);
450                 }
451                 activateHandler += value;
452             }
453             remove
454             {
455                 activateHandler -= value;
456                 if (activateHandler == null && activateCallback != null)
457                 {
458                     ActivateSignal?.Disconnect(activateCallback);
459                     ActivateSignal?.Dispose();
460                     ActivateSignal = null;
461                 }
462             }
463         }
464
465         internal VoidSignal AccessibilityActivatedSignal()
466         {
467             var handle = GetControl();
468             VoidSignal ret = new VoidSignal(Interop.ControlDevel.DaliToolkitDevelControlAccessibilityActivateSignal(handle), false);
469             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
470             return ret;
471         }
472
473         ///////////////////////////////////////////////////////////////////
474         // ************ AccessibilityReadingSkippedSignal ************** //
475         ///////////////////////////////////////////////////////////////////
476
477         private VoidHandlerType readingSkippedCallback;
478         private EventHandler readingSkippedHandler;
479         internal VoidSignal ReadingSkippedSignal;
480
481         private void OnAccessibilityReadingSkippedEvent()
482         {
483             readingSkippedHandler?.Invoke(this, null);
484         }
485
486         /// <summary>
487         /// AccessibilityReading is skipped.
488         /// </summary>
489         [EditorBrowsable(EditorBrowsableState.Never)]
490         public event EventHandler AccessibilityReadingSkipped
491         {
492             add
493             {
494                 if (readingSkippedHandler == null)
495                 {
496                     readingSkippedCallback = OnAccessibilityReadingSkippedEvent;
497                     ReadingSkippedSignal = this.AccessibilityReadingSkippedSignal();
498                     ReadingSkippedSignal?.Connect(readingSkippedCallback);
499                 }
500                 readingSkippedHandler += value;
501             }
502             remove
503             {
504                 readingSkippedHandler -= value;
505                 if (readingSkippedHandler == null && readingSkippedCallback != null)
506                 {
507                     ReadingSkippedSignal?.Disconnect(readingSkippedCallback);
508                     ReadingSkippedSignal?.Dispose();
509                     ReadingSkippedSignal = null;
510                 }
511             }
512         }
513
514         internal VoidSignal AccessibilityReadingSkippedSignal()
515         {
516             var handle = GetControl();
517             VoidSignal ret = new VoidSignal(Interop.ControlDevel.DaliToolkitDevelControlAccessibilityReadingSkippedSignal(handle), false);
518             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
519             return ret;
520         }
521
522         ///////////////////////////////////////////////////////////////////
523         // ************* AccessibilityReadingPausedSignal ************** //
524         ///////////////////////////////////////////////////////////////////
525
526         private VoidHandlerType readingPausedCallback;
527         private EventHandler readingPausedHandler;
528         internal VoidSignal ReadingPausedSignal;
529
530         private void OnAccessibilityReadingPausedEvent()
531         {
532             readingPausedHandler?.Invoke(this, null);
533         }
534
535         /// <summary>
536         /// AccessibilityReading is paused.
537         /// </summary>
538         [EditorBrowsable(EditorBrowsableState.Never)]
539         public event EventHandler AccessibilityReadingPaused
540         {
541             add
542             {
543                 if (readingPausedHandler == null)
544                 {
545                     readingPausedCallback = OnAccessibilityReadingPausedEvent;
546                     ReadingPausedSignal = this.AccessibilityReadingPausedSignal();
547                     ReadingPausedSignal?.Connect(readingPausedCallback);
548                 }
549                 readingPausedHandler += value;
550             }
551             remove
552             {
553                 readingPausedHandler -= value;
554                 if (readingPausedHandler == null && readingPausedCallback != null)
555                 {
556                     ReadingPausedSignal?.Disconnect(readingPausedCallback);
557                     ReadingPausedSignal?.Dispose();
558                     ReadingPausedSignal = null;
559                 }
560             }
561         }
562
563         internal VoidSignal AccessibilityReadingPausedSignal()
564         {
565             var handle = GetControl();
566             VoidSignal ret = new VoidSignal(Interop.ControlDevel.DaliToolkitDevelControlAccessibilityReadingPausedSignal(handle), false);
567             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
568             return ret;
569         }
570
571         ///////////////////////////////////////////////////////////////////
572         // ************* AccessibilityReadingResumedSignal ************* //
573         ///////////////////////////////////////////////////////////////////
574
575         private VoidHandlerType readingResumedCallback;
576         private EventHandler readingResumedHandler;
577         internal VoidSignal ReadingResumedSignal;
578
579         private void OnAccessibilityReadingResumedEvent()
580         {
581             readingResumedHandler?.Invoke(this, null);
582         }
583
584         /// <summary>
585         /// AccessibilityReading is resumed.
586         /// </summary>
587         [EditorBrowsable(EditorBrowsableState.Never)]
588         public event EventHandler AccessibilityReadingResumed
589         {
590             add
591             {
592                 if (readingResumedHandler == null)
593                 {
594                     readingResumedCallback = OnAccessibilityReadingResumedEvent;
595                     ReadingResumedSignal = this.AccessibilityReadingResumedSignal();
596                     ReadingResumedSignal?.Connect(readingResumedCallback);
597                 }
598                 readingResumedHandler += value;
599             }
600             remove
601             {
602                 readingResumedHandler -= value;
603                 if (readingResumedHandler == null && readingResumedCallback != null)
604                 {
605                     ReadingResumedSignal?.Disconnect(readingResumedCallback);
606                     ReadingResumedSignal?.Dispose();
607                     ReadingResumedSignal = null;
608                 }
609             }
610         }
611
612         internal VoidSignal AccessibilityReadingResumedSignal()
613         {
614             var handle = GetControl();
615             VoidSignal ret = new VoidSignal(Interop.ControlDevel.DaliToolkitDevelControlAccessibilityReadingResumedSignal(handle), false);
616             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
617             return ret;
618         }
619
620         ///////////////////////////////////////////////////////////////////
621         // ************ AccessibilityReadingCancelledSignal ************ //
622         ///////////////////////////////////////////////////////////////////
623
624         private VoidHandlerType readingCancelledCallback;
625         private EventHandler readingCancelledHandler;
626         internal VoidSignal ReadingCancelledSignal;
627
628         private void OnAccessibilityReadingCancelledEvent()
629         {
630             readingCancelledHandler?.Invoke(this, null);
631         }
632
633         /// <summary>
634         /// AccessibilityReading is cancelled.
635         /// </summary>
636         [EditorBrowsable(EditorBrowsableState.Never)]
637         public event EventHandler AccessibilityReadingCancelled
638         {
639             add
640             {
641                 if (readingCancelledHandler == null)
642                 {
643                     readingCancelledCallback = OnAccessibilityReadingCancelledEvent;
644                     ReadingCancelledSignal = this.AccessibilityReadingCancelledSignal();
645                     ReadingCancelledSignal?.Connect(readingCancelledCallback);
646                 }
647                 readingCancelledHandler += value;
648             }
649             remove
650             {
651                 readingCancelledHandler -= value;
652                 if (readingCancelledHandler == null && readingCancelledCallback != null)
653                 {
654                     ReadingCancelledSignal?.Disconnect(readingCancelledCallback);
655                     ReadingCancelledSignal?.Dispose();
656                     ReadingCancelledSignal = null;
657                 }
658             }
659         }
660
661         internal VoidSignal AccessibilityReadingCancelledSignal()
662         {
663             var handle = GetControl();
664             VoidSignal ret = new VoidSignal(Interop.ControlDevel.DaliToolkitDevelControlAccessibilityReadingCancelledSignal(handle), false);
665             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
666             return ret;
667         }
668
669         ///////////////////////////////////////////////////////////////////
670         // ************* AccessibilityReadingStoppedSignal ************* //
671         ///////////////////////////////////////////////////////////////////
672
673         private VoidHandlerType readingStoppedCallback;
674         private EventHandler readingStoppedHandler;
675         internal VoidSignal ReadingStoppedSignal;
676
677         private void OnAccessibilityReadingStoppedEvent()
678         {
679             readingStoppedHandler?.Invoke(this, null);
680         }
681
682         /// <summary>
683         /// AccessibilityReading is stopped.
684         /// </summary>
685         [EditorBrowsable(EditorBrowsableState.Never)]
686         public event EventHandler AccessibilityReadingStopped
687         {
688             add
689             {
690                 if (readingStoppedHandler == null)
691                 {
692                     readingStoppedCallback = OnAccessibilityReadingStoppedEvent;
693                     ReadingStoppedSignal = this.AccessibilityReadingStoppedSignal();
694                     ReadingStoppedSignal?.Connect(readingStoppedCallback);
695                 }
696                 readingStoppedHandler += value;
697             }
698             remove
699             {
700                 readingStoppedHandler -= value;
701                 if (readingStoppedHandler == null && readingStoppedCallback != null)
702                 {
703                     ReadingStoppedSignal?.Disconnect(readingStoppedCallback);
704                     ReadingStoppedSignal?.Dispose();
705                     ReadingStoppedSignal = null;
706                 }
707             }
708         }
709
710         internal VoidSignal AccessibilityReadingStoppedSignal()
711         {
712             var handle = GetControl();
713             VoidSignal ret = new VoidSignal(Interop.ControlDevel.DaliToolkitDevelControlAccessibilityReadingStoppedSignal(handle), false);
714             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
715             return ret;
716         }
717     }
718 }