1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XInterface.idl,v $
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 ************************************************************************/
30 #ifndef __com_sun_star_uno_XInterface_idl__
31 #define __com_sun_star_uno_XInterface_idl__
33 //=============================================================================
35 module com
{ module sun
{ module star
{ module uno
{
37 //=============================================================================
39 // DocMerge from xml: interface com::sun::star::uno::XInterface
40 /** base interface of all UNO interfaces
42 <p> It provides lifetime control by reference counting and the
43 possibility of querying for other
44 interfaces of the same logical object.
48 "Logical Object" in this case means that the
49 interfaces actually can be supported by internal (e.g. aggregated) physical objects.</p>
51 <p> Deriving from this interface is mandatory for all UNO interfaces.
52 <p> Each language binding (Java, C++, StarBasic, Python, ... ) may
53 provide a different mapping of this interface, please look into the language
54 dependent documention.
56 <p> The UNO object does not export the state of the reference count (acquire() and
57 release() do not have return values). In general, also the UNO object itself
58 should not make any assumption on the concrete value of the reference count
59 (except on the transition from one to zero ).
62 published
interface XInterface
64 /** queries for a new interface to an existing UNO object.
66 The queryInterface() method is the entry point to obtain other interfaces which
67 are exported by the object. The caller asks the implementation of the object,
68 if it supports the interface specified by the type argument. The call may either
69 return with a interface reference of the requested type or with a void any.
72 There are certain specifications, a queryInterface() implementation must not violate.
74 1) If queryInterface on a specific object has once returned a valid interface reference
75 for a given type, it must return a valid reference for any successive queryInterface
76 calls on this object for the same type.
78 2) If queryInterface on a specific object has once returned a null reference
79 for a given type, it must always return a null reference for the same type.
81 3) If queryInterface on a reference A returns reference B, queryInterface on
82 B for Type A must return interface reference A or calls made on the returned
83 reference must be equivalent to calls made on reference A.
85 4) If queryInterface on a reference A returns reference B, queryInterface on
86 A and B for XInterface must return the same interface reference (object identity).
88 <p> The reason for the strong specification is, that a Uno Runtime Environment (URE)
89 may choose to cache queryInterface() calls.
90 <p> As mentioned above, certain language bindings may map this function differently also
91 with different specifications, please visit the language dependent specification for it.
92 The current C++ binding sticks to the specification state
94 The rules mentioned above are basically identical to the rules of QueryInterface in MS COM.
96 @param aType a UNO interface type, for which an object reference shall be obtained.
97 @return an interface reference in case the requested interface is supported by the object,
100 any queryInterface
( [in] type aType
);
102 //-------------------------------------------------------------------------
103 /** increases the reference counter by one.
105 <p>When you have called acquire() on the
106 UNO object, it is often said, that you have a reference or a hard reference
110 It is only allowed to invoke a method on an UNO object, when you keep
111 a hard reference to it.
113 <p> Every call to acquire must be followed by a corresponding call to release
114 some time later, which may eventually lead to the destruction of the object.
116 [oneway
] void acquire
();
118 //-------------------------------------------------------------------------
120 // DocMerge from xml: method com::sun::star::uno::XInterface::release
121 /** decreases the reference counter by one.
122 <p>When the reference counter reaches 0, the object gets deleted.</p>
123 <p>Calling release() on the object is often called releasing
124 or clearing the reference to an object.
126 [oneway
] void release
();
130 //=============================================================================
134 /*=============================================================================
136 =============================================================================*/