1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 package org.openoffice.java.accessibility; 25 26 import com.sun.star.accessibility.XAccessibleImage; 27 28 /** 29 */ 30 public class AccessibleIconImpl implements javax.accessibility.AccessibleIcon { 31 32 XAccessibleImage unoAccessibleImage; 33 AccessibleIconImpl(XAccessibleImage xImage)34 public AccessibleIconImpl(XAccessibleImage xImage) { 35 unoAccessibleImage = xImage; 36 } 37 38 /** Gets the description of the icon */ getAccessibleIconDescription()39 public String getAccessibleIconDescription() { 40 try { 41 return unoAccessibleImage.getAccessibleImageDescription(); 42 } catch (com.sun.star.uno.RuntimeException e) { 43 return null; 44 } 45 } 46 47 /** Gets the height of the icon */ getAccessibleIconHeight()48 public int getAccessibleIconHeight() { 49 try { 50 return unoAccessibleImage.getAccessibleImageHeight(); 51 } catch (com.sun.star.uno.RuntimeException e) { 52 return 0; 53 } 54 } 55 56 /** Gets the width of the icon */ getAccessibleIconWidth()57 public int getAccessibleIconWidth() { 58 try { 59 return unoAccessibleImage.getAccessibleImageWidth(); 60 } catch (com.sun.star.uno.RuntimeException e) { 61 return 0; 62 } 63 } 64 65 /** Sets the description of the icon */ setAccessibleIconDescription(String s)66 public void setAccessibleIconDescription(String s) { 67 // Not supported 68 } 69 } 70