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 com.sun.star.uno;
25 
26 /**
27  * This is the delegator interface for Java objects implementing interfaces of
28  * an underlying UNO object.
29  *
30  * <p>Calls are delegated through the <code>UnoRuntime</code> to this
31  * interface.  Implement this interface in case you want to customize the
32  * behaviour of <code>UnoRuntime.queryInterface</code>.</p>
33  *
34  * @see com.sun.star.uno.UnoRuntime
35  */
36 public interface IQueryInterface {
37     /**
38      * Returns the unique object identifier (OID) of the underlying UNO object.
39      *
40      * @return the OID of the underlying object
41      */
getOid()42     String getOid();
43 
44     /**
45      * Returns an object implementing the requested interface type.
46      *
47      * @param type the requested UNO interface type; must be a <code>Type</code>
48      * object representing a UNO interface type
49      * @return a reference to the requested UNO interface type if available,
50      * otherwise <code>null</code>
51      * @see com.sun.star.uno.UnoRuntime
52      */
queryInterface(Type type)53     Object queryInterface(Type type);
54 
55     /**
56      * Tests if the given reference represents a facet of the underlying UNO
57      * object.
58      *
59      * @param object a reference to any Java object representing (a facet of) a
60      * UNO object; may be <code>null</code>
61      * @return <code>true</code> if and only if <code>object</code> is not
62      * <code>null</code> and represents the same UNO object as this object
63      */
isSame(Object object)64     boolean isSame(Object object);
65 }
66