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 .
21 module com
{ module sun
{ module star
{ module uno
{
23 /** Objects which implement this interface can become aggregates of
26 <p>That means if an object "A" aggregates "B", "A" can provide all
27 or some of the interfaces of "B". Whenever the method
28 XInterface::queryInterface()
29 is called on either of the objects, the call will be forwarded
30 to object "A". Object "A" now can determine whether to use the
31 interfaces of "A" or "B" or neither. Actually, any number of
32 aggregates can be used, even nested ones (aggregated objects which are
33 delegators by themselves).
35 <p>The following rules are to be observed:
37 <li>All calls to XInterface::acquire()
38 which are made before the delegator was set (using the method
39 XAggregation::setDelegator()) must not be taken back
40 (using the method XInterface::release())
41 before the delegation is removed by calling
42 <code>xAggregation->setDelegator(NULL)</code>.
44 <li>The constructor of a delegator has to increment its
45 own reference count by calling its method
47 before it sets itself to any aggregate using the method
48 XAggregation::setDelegator(). After that
49 call it has to reset its own reference count without the
50 destructor getting called.
52 <li>The destructor of a delegator has to reset the delegator in
53 its aggregated objects by calling their method
54 XAggregation::setDelegator() with
55 NULL before it releases its reference to
56 its aggregated objects.
60 Aggregation will no longer be supported as a high-level concept of UNO.
61 You may still have the option to implement a UNO object consisting of
62 several single objects in your specific programming language, though this
63 depends on your programming language.
65 published
interface XAggregation
: com
::sun
::star
::uno
::XInterface
67 /** sets the object to which all calls to the method
68 XInterface::queryInterface()
72 specifies the object which handles the calls to
73 XInterface::queryInterface().
74 If <var>pDelegator</var> is NULL, the delegator is
75 removed and thus the object becomes its own delegator and has
76 to handle calls to the method
77 XInterface::queryInterface()
80 @see XAggregation::queryAggregation
82 void setDelegator
( [in] com
::sun
::star
::uno
::XInterface pDelegator
);
84 /** is similar to XInterface::queryInterface(),
85 but it is to be processed directly without being forwarded to the
88 <p>This method is only called from within an implementation of
89 XInterface::queryInterface()
90 or XAggregation::queryAggregation(). This method
91 is to be called by the delegator if it does not implement the
92 interface itself. An object which got aggregated cannot depend
93 on getting its own interface when it calls the method
94 XInterface::queryInterface().
96 @see XAggregation::setDelegator
98 any queryAggregation
( [in] type aType
);
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */