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