1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 package com.sun.star.uno; 29 30 /** 31 * This is the delegator interface for Java objects implementing interfaces of 32 * an underlying UNO object. 33 * 34 * <p>Calls are delegated through the <code>UnoRuntime</code> to this 35 * interface. Implement this interface in case you want to customize the 36 * behaviour of <code>UnoRuntime.queryInterface</code>.</p> 37 * 38 * @see com.sun.star.uno.UnoRuntime 39 */ 40 public interface IQueryInterface { 41 /** 42 * Returns the unique object identifier (OID) of the underlying UNO object. 43 * 44 * @return the OID of the underlying object 45 */ 46 String getOid(); 47 48 /** 49 * Returns an object implementing the requested interface type. 50 * 51 * @param type the requested UNO interface type; must be a <code>Type</code> 52 * object representing a UNO interface type 53 * @return a reference to the requested UNO interface type if available, 54 * otherwise <code>null</code> 55 * @see com.sun.star.uno.UnoRuntime 56 */ 57 Object queryInterface(Type type); 58 59 /** 60 * Tests if the given reference represents a facet of the underlying UNO 61 * object. 62 * 63 * @param object a reference to any Java object representing (a facet of) a 64 * UNO object; may be <code>null</code> 65 * @return <code>true</code> if and only if <code>object</code> is not 66 * <code>null</code> and represents the same UNO object as this object 67 */ 68 boolean isSame(Object object); 69 } 70