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: XAggregation.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_XAggregation_idl__
31 #define __com_sun_star_uno_XAggregation_idl__
33 #ifndef __com_sun_star_uno_XInterface_idl__
34 #include
<com
/sun
/star
/uno
/XInterface.idl
>
37 //=============================================================================
39 module com
{ module sun
{ module star
{ module uno
{
41 //=============================================================================
42 /** Objects which implement this interface can become aggregates of
45 <p>That means if an object "A" aggregates "B", "A" can provide all
46 or some of the interfaces of "B". Whenever the method
47 <member>XInterface::queryInterface()</member>
48 is called on either of the objects, the call will be forwarded
49 to object "A". Object "A" now can determine whether to use the
50 interfaces of "A" or "B" or neither. Actually, any number of
51 aggregates can be used, even nested ones (aggregated objects which are
52 delegators by themselves).
54 <p>The following rules are to be observed:
56 <li>All calls to <member>XInterface::acquire()</member>
57 which are made before the delegator was set (using the method
58 <member>XAggregation::setDelegator()</member>) must not be taken back
59 (using the method <member>XInterface::release()</member>)
60 before the delegation is removed by calling
61 <code>xAggregation->setDelegator(NULL)</code>.
63 <li>The constructor of a delegator has to increment its
64 own reference count by calling its method
65 <member>XInterface::acquire()</member>
66 before it sets itself to any aggregate using the method
67 <member>XAggregation::setDelegator()</member>. After that
68 call it has to reset its own reference count without the
69 destructor getting called.
71 <li>The destructor of a delegator has to reset the delegator in
72 its aggregated objects by calling their method
73 <member>XAggregation::setDelegator()</member> with
74 <const>NULL</const> before it releases its reference to
75 its aggregated objects.
79 Aggregation will no longer be supported as a high-level concept of UNO.
80 You may still have the option to implement an UNO object consisting of
81 several single objects in your specific programming language, though this
82 depends on your programming language.
84 published
interface XAggregation
: com
::sun
::star
::uno
::XInterface
86 //-------------------------------------------------------------------------
87 /** sets the object to which all calls to the method
88 <member>XInterface::queryInterface()</member>
89 have to be forwarded. @
92 specifies the object which handles the calls to
93 <member>XInterface::queryInterface()</member>.
94 If <var>xDelegator</var> is <const>NULL</const>, the delegator is
95 removed and thus the object becomes its own delegator and has
96 to handle calls to the method
97 <member>XInterface::queryInterface()</member>
100 @see XAggregation::queryAggregation
102 void setDelegator
( [in] com
::sun
::star
::uno
::XInterface pDelegator
);
104 //-------------------------------------------------------------------------
105 /** is similar to <member>XInterface::queryInterface()</member>,
106 but it is to be processed directly without being forwarded to the
109 <p>This method is only called from within an implementation of
110 <member>XInterface::queryInterface()</member>
111 or <member>XAggregation::queryAggregation()</member>. This method
112 is to be called by the delegator if it does not implement the
113 interface itself. An object which got aggregated cannot depend
114 on getting its own interface when it calls the method
115 <member>XInterface::queryInterface()</member>.
117 @see XAggregation::setDelegator
119 any queryAggregation
( [in] type aType
);
123 //=============================================================================