[NUI] Apply CornerRadius to View (#1463)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / AccessibilityManagerEvent.cs
1 /*
2  * Copyright(c) 2019 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.Runtime.InteropServices;
20
21 namespace Tizen.NUI
22 {
23     internal partial class AccessibilityManager
24     {
25         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
26         private delegate bool StatusChangedEventCallbackDelegate(IntPtr accessibilityManager);
27         private DaliEventHandlerWithReturnType<object, StatusChangedEventArgs, bool> _accessibilityManagerStatusChangedEventHandler;
28         private StatusChangedEventCallbackDelegate _accessibilityManagerStatusChangedEventCallbackDelegate;
29
30         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
31         private delegate bool ActionNextEventCallbackDelegate(IntPtr accessibilityManager);
32         private DaliEventHandlerWithReturnType<object, ActionNextEventArgs, bool> _accessibilityManagerActionNextEventHandler;
33         private ActionNextEventCallbackDelegate _accessibilityManagerActionNextEventCallbackDelegate;
34
35         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
36         private delegate bool ActionPreviousEventCallbackDelegate(IntPtr accessibilityManager);
37         private DaliEventHandlerWithReturnType<object, ActionPreviousEventArgs, bool> _accessibilityManagerActionPreviousEventHandler;
38         private ActionPreviousEventCallbackDelegate _accessibilityManagerActionPreviousEventCallbackDelegate;
39
40         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
41         private delegate bool ActionActivateEventCallbackDelegate(IntPtr accessibilityManager);
42         private DaliEventHandlerWithReturnType<object, ActionActivateEventArgs, bool> _accessibilityManagerActionActivateEventHandler;
43         private ActionActivateEventCallbackDelegate _accessibilityManagerActionActivateEventCallbackDelegate;
44
45         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
46         private delegate bool ActionReadEventCallbackDelegate(IntPtr accessibilityManager);
47         private DaliEventHandlerWithReturnType<object, ActionReadEventArgs, bool> _accessibilityManagerActionReadEventHandler;
48         private ActionReadEventCallbackDelegate _accessibilityManagerActionReadEventCallbackDelegate;
49
50         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
51         private delegate bool ActionOverEventCallbackDelegate(IntPtr accessibilityManager);
52         private DaliEventHandlerWithReturnType<object, ActionOverEventArgs, bool> _accessibilityManagerActionOverEventHandler;
53         private ActionOverEventCallbackDelegate _accessibilityManagerActionOverEventCallbackDelegate;
54
55         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
56         private delegate bool ActionReadNextEventCallbackDelegate(IntPtr accessibilityManager);
57         private DaliEventHandlerWithReturnType<object, ActionReadNextEventArgs, bool> _accessibilityManagerActionReadNextEventHandler;
58         private ActionReadNextEventCallbackDelegate _accessibilityManagerActionReadNextEventCallbackDelegate;
59
60         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
61         private delegate bool ActionReadPreviousEventCallbackDelegate(IntPtr accessibilityManager);
62         private DaliEventHandlerWithReturnType<object, ActionReadPreviousEventArgs, bool> _accessibilityManagerActionReadPreviousEventHandler;
63         private ActionReadPreviousEventCallbackDelegate _accessibilityManagerActionReadPreviousEventCallbackDelegate;
64
65         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
66         private delegate bool ActionUpEventCallbackDelegate(IntPtr accessibilityManager);
67         private DaliEventHandlerWithReturnType<object, ActionUpEventArgs, bool> _accessibilityManagerActionUpEventHandler;
68         private ActionUpEventCallbackDelegate _accessibilityManagerActionUpEventCallbackDelegate;
69
70         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
71         private delegate bool ActionDownEventCallbackDelegate(IntPtr accessibilityManager);
72         private DaliEventHandlerWithReturnType<object, ActionDownEventArgs, bool> _accessibilityManagerActionDownEventHandler;
73         private ActionDownEventCallbackDelegate _accessibilityManagerActionDownEventCallbackDelegate;
74
75         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
76         private delegate bool ActionClearFocusEventCallbackDelegate(IntPtr accessibilityManager);
77         private DaliEventHandlerWithReturnType<object, ActionClearFocusEventArgs, bool> _accessibilityManagerActionClearFocusEventHandler;
78         private ActionClearFocusEventCallbackDelegate _accessibilityManagerActionClearFocusEventCallbackDelegate;
79
80         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
81         private delegate bool ActionBackEventCallbackDelegate(IntPtr accessibilityManager);
82         private DaliEventHandlerWithReturnType<object, ActionBackEventArgs, bool> _accessibilityManagerActionBackEventHandler;
83         private ActionBackEventCallbackDelegate _accessibilityManagerActionBackEventCallbackDelegate;
84
85         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
86         private delegate bool ActionScrollUpEventCallbackDelegate(IntPtr accessibilityManager);
87         private DaliEventHandlerWithReturnType<object, ActionScrollUpEventArgs, bool> _accessibilityManagerActionScrollUpEventHandler;
88         private ActionScrollUpEventCallbackDelegate _accessibilityManagerActionScrollUpEventCallbackDelegate;
89
90         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
91         private delegate bool ActionScrollDownEventCallbackDelegate(IntPtr accessibilityManager);
92         private DaliEventHandlerWithReturnType<object, ActionScrollDownEventArgs, bool> _accessibilityManagerActionScrollDownEventHandler;
93         private ActionScrollDownEventCallbackDelegate _accessibilityManagerActionScrollDownEventCallbackDelegate;
94
95         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
96         private delegate bool ActionPageLeftEventCallbackDelegate(IntPtr accessibilityManager);
97         private DaliEventHandlerWithReturnType<object, ActionPageLeftEventArgs, bool> _accessibilityManagerActionPageLeftEventHandler;
98         private ActionPageLeftEventCallbackDelegate _accessibilityManagerActionPageLeftEventCallbackDelegate;
99
100         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
101         private delegate bool ActionPageRightEventCallbackDelegate(IntPtr accessibilityManager);
102         private DaliEventHandlerWithReturnType<object, ActionPageRightEventArgs, bool> _accessibilityManagerActionPageRightEventHandler;
103         private ActionPageRightEventCallbackDelegate _accessibilityManagerActionPageRightEventCallbackDelegate;
104
105         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
106         private delegate bool ActionPageUpEventCallbackDelegate(IntPtr accessibilityManager);
107         private DaliEventHandlerWithReturnType<object, ActionPageUpEventArgs, bool> _accessibilityManagerActionPageUpEventHandler;
108         private ActionPageUpEventCallbackDelegate _accessibilityManagerActionPageUpEventCallbackDelegate;
109
110         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
111         private delegate bool ActionPageDownEventCallbackDelegate(IntPtr accessibilityManager);
112         private DaliEventHandlerWithReturnType<object, ActionPageDownEventArgs, bool> _accessibilityManagerActionPageDownEventHandler;
113         private ActionPageDownEventCallbackDelegate _accessibilityManagerActionPageDownEventCallbackDelegate;
114
115         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
116         private delegate bool ActionMoveToFirstEventCallbackDelegate(IntPtr accessibilityManager);
117         private DaliEventHandlerWithReturnType<object, ActionMoveToFirstEventArgs, bool> _accessibilityManagerActionMoveToFirstEventHandler;
118         private ActionMoveToFirstEventCallbackDelegate _accessibilityManagerActionMoveToFirstEventCallbackDelegate;
119
120         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
121         private delegate bool ActionMoveToLastEventCallbackDelegate(IntPtr accessibilityManager);
122         private DaliEventHandlerWithReturnType<object, ActionMoveToLastEventArgs, bool> _accessibilityManagerActionMoveToLastEventHandler;
123         private ActionMoveToLastEventCallbackDelegate _accessibilityManagerActionMoveToLastEventCallbackDelegate;
124
125         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
126         private delegate bool ActionReadFromTopEventCallbackDelegate(IntPtr accessibilityManager);
127         private DaliEventHandlerWithReturnType<object, ActionReadFromTopEventArgs, bool> _accessibilityManagerActionReadFromTopEventHandler;
128         private ActionReadFromTopEventCallbackDelegate _accessibilityManagerActionReadFromTopEventCallbackDelegate;
129
130         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
131         private delegate bool ActionReadFromNextEventCallbackDelegate(IntPtr accessibilityManager);
132         private DaliEventHandlerWithReturnType<object, ActionReadFromNextEventArgs, bool> _accessibilityManagerActionReadFromNextEventHandler;
133         private ActionReadFromNextEventCallbackDelegate _accessibilityManagerActionReadFromNextEventCallbackDelegate;
134
135         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
136         private delegate bool ActionZoomEventCallbackDelegate(IntPtr accessibilityManager);
137         private DaliEventHandlerWithReturnType<object, ActionZoomEventArgs, bool> _accessibilityManagerActionZoomEventHandler;
138         private ActionZoomEventCallbackDelegate _accessibilityManagerActionZoomEventCallbackDelegate;
139
140         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
141         private delegate bool ActionReadIndicatorInformationEventCallbackDelegate(IntPtr accessibilityManager);
142         private DaliEventHandlerWithReturnType<object, ActionReadIndicatorInformationEventArgs, bool> _accessibilityManagerActionReadIndicatorInformationEventHandler;
143         private ActionReadIndicatorInformationEventCallbackDelegate _accessibilityManagerActionReadIndicatorInformationEventCallbackDelegate;
144
145         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
146         private delegate bool ActionReadPauseResumeEventCallbackDelegate(IntPtr accessibilityManager);
147         private DaliEventHandlerWithReturnType<object, ActionReadPauseResumeEventArgs, bool> _accessibilityManagerActionReadPauseResumeEventHandler;
148         private ActionReadPauseResumeEventCallbackDelegate _accessibilityManagerActionReadPauseResumeEventCallbackDelegate;
149
150         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
151         private delegate bool ActionStartStopEventCallbackDelegate(IntPtr accessibilityManager);
152         private DaliEventHandlerWithReturnType<object, ActionStartStopEventArgs, bool> _accessibilityManagerActionStartStopEventHandler;
153         private ActionStartStopEventCallbackDelegate _accessibilityManagerActionStartStopEventCallbackDelegate;
154
155         /*
156             // To be replaced by a new event that takes Touch
157             [UnmanagedFunctionPointer(CallingConvention.StdCall)]
158             private delegate bool ActionScrollEventCallbackDelegate(IntPtr accessibilityManager, IntPtr touchEvent);
159             private DaliEventHandlerWithReturnType<object,ActionScrollEventArgs,bool> _accessibilityManagerActionScrollEventHandler;
160             private ActionScrollEventCallbackDelegate _accessibilityManagerActionScrollEventCallbackDelegate;
161         */
162
163         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
164         private delegate void FocusChangedEventCallbackDelegate(IntPtr view1, IntPtr view2);
165         private DaliEventHandler<object, FocusChangedEventArgs> _accessibilityManagerFocusChangedEventHandler;
166         private FocusChangedEventCallbackDelegate _accessibilityManagerFocusChangedEventCallbackDelegate;
167
168         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
169         private delegate void FocusedViewActivatedEventCallbackDelegate(IntPtr view);
170         private DaliEventHandler<object, FocusedViewActivatedEventArgs> _accessibilityManagerFocusedViewActivatedEventHandler;
171         private FocusedViewActivatedEventCallbackDelegate _accessibilityManagerFocusedViewActivatedEventCallbackDelegate;
172
173         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
174         private delegate void FocusOvershotEventCallbackDelegate(IntPtr currentFocusedView, AccessibilityManager.FocusOvershotDirection direction);
175         private DaliEventHandler<object, FocusOvershotEventArgs> _accessibilityManagerFocusOvershotEventHandler;
176         private FocusOvershotEventCallbackDelegate _accessibilityManagerFocusOvershotEventCallbackDelegate;
177
178         public event DaliEventHandlerWithReturnType<object, StatusChangedEventArgs, bool> StatusChanged
179         {
180             add
181             {
182                 lock (this)
183                 {
184                     // Restricted to only one listener
185                     if (_accessibilityManagerStatusChangedEventHandler == null)
186                     {
187                         _accessibilityManagerStatusChangedEventHandler += value;
188
189                         _accessibilityManagerStatusChangedEventCallbackDelegate = new StatusChangedEventCallbackDelegate(OnStatusChanged);
190                         this.StatusChangedSignal().Connect(_accessibilityManagerStatusChangedEventCallbackDelegate);
191                     }
192                 }
193             }
194
195             remove
196             {
197                 lock (this)
198                 {
199                     if (_accessibilityManagerStatusChangedEventHandler != null)
200                     {
201                         this.StatusChangedSignal().Disconnect(_accessibilityManagerStatusChangedEventCallbackDelegate);
202                     }
203
204                     _accessibilityManagerStatusChangedEventHandler -= value;
205                 }
206             }
207         }
208
209         public event DaliEventHandlerWithReturnType<object, ActionNextEventArgs, bool> ActionNext
210         {
211             add
212             {
213                 lock (this)
214                 {
215                     // Restricted to only one listener
216                     if (_accessibilityManagerActionNextEventHandler == null)
217                     {
218                         _accessibilityManagerActionNextEventHandler += value;
219
220                         _accessibilityManagerActionNextEventCallbackDelegate = new ActionNextEventCallbackDelegate(OnActionNext);
221                         this.ActionNextSignal().Connect(_accessibilityManagerActionNextEventCallbackDelegate);
222                     }
223                 }
224             }
225
226             remove
227             {
228                 lock (this)
229                 {
230                     if (_accessibilityManagerActionNextEventHandler != null)
231                     {
232                         this.ActionNextSignal().Disconnect(_accessibilityManagerActionNextEventCallbackDelegate);
233                     }
234
235                     _accessibilityManagerActionNextEventHandler -= value;
236                 }
237             }
238         }
239
240         public event DaliEventHandlerWithReturnType<object, ActionPreviousEventArgs, bool> ActionPrevious
241         {
242             add
243             {
244                 lock (this)
245                 {
246                     // Restricted to only one listener
247                     if (_accessibilityManagerActionPreviousEventHandler == null)
248                     {
249                         _accessibilityManagerActionPreviousEventHandler += value;
250
251                         _accessibilityManagerActionPreviousEventCallbackDelegate = new ActionPreviousEventCallbackDelegate(OnActionPrevious);
252                         this.ActionPreviousSignal().Connect(_accessibilityManagerActionPreviousEventCallbackDelegate);
253                     }
254                 }
255             }
256
257             remove
258             {
259                 lock (this)
260                 {
261                     if (_accessibilityManagerActionPreviousEventHandler != null)
262                     {
263                         this.ActionPreviousSignal().Disconnect(_accessibilityManagerActionPreviousEventCallbackDelegate);
264                     }
265
266                     _accessibilityManagerActionPreviousEventHandler -= value;
267                 }
268             }
269         }
270
271         public event DaliEventHandlerWithReturnType<object, ActionActivateEventArgs, bool> ActionActivate
272         {
273             add
274             {
275                 lock (this)
276                 {
277                     // Restricted to only one listener
278                     if (_accessibilityManagerActionActivateEventHandler == null)
279                     {
280                         _accessibilityManagerActionActivateEventHandler += value;
281
282                         _accessibilityManagerActionActivateEventCallbackDelegate = new ActionActivateEventCallbackDelegate(OnActionActivate);
283                         this.ActionActivateSignal().Connect(_accessibilityManagerActionActivateEventCallbackDelegate);
284                     }
285                 }
286             }
287
288             remove
289             {
290                 lock (this)
291                 {
292                     if (_accessibilityManagerActionActivateEventHandler != null)
293                     {
294                         this.ActionActivateSignal().Disconnect(_accessibilityManagerActionActivateEventCallbackDelegate);
295                     }
296
297                     _accessibilityManagerActionActivateEventHandler -= value;
298                 }
299             }
300         }
301
302         public event DaliEventHandlerWithReturnType<object, ActionReadEventArgs, bool> ActionRead
303         {
304             add
305             {
306                 lock (this)
307                 {
308                     // Restricted to only one listener
309                     if (_accessibilityManagerActionReadEventHandler == null)
310                     {
311                         _accessibilityManagerActionReadEventHandler += value;
312
313                         _accessibilityManagerActionReadEventCallbackDelegate = new ActionReadEventCallbackDelegate(OnActionRead);
314                         this.ActionReadSignal().Connect(_accessibilityManagerActionReadEventCallbackDelegate);
315                     }
316                 }
317             }
318
319             remove
320             {
321                 lock (this)
322                 {
323                     if (_accessibilityManagerActionReadEventHandler != null)
324                     {
325                         this.ActionReadSignal().Disconnect(_accessibilityManagerActionReadEventCallbackDelegate);
326                     }
327
328                     _accessibilityManagerActionReadEventHandler -= value;
329                 }
330             }
331         }
332
333         public event DaliEventHandlerWithReturnType<object, ActionOverEventArgs, bool> ActionOver
334         {
335             add
336             {
337                 lock (this)
338                 {
339                     // Restricted to only one listener
340                     if (_accessibilityManagerActionOverEventHandler == null)
341                     {
342                         _accessibilityManagerActionOverEventHandler += value;
343
344                         _accessibilityManagerActionOverEventCallbackDelegate = new ActionOverEventCallbackDelegate(OnActionOver);
345                         this.ActionOverSignal().Connect(_accessibilityManagerActionOverEventCallbackDelegate);
346                     }
347                 }
348             }
349
350             remove
351             {
352                 lock (this)
353                 {
354                     if (_accessibilityManagerActionOverEventHandler != null)
355                     {
356                         this.ActionOverSignal().Disconnect(_accessibilityManagerActionOverEventCallbackDelegate);
357                     }
358
359                     _accessibilityManagerActionOverEventHandler -= value;
360                 }
361             }
362         }
363
364         public event DaliEventHandlerWithReturnType<object, ActionReadNextEventArgs, bool> ActionReadNext
365         {
366             add
367             {
368                 lock (this)
369                 {
370                     // Restricted to only one listener
371                     if (_accessibilityManagerActionReadNextEventHandler == null)
372                     {
373                         _accessibilityManagerActionReadNextEventHandler += value;
374
375                         _accessibilityManagerActionReadNextEventCallbackDelegate = new ActionReadNextEventCallbackDelegate(OnActionReadNext);
376                         this.ActionReadNextSignal().Connect(_accessibilityManagerActionReadNextEventCallbackDelegate);
377                     }
378                 }
379             }
380
381             remove
382             {
383                 lock (this)
384                 {
385                     if (_accessibilityManagerActionReadNextEventHandler != null)
386                     {
387                         this.ActionReadNextSignal().Disconnect(_accessibilityManagerActionReadNextEventCallbackDelegate);
388                     }
389
390                     _accessibilityManagerActionReadNextEventHandler -= value;
391                 }
392             }
393         }
394
395         public event DaliEventHandlerWithReturnType<object, ActionReadPreviousEventArgs, bool> ActionReadPrevious
396         {
397             add
398             {
399                 lock (this)
400                 {
401                     // Restricted to only one listener
402                     if (_accessibilityManagerActionReadPreviousEventHandler == null)
403                     {
404                         _accessibilityManagerActionReadPreviousEventHandler += value;
405
406                         _accessibilityManagerActionReadPreviousEventCallbackDelegate = new ActionReadPreviousEventCallbackDelegate(OnActionReadPrevious);
407                         this.ActionReadPreviousSignal().Connect(_accessibilityManagerActionReadPreviousEventCallbackDelegate);
408                     }
409                 }
410             }
411
412             remove
413             {
414                 lock (this)
415                 {
416                     if (_accessibilityManagerActionReadPreviousEventHandler != null)
417                     {
418                         this.ActionReadPreviousSignal().Disconnect(_accessibilityManagerActionReadPreviousEventCallbackDelegate);
419                     }
420
421                     _accessibilityManagerActionReadPreviousEventHandler -= value;
422                 }
423             }
424         }
425
426         public event DaliEventHandlerWithReturnType<object, ActionUpEventArgs, bool> ActionUp
427         {
428             add
429             {
430                 lock (this)
431                 {
432                     // Restricted to only one listener
433                     if (_accessibilityManagerActionUpEventHandler == null)
434                     {
435                         _accessibilityManagerActionUpEventHandler += value;
436
437                         _accessibilityManagerActionUpEventCallbackDelegate = new ActionUpEventCallbackDelegate(OnActionUp);
438                         this.ActionUpSignal().Connect(_accessibilityManagerActionUpEventCallbackDelegate);
439                     }
440                 }
441             }
442
443             remove
444             {
445                 lock (this)
446                 {
447                     if (_accessibilityManagerActionUpEventHandler != null)
448                     {
449                         this.ActionUpSignal().Disconnect(_accessibilityManagerActionUpEventCallbackDelegate);
450                     }
451
452                     _accessibilityManagerActionUpEventHandler -= value;
453                 }
454             }
455         }
456
457         public event DaliEventHandlerWithReturnType<object, ActionDownEventArgs, bool> ActionDown
458         {
459             add
460             {
461                 lock (this)
462                 {
463                     // Restricted to only one listener
464                     if (_accessibilityManagerActionDownEventHandler == null)
465                     {
466                         _accessibilityManagerActionDownEventHandler += value;
467
468                         _accessibilityManagerActionDownEventCallbackDelegate = new ActionDownEventCallbackDelegate(OnActionDown);
469                         this.ActionDownSignal().Connect(_accessibilityManagerActionDownEventCallbackDelegate);
470                     }
471                 }
472             }
473
474             remove
475             {
476                 lock (this)
477                 {
478                     if (_accessibilityManagerActionDownEventHandler != null)
479                     {
480                         this.ActionDownSignal().Disconnect(_accessibilityManagerActionDownEventCallbackDelegate);
481                     }
482
483                     _accessibilityManagerActionDownEventHandler -= value;
484                 }
485             }
486         }
487
488         public event DaliEventHandlerWithReturnType<object, ActionClearFocusEventArgs, bool> ActionClearFocus
489         {
490             add
491             {
492                 lock (this)
493                 {
494                     // Restricted to only one listener
495                     if (_accessibilityManagerActionClearFocusEventHandler == null)
496                     {
497                         _accessibilityManagerActionClearFocusEventHandler += value;
498
499                         _accessibilityManagerActionClearFocusEventCallbackDelegate = new ActionClearFocusEventCallbackDelegate(OnActionClearFocus);
500                         this.ActionClearFocusSignal().Connect(_accessibilityManagerActionClearFocusEventCallbackDelegate);
501                     }
502                 }
503             }
504
505             remove
506             {
507                 lock (this)
508                 {
509                     if (_accessibilityManagerActionClearFocusEventHandler != null)
510                     {
511                         this.ActionClearFocusSignal().Disconnect(_accessibilityManagerActionClearFocusEventCallbackDelegate);
512                     }
513
514                     _accessibilityManagerActionClearFocusEventHandler -= value;
515                 }
516             }
517         }
518
519         public event DaliEventHandlerWithReturnType<object, ActionBackEventArgs, bool> ActionBack
520         {
521             add
522             {
523                 lock (this)
524                 {
525                     // Restricted to only one listener
526                     if (_accessibilityManagerActionBackEventHandler == null)
527                     {
528                         _accessibilityManagerActionBackEventHandler += value;
529
530                         _accessibilityManagerActionBackEventCallbackDelegate = new ActionBackEventCallbackDelegate(OnActionBack);
531                         this.ActionBackSignal().Connect(_accessibilityManagerActionBackEventCallbackDelegate);
532                     }
533                 }
534             }
535
536             remove
537             {
538                 lock (this)
539                 {
540                     if (_accessibilityManagerActionBackEventHandler != null)
541                     {
542                         this.ActionBackSignal().Disconnect(_accessibilityManagerActionBackEventCallbackDelegate);
543                     }
544
545                     _accessibilityManagerActionBackEventHandler -= value;
546                 }
547             }
548         }
549
550         public event DaliEventHandlerWithReturnType<object, ActionScrollUpEventArgs, bool> ActionScrollUp
551         {
552             add
553             {
554                 lock (this)
555                 {
556                     // Restricted to only one listener
557                     if (_accessibilityManagerActionScrollUpEventHandler == null)
558                     {
559                         _accessibilityManagerActionScrollUpEventHandler += value;
560
561                         _accessibilityManagerActionScrollUpEventCallbackDelegate = new ActionScrollUpEventCallbackDelegate(OnActionScrollUp);
562                         this.ActionScrollUpSignal().Connect(_accessibilityManagerActionScrollUpEventCallbackDelegate);
563                     }
564                 }
565             }
566
567             remove
568             {
569                 lock (this)
570                 {
571                     if (_accessibilityManagerActionScrollUpEventHandler != null)
572                     {
573                         this.ActionScrollUpSignal().Disconnect(_accessibilityManagerActionScrollUpEventCallbackDelegate);
574                     }
575
576                     _accessibilityManagerActionScrollUpEventHandler -= value;
577                 }
578             }
579         }
580
581         public event DaliEventHandlerWithReturnType<object, ActionScrollDownEventArgs, bool> ActionScrollDown
582         {
583             add
584             {
585                 lock (this)
586                 {
587                     // Restricted to only one listener
588                     if (_accessibilityManagerActionScrollDownEventHandler == null)
589                     {
590                         _accessibilityManagerActionScrollDownEventHandler += value;
591
592                         _accessibilityManagerActionScrollDownEventCallbackDelegate = new ActionScrollDownEventCallbackDelegate(OnActionScrollDown);
593                         this.ActionScrollDownSignal().Connect(_accessibilityManagerActionScrollDownEventCallbackDelegate);
594                     }
595                 }
596             }
597
598             remove
599             {
600                 lock (this)
601                 {
602                     if (_accessibilityManagerActionScrollDownEventHandler != null)
603                     {
604                         this.ActionScrollDownSignal().Disconnect(_accessibilityManagerActionScrollDownEventCallbackDelegate);
605                     }
606
607                     _accessibilityManagerActionScrollDownEventHandler -= value;
608                 }
609             }
610         }
611
612         public event DaliEventHandlerWithReturnType<object, ActionPageLeftEventArgs, bool> ActionPageLeft
613         {
614             add
615             {
616                 lock (this)
617                 {
618                     // Restricted to only one listener
619                     if (_accessibilityManagerActionPageLeftEventHandler == null)
620                     {
621                         _accessibilityManagerActionPageLeftEventHandler += value;
622
623                         _accessibilityManagerActionPageLeftEventCallbackDelegate = new ActionPageLeftEventCallbackDelegate(OnActionPageLeft);
624                         this.ActionPageLeftSignal().Connect(_accessibilityManagerActionPageLeftEventCallbackDelegate);
625                     }
626                 }
627             }
628
629             remove
630             {
631                 lock (this)
632                 {
633                     if (_accessibilityManagerActionPageLeftEventHandler != null)
634                     {
635                         this.ActionPageLeftSignal().Disconnect(_accessibilityManagerActionPageLeftEventCallbackDelegate);
636                     }
637
638                     _accessibilityManagerActionPageLeftEventHandler -= value;
639                 }
640             }
641         }
642
643         public event DaliEventHandlerWithReturnType<object, ActionPageRightEventArgs, bool> ActionPageRight
644         {
645             add
646             {
647                 lock (this)
648                 {
649                     // Restricted to only one listener
650                     if (_accessibilityManagerActionPageRightEventHandler == null)
651                     {
652                         _accessibilityManagerActionPageRightEventHandler += value;
653
654                         _accessibilityManagerActionPageRightEventCallbackDelegate = new ActionPageRightEventCallbackDelegate(OnActionPageRight);
655                         this.ActionPageRightSignal().Connect(_accessibilityManagerActionPageRightEventCallbackDelegate);
656                     }
657                 }
658             }
659
660             remove
661             {
662                 lock (this)
663                 {
664                     if (_accessibilityManagerActionPageRightEventHandler != null)
665                     {
666                         this.ActionPageRightSignal().Disconnect(_accessibilityManagerActionPageRightEventCallbackDelegate);
667                     }
668
669                     _accessibilityManagerActionPageRightEventHandler -= value;
670                 }
671             }
672         }
673
674         public event DaliEventHandlerWithReturnType<object, ActionPageUpEventArgs, bool> ActionPageUp
675         {
676             add
677             {
678                 lock (this)
679                 {
680                     // Restricted to only one listener
681                     if (_accessibilityManagerActionPageUpEventHandler == null)
682                     {
683                         _accessibilityManagerActionPageUpEventHandler += value;
684
685                         _accessibilityManagerActionPageUpEventCallbackDelegate = new ActionPageUpEventCallbackDelegate(OnActionPageUp);
686                         this.ActionPageUpSignal().Connect(_accessibilityManagerActionPageUpEventCallbackDelegate);
687                     }
688                 }
689             }
690
691             remove
692             {
693                 lock (this)
694                 {
695                     if (_accessibilityManagerActionPageUpEventHandler != null)
696                     {
697                         this.ActionPageUpSignal().Disconnect(_accessibilityManagerActionPageUpEventCallbackDelegate);
698                     }
699
700                     _accessibilityManagerActionPageUpEventHandler -= value;
701                 }
702             }
703         }
704
705         public event DaliEventHandlerWithReturnType<object, ActionPageDownEventArgs, bool> ActionPageDown
706         {
707             add
708             {
709                 lock (this)
710                 {
711                     // Restricted to only one listener
712                     if (_accessibilityManagerActionPageDownEventHandler == null)
713                     {
714                         _accessibilityManagerActionPageDownEventHandler += value;
715
716                         _accessibilityManagerActionPageDownEventCallbackDelegate = new ActionPageDownEventCallbackDelegate(OnActionPageDown);
717                         this.ActionPageDownSignal().Connect(_accessibilityManagerActionPageDownEventCallbackDelegate);
718                     }
719                 }
720             }
721
722             remove
723             {
724                 lock (this)
725                 {
726                     if (_accessibilityManagerActionPageDownEventHandler != null)
727                     {
728                         this.ActionPageDownSignal().Disconnect(_accessibilityManagerActionPageDownEventCallbackDelegate);
729                     }
730
731                     _accessibilityManagerActionPageDownEventHandler -= value;
732                 }
733             }
734         }
735
736         public event DaliEventHandlerWithReturnType<object, ActionMoveToFirstEventArgs, bool> ActionMoveToFirst
737         {
738             add
739             {
740                 lock (this)
741                 {
742                     // Restricted to only one listener
743                     if (_accessibilityManagerActionMoveToFirstEventHandler == null)
744                     {
745                         _accessibilityManagerActionMoveToFirstEventHandler += value;
746
747                         _accessibilityManagerActionMoveToFirstEventCallbackDelegate = new ActionMoveToFirstEventCallbackDelegate(OnActionMoveToFirst);
748                         this.ActionMoveToFirstSignal().Connect(_accessibilityManagerActionMoveToFirstEventCallbackDelegate);
749                     }
750                 }
751             }
752
753             remove
754             {
755                 lock (this)
756                 {
757                     if (_accessibilityManagerActionMoveToFirstEventHandler != null)
758                     {
759                         this.ActionMoveToFirstSignal().Disconnect(_accessibilityManagerActionMoveToFirstEventCallbackDelegate);
760                     }
761
762                     _accessibilityManagerActionMoveToFirstEventHandler -= value;
763                 }
764             }
765         }
766
767         public event DaliEventHandlerWithReturnType<object, ActionMoveToLastEventArgs, bool> ActionMoveToLast
768         {
769             add
770             {
771                 lock (this)
772                 {
773                     // Restricted to only one listener
774                     if (_accessibilityManagerActionMoveToLastEventHandler == null)
775                     {
776                         _accessibilityManagerActionMoveToLastEventHandler += value;
777
778                         _accessibilityManagerActionMoveToLastEventCallbackDelegate = new ActionMoveToLastEventCallbackDelegate(OnActionMoveToLast);
779                         this.ActionMoveToLastSignal().Connect(_accessibilityManagerActionMoveToLastEventCallbackDelegate);
780                     }
781                 }
782             }
783
784             remove
785             {
786                 lock (this)
787                 {
788                     if (_accessibilityManagerActionMoveToLastEventHandler != null)
789                     {
790                         this.ActionMoveToLastSignal().Disconnect(_accessibilityManagerActionMoveToLastEventCallbackDelegate);
791                     }
792
793                     _accessibilityManagerActionMoveToLastEventHandler -= value;
794                 }
795             }
796         }
797
798         public event DaliEventHandlerWithReturnType<object, ActionReadFromTopEventArgs, bool> ActionReadFromTop
799         {
800             add
801             {
802                 lock (this)
803                 {
804                     // Restricted to only one listener
805                     if (_accessibilityManagerActionReadFromTopEventHandler == null)
806                     {
807                         _accessibilityManagerActionReadFromTopEventHandler += value;
808
809                         _accessibilityManagerActionReadFromTopEventCallbackDelegate = new ActionReadFromTopEventCallbackDelegate(OnActionReadFromTop);
810                         this.ActionReadFromTopSignal().Connect(_accessibilityManagerActionReadFromTopEventCallbackDelegate);
811                     }
812                 }
813             }
814
815             remove
816             {
817                 lock (this)
818                 {
819                     if (_accessibilityManagerActionReadFromTopEventHandler != null)
820                     {
821                         this.ActionReadFromTopSignal().Disconnect(_accessibilityManagerActionReadFromTopEventCallbackDelegate);
822                     }
823
824                     _accessibilityManagerActionReadFromTopEventHandler -= value;
825                 }
826             }
827         }
828
829         public event DaliEventHandlerWithReturnType<object, ActionReadFromNextEventArgs, bool> ActionReadFromNext
830         {
831             add
832             {
833                 lock (this)
834                 {
835                     // Restricted to only one listener
836                     if (_accessibilityManagerActionReadFromNextEventHandler == null)
837                     {
838                         _accessibilityManagerActionReadFromNextEventHandler += value;
839
840                         _accessibilityManagerActionReadFromNextEventCallbackDelegate = new ActionReadFromNextEventCallbackDelegate(OnActionReadFromNext);
841                         this.ActionReadFromNextSignal().Connect(_accessibilityManagerActionReadFromNextEventCallbackDelegate);
842                     }
843                 }
844             }
845
846             remove
847             {
848                 lock (this)
849                 {
850                     if (_accessibilityManagerActionReadFromNextEventHandler != null)
851                     {
852                         this.ActionReadFromNextSignal().Disconnect(_accessibilityManagerActionReadFromNextEventCallbackDelegate);
853                     }
854
855                     _accessibilityManagerActionReadFromNextEventHandler -= value;
856                 }
857             }
858         }
859
860         public event DaliEventHandlerWithReturnType<object, ActionZoomEventArgs, bool> ActionZoom
861         {
862             add
863             {
864                 lock (this)
865                 {
866                     // Restricted to only one listener
867                     if (_accessibilityManagerActionZoomEventHandler == null)
868                     {
869                         _accessibilityManagerActionZoomEventHandler += value;
870
871                         _accessibilityManagerActionZoomEventCallbackDelegate = new ActionZoomEventCallbackDelegate(OnActionZoom);
872                         this.ActionZoomSignal().Connect(_accessibilityManagerActionZoomEventCallbackDelegate);
873                     }
874                 }
875             }
876
877             remove
878             {
879                 lock (this)
880                 {
881                     if (_accessibilityManagerActionZoomEventHandler != null)
882                     {
883                         this.ActionZoomSignal().Disconnect(_accessibilityManagerActionZoomEventCallbackDelegate);
884                     }
885
886                     _accessibilityManagerActionZoomEventHandler -= value;
887                 }
888             }
889         }
890
891         public event DaliEventHandlerWithReturnType<object, ActionReadIndicatorInformationEventArgs, bool> ActionReadIndicatorInformation
892         {
893             add
894             {
895                 lock (this)
896                 {
897                     // Restricted to only one listener
898                     if (_accessibilityManagerActionReadIndicatorInformationEventHandler == null)
899                     {
900                         _accessibilityManagerActionReadIndicatorInformationEventHandler += value;
901
902                         _accessibilityManagerActionReadIndicatorInformationEventCallbackDelegate = new ActionReadIndicatorInformationEventCallbackDelegate(OnActionReadIndicatorInformation);
903                         this.ActionReadIndicatorInformationSignal().Connect(_accessibilityManagerActionReadIndicatorInformationEventCallbackDelegate);
904                     }
905                 }
906             }
907
908             remove
909             {
910                 lock (this)
911                 {
912                     if (_accessibilityManagerActionReadIndicatorInformationEventHandler != null)
913                     {
914                         this.ActionReadIndicatorInformationSignal().Disconnect(_accessibilityManagerActionReadIndicatorInformationEventCallbackDelegate);
915                     }
916
917                     _accessibilityManagerActionReadIndicatorInformationEventHandler -= value;
918                 }
919             }
920         }
921
922         public event DaliEventHandlerWithReturnType<object, ActionReadPauseResumeEventArgs, bool> ActionReadPauseResume
923         {
924             add
925             {
926                 lock (this)
927                 {
928                     // Restricted to only one listener
929                     if (_accessibilityManagerActionReadPauseResumeEventHandler == null)
930                     {
931                         _accessibilityManagerActionReadPauseResumeEventHandler += value;
932
933                         _accessibilityManagerActionReadPauseResumeEventCallbackDelegate = new ActionReadPauseResumeEventCallbackDelegate(OnActionReadPauseResume);
934                         this.ActionReadPauseResumeSignal().Connect(_accessibilityManagerActionReadPauseResumeEventCallbackDelegate);
935                     }
936                 }
937             }
938
939             remove
940             {
941                 lock (this)
942                 {
943                     if (_accessibilityManagerActionReadPauseResumeEventHandler != null)
944                     {
945                         this.ActionReadPauseResumeSignal().Disconnect(_accessibilityManagerActionReadPauseResumeEventCallbackDelegate);
946                     }
947
948                     _accessibilityManagerActionReadPauseResumeEventHandler -= value;
949                 }
950             }
951         }
952
953         public event DaliEventHandlerWithReturnType<object, ActionStartStopEventArgs, bool> ActionStartStop
954         {
955             add
956             {
957                 lock (this)
958                 {
959                     // Restricted to only one listener
960                     if (_accessibilityManagerActionStartStopEventHandler == null)
961                     {
962                         _accessibilityManagerActionStartStopEventHandler += value;
963
964                         _accessibilityManagerActionStartStopEventCallbackDelegate = new ActionStartStopEventCallbackDelegate(OnActionStartStop);
965                         this.ActionStartStopSignal().Connect(_accessibilityManagerActionStartStopEventCallbackDelegate);
966                     }
967                 }
968             }
969
970             remove
971             {
972                 lock (this)
973                 {
974                     if (_accessibilityManagerActionStartStopEventHandler != null)
975                     {
976                         this.ActionStartStopSignal().Disconnect(_accessibilityManagerActionStartStopEventCallbackDelegate);
977                     }
978
979                     _accessibilityManagerActionStartStopEventHandler -= value;
980                 }
981             }
982         }
983
984         /*
985             // To be replaced by a new event that takes Touch
986             public event DaliEventHandlerWithReturnType<object,ActionScrollEventArgs,bool> ActionScroll
987             {
988               add
989               {
990                 lock(this)
991                 {
992                   // Restricted to only one listener
993                   if (_accessibilityManagerActionScrollEventHandler == null)
994                   {
995                     _accessibilityManagerActionScrollEventHandler += value;
996
997                     _accessibilityManagerActionScrollEventCallbackDelegate = new ActionScrollEventCallbackDelegate(OnActionScroll);
998                     this.ActionScrollSignal().Connect(_accessibilityManagerActionScrollEventCallbackDelegate);
999                   }
1000                 }
1001               }
1002
1003               remove
1004               {
1005                 lock(this)
1006                 {
1007                   if (_accessibilityManagerActionScrollEventHandler != null)
1008                   {
1009                     this.ActionScrollSignal().Disconnect(_accessibilityManagerActionScrollEventCallbackDelegate);
1010                   }
1011
1012                   _accessibilityManagerActionScrollEventHandler -= value;
1013                 }
1014               }
1015             }
1016
1017             // Callback for AccessibilityManager ActionScrollSignal
1018             private bool OnActionScroll(IntPtr accessibilityManager, IntPtr touchEvent)
1019             {
1020               ActionScrollEventArgs e = new ActionScrollEventArgs();
1021
1022               // Populate all members of "e" (ActionScrollEventArgs) with real data
1023               e.AccessibilityManager = AccessibilityManager.GetAccessibilityManagerFromPtr(accessibilityManager);
1024               e.TouchEvent = TouchEvent.GetTouchEventFromPtr(touchEvent);
1025
1026               if (_accessibilityManagerActionScrollEventHandler != null)
1027               {
1028                 //here we send all data to user event handlers
1029                 return _accessibilityManagerActionScrollEventHandler(this, e);
1030               }
1031               return false;
1032             }
1033         */
1034
1035         public event DaliEventHandler<object, FocusChangedEventArgs> FocusChanged
1036         {
1037             add
1038             {
1039                 lock (this)
1040                 {
1041                     // Restricted to only one listener
1042                     if (_accessibilityManagerFocusChangedEventHandler == null)
1043                     {
1044                         _accessibilityManagerFocusChangedEventHandler += value;
1045
1046                         _accessibilityManagerFocusChangedEventCallbackDelegate = new FocusChangedEventCallbackDelegate(OnFocusChanged);
1047                         this.FocusChangedSignal().Connect(_accessibilityManagerFocusChangedEventCallbackDelegate);
1048                     }
1049                 }
1050             }
1051
1052             remove
1053             {
1054                 lock (this)
1055                 {
1056                     if (_accessibilityManagerFocusChangedEventHandler != null)
1057                     {
1058                         this.FocusChangedSignal().Disconnect(_accessibilityManagerFocusChangedEventCallbackDelegate);
1059                     }
1060
1061                     _accessibilityManagerFocusChangedEventHandler -= value;
1062                 }
1063             }
1064         }
1065
1066         public event DaliEventHandler<object, FocusedViewActivatedEventArgs> FocusedViewActivated
1067         {
1068             add
1069             {
1070                 lock (this)
1071                 {
1072                     // Restricted to only one listener
1073                     if (_accessibilityManagerFocusedViewActivatedEventHandler == null)
1074                     {
1075                         _accessibilityManagerFocusedViewActivatedEventHandler += value;
1076
1077                         _accessibilityManagerFocusedViewActivatedEventCallbackDelegate = new FocusedViewActivatedEventCallbackDelegate(OnFocusedViewActivated);
1078                         this.FocusedViewActivatedSignal().Connect(_accessibilityManagerFocusedViewActivatedEventCallbackDelegate);
1079                     }
1080                 }
1081             }
1082
1083             remove
1084             {
1085                 lock (this)
1086                 {
1087                     if (_accessibilityManagerFocusedViewActivatedEventHandler != null)
1088                     {
1089                         this.FocusedViewActivatedSignal().Disconnect(_accessibilityManagerFocusedViewActivatedEventCallbackDelegate);
1090                     }
1091
1092                     _accessibilityManagerFocusedViewActivatedEventHandler -= value;
1093                 }
1094             }
1095         }
1096
1097         public event DaliEventHandler<object, FocusOvershotEventArgs> FocusOvershot
1098         {
1099             add
1100             {
1101                 lock (this)
1102                 {
1103                     // Restricted to only one listener
1104                     if (_accessibilityManagerFocusOvershotEventHandler == null)
1105                     {
1106                         _accessibilityManagerFocusOvershotEventHandler += value;
1107
1108                         _accessibilityManagerFocusOvershotEventCallbackDelegate = new FocusOvershotEventCallbackDelegate(OnFocusOvershot);
1109                         this.FocusOvershotSignal().Connect(_accessibilityManagerFocusOvershotEventCallbackDelegate);
1110                     }
1111                 }
1112             }
1113
1114             remove
1115             {
1116                 lock (this)
1117                 {
1118                     if (_accessibilityManagerFocusOvershotEventHandler != null)
1119                     {
1120                         this.FocusOvershotSignal().Disconnect(_accessibilityManagerFocusOvershotEventCallbackDelegate);
1121                     }
1122
1123                     _accessibilityManagerFocusOvershotEventHandler -= value;
1124                 }
1125             }
1126         }
1127     }
1128 }