1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef __com_sun_star_uno_XAggregation_idl__
20 #define __com_sun_star_uno_XAggregation_idl__
22 #include
<com
/sun
/star
/uno
/XInterface.idl
>
25 module com
{ module sun
{ module star
{ module uno
{
27 /** Objects which implement this interface can become aggregates of
30 <p>That means if an object "A" aggregates "B", "A" can provide all
31 or some of the interfaces of "B". Whenever the method
32 XInterface::queryInterface()
33 is called on either of the objects, the call will be forwarded
34 to object "A". Object "A" now can determine whether to use the
35 interfaces of "A" or "B" or neither. Actually, any number of
36 aggregates can be used, even nested ones (aggregated objects which are
37 delegators by themselves).
39 <p>The following rules are to be observed:
41 <li>All calls to XInterface::acquire()
42 which are made before the delegator was set (using the method
43 XAggregation::setDelegator()) must not be taken back
44 (using the method XInterface::release())
45 before the delegation is removed by calling
46 <code>xAggregation->setDelegator(NULL)</code>.
48 <li>The constructor of a delegator has to increment its
49 own reference count by calling its method
51 before it sets itself to any aggregate using the method
52 XAggregation::setDelegator(). After that
53 call it has to reset its own reference count without the
54 destructor getting called.
56 <li>The destructor of a delegator has to reset the delegator in
57 its aggregated objects by calling their method
58 XAggregation::setDelegator() with
59 NULL before it releases its reference to
60 its aggregated objects.
64 Aggregation will no longer be supported as a high-level concept of UNO.
65 You may still have the option to implement an UNO object consisting of
66 several single objects in your specific programming language, though this
67 depends on your programming language.
69 published
interface XAggregation
: com
::sun
::star
::uno
::XInterface
71 /** sets the object to which all calls to the method
72 XInterface::queryInterface()
76 specifies the object which handles the calls to
77 XInterface::queryInterface().
78 If <var>pDelegator</var> is NULL, the delegator is
79 removed and thus the object becomes its own delegator and has
80 to handle calls to the method
81 XInterface::queryInterface()
84 @see XAggregation::queryAggregation
86 void setDelegator
( [in] com
::sun
::star
::uno
::XInterface pDelegator
);
88 /** is similar to XInterface::queryInterface(),
89 but it is to be processed directly without being forwarded to the
92 <p>This method is only called from within an implementation of
93 XInterface::queryInterface()
94 or XAggregation::queryAggregation(). This method
95 is to be called by the delegator if it does not implement the
96 interface itself. An object which got aggregated cannot depend
97 on getting its own interface when it calls the method
98 XInterface::queryInterface().
100 @see XAggregation::setDelegator
102 any queryAggregation
( [in] type aType
);
111 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */