1 /*
   2  * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 #import "JNIUtilities.h"
  27 
  28 extern NSString *const JavaAccessibilityIgnore;
  29 
  30 extern NSMutableDictionary *sRoles;
  31 extern void initializeRoles();
  32 
  33 #define GET_CACCESSIBILITY_CLASS() \
  34     GET_CLASS(sjc_CAccessibility, "sun/lwawt/macosx/CAccessibility");
  35 #define GET_CACCESSIBILITY_CLASS_RETURN(ret) \
  36     GET_CLASS_RETURN(sjc_CAccessibility, "sun/lwawt/macosx/CAccessibility", ret);
  37 
  38 NSSize getAxComponentSize(JNIEnv *env, jobject axComponent, jobject component);
  39 NSString *getJavaRole(JNIEnv *env, jobject axComponent, jobject component);
  40 jobject getAxSelection(JNIEnv *env, jobject axContext, jobject component);
  41 jobject getAxContextSelection(JNIEnv *env, jobject axContext, jint index, jobject component);
  42 void setAxContextSelection(JNIEnv *env, jobject axContext, jint index, jobject component);
  43 jobject getAxContext(JNIEnv *env, jobject accessible, jobject component);
  44 BOOL isChildSelected(JNIEnv *env, jobject accessible, jint index, jobject component);
  45 jobject getAxStateSet(JNIEnv *env, jobject axContext, jobject component);
  46 BOOL containsAxState(JNIEnv *env, jobject axContext, jobject axState, jobject component);
  47 BOOL isVertical(JNIEnv *env, jobject axContext, jobject component);
  48 BOOL isHorizontal(JNIEnv *env, jobject axContext, jobject component);
  49 BOOL isShowing(JNIEnv *env, jobject axContext, jobject component);
  50 BOOL isSelectable(JNIEnv *env, jobject axContext, jobject component);
  51 NSPoint getAxComponentLocationOnScreen(JNIEnv *env, jobject axComponent, jobject component);
  52 jint getAxTextCharCount(JNIEnv *env, jobject axText, jobject component);
  53 
  54 // these methods are copied from the corresponding NSAccessibility methods
  55 id JavaAccessibilityAttributeValue(id element, NSString *attribute);
  56 BOOL JavaAccessibilityIsAttributeSettable(id element, NSString *attribute);
  57 void JavaAccessibilitySetAttributeValue(id element, NSString *attribute, id value);
  58 
  59 // these methods are copied from the corresponding NSAccessibilityErrors methods
  60 void JavaAccessibilityRaiseSetAttributeToIllegalTypeException(const char *functionName, id element, NSString *attribute, id value);
  61 void JavaAccessibilityRaiseUnimplementedAttributeException(const char *functionName, id element, NSString *attribute);
  62 void JavaAccessibilityRaiseIllegalParameterTypeException(const char *functionName, id element, NSString *attribute, id parameter);