• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2009 The Android Open Source Project
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 package android.view.accessibility;
18 
19 /**
20  * This interface is implemented by classes source of {@link AccessibilityEvent}s.
21  */
22 public interface AccessibilityEventSource {
23 
24     /**
25      * Handles the request for sending an {@link AccessibilityEvent} given
26      * the event type. The method must first check if accessibility is on
27      * via calling {@link AccessibilityManager#isEnabled() AccessibilityManager.isEnabled()},
28      * obtain an {@link AccessibilityEvent} from the event pool through calling
29      * {@link AccessibilityEvent#obtain(int) AccessibilityEvent.obtain(int)}, populate the
30      * event, and send it for dispatch via calling
31      * {@link AccessibilityManager#sendAccessibilityEvent(AccessibilityEvent)
32      * AccessibilityManager.sendAccessibilityEvent(AccessibilityEvent)}.
33      *
34      * @see AccessibilityEvent
35      * @see AccessibilityManager
36      *
37      * @param eventType The event type.
38      */
sendAccessibilityEvent(int eventType)39     public void sendAccessibilityEvent(int eventType);
40 
41     /**
42      * Handles the request for sending an {@link AccessibilityEvent}. The
43      * method does not guarantee to check if accessibility is on before
44      * sending the event for dispatch. It is responsibility of the caller
45      * to do the check via calling {@link AccessibilityManager#isEnabled()
46      * AccessibilityManager.isEnabled()}.
47      *
48      * @see AccessibilityEvent
49      * @see AccessibilityManager
50      *
51      * @param event The event.
52      */
sendAccessibilityEventUnchecked(AccessibilityEvent event)53     public void sendAccessibilityEventUnchecked(AccessibilityEvent event);
54 }
55