1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 #ifndef __com_sun_star_uno_XWeak_idl__
28 #define __com_sun_star_uno_XWeak_idl__
30 #ifndef __com_sun_star_uno_XInterface_idl__
31 #include
<com
/sun
/star
/uno
/XInterface.idl
>
34 #ifndef __com_sun_star_uno_XAdapter_idl__
35 #include
<com
/sun
/star
/uno
/XAdapter.idl
>
39 //=============================================================================
41 module com
{ module sun
{ module star
{ module uno
{
43 //=============================================================================
45 // DocMerge from xml: interface com::sun::star::uno::XWeak
46 /** the server-side interface to a weak object.
50 <p>This interface is proxy to the adapted object.
51 In order to make it possible to have weak references to objects,
52 the <type>XAdapter</type> interface must be implemented to provide
53 a weak adapter for the clients.
55 <h4>Concept of weak referencing:</h4>
58 <p>This module specifies the interfaces for implementing and using
63 <p>The sense of weak references is to hold a reference to an object
64 without affecting the lifetime of the object. That means that a weak
65 reference may become invalid, at any time, if the referenced object dies.
68 <p>The following interfaces describe one way to handle weak references
69 by providing a weak adapter. The weak object has to provide this
70 adapter if anyone wants to hold a weak reference. To separate their
71 lifetimes, the adapter and the original object must not share the same
72 reference counter. The weak reference is in fact only a hard reference
73 to the adapter, which knows - but does not hold - the original object.
74 That means that the implementation and synchronization of weak
75 referencing is the responsibility of the object. The following
76 interfaces are involved in the concept of weak referencing:
82 <dd>is the server-side interface of the referred object. This
83 referred object must support the <type>XAdapter</type> interface.
87 <type>XReference</type>
89 <dd>is a client-side interface which must be implemented by
90 the holder of any weak reference. It is used for notification
91 when the adapted object dies.
97 published
interface XWeak
: com
::sun
::star
::uno
::XInterface
99 //-------------------------------------------------------------------------
101 // DocMerge from xml: method com::sun::star::uno::XWeak::queryAdapter
102 /** queries the weak adapter.
106 <p>It is important that the adapter must know, but not hold
107 the adapted object. If the adapted object dies, all references
108 to the adapter have to be notified to release the adapter.
112 com
::sun
::star
::uno
::XAdapter queryAdapter
();
116 //=============================================================================
120 /*=============================================================================
122 =============================================================================*/