Home | History | Annotate | Download | only in accessibility
      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  * <div class="special reference">
     23  * <h3>Developer Guides</h3>
     24  * <p>For more information about making applications accessible, read the
     25  * <a href="{@docRoot}guide/topics/ui/accessibility/index.html">Accessibility</a>
     26  * developer guide.</p>
     27  * </div>
     28  */
     29 public interface AccessibilityEventSource {
     30 
     31     /**
     32      * Handles the request for sending an {@link AccessibilityEvent} given
     33      * the event type. The method must first check if accessibility is on
     34      * via calling {@link AccessibilityManager#isEnabled() AccessibilityManager.isEnabled()},
     35      * obtain an {@link AccessibilityEvent} from the event pool through calling
     36      * {@link AccessibilityEvent#obtain(int) AccessibilityEvent.obtain(int)}, populate the
     37      * event, and send it for dispatch via calling
     38      * {@link AccessibilityManager#sendAccessibilityEvent(AccessibilityEvent)
     39      * AccessibilityManager.sendAccessibilityEvent(AccessibilityEvent)}.
     40      *
     41      * @see AccessibilityEvent
     42      * @see AccessibilityManager
     43      *
     44      * @param eventType The event type.
     45      */
     46     public void sendAccessibilityEvent(int eventType);
     47 
     48     /**
     49      * Handles the request for sending an {@link AccessibilityEvent}. The
     50      * method does not guarantee to check if accessibility is on before
     51      * sending the event for dispatch. It is responsibility of the caller
     52      * to do the check via calling {@link AccessibilityManager#isEnabled()
     53      * AccessibilityManager.isEnabled()}.
     54      *
     55      * @see AccessibilityEvent
     56      * @see AccessibilityManager
     57      *
     58      * @param event The event.
     59      */
     60     public void sendAccessibilityEventUnchecked(AccessibilityEvent event);
     61 }
     62