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 17package android.view.accessibility; 18 19/** 20 * This interface is implemented by classes source of {@link AccessibilityEvent}s. 21 */ 22public 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()}, obtain 28 * an {@link AccessibilityEvent} from the event pool through calling 29 * {@link AccessibilityEvent#obtain(int)}, populate the event, and 30 * send it for dispatch via calling 31 * {@link AccessibilityManager#sendAccessibilityEvent(AccessibilityEvent)}. 32 * 33 * @see AccessibilityEvent 34 * @see AccessibilityManager 35 * 36 * @param eventType The event type. 37 */ 38 public void sendAccessibilityEvent(int eventType); 39 40 /** 41 * Handles the request for sending an {@link AccessibilityEvent}. The 42 * method does not guarantee to check if accessibility is on before 43 * sending the event for dispatch. It is responsibility of the caller 44 * to do the check via calling {@link AccessibilityManager#isEnabled()}. 45 * 46 * @see AccessibilityEvent 47 * @see AccessibilityManager 48 * 49 * @param event The event. 50 */ 51 public void sendAccessibilityEventUnchecked(AccessibilityEvent event); 52} 53