tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / udkapi / com / sun / star / lang / XComponent.idl
blob1e27eba0688b89ae6bbdcfc93d99bd790350326c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 lang {
23 published interface XEventListener;
25 /** allows to explicitly free resources and break cyclic references.
27 <p>Actually the real lifetime of a UNO object is controlled by
28 references kept on interfaces of this object. But there are two
29 distinct meanings in keeping a reference to an interface:
30 1st to own the object and 2nd to know the object.
32 <p>You are only allowed to keep references of interfaces
33 to UNO objects if you are by definition the owner of that object or
34 your reference is very temporary or you have registered an
35 EventListener at that object and release the reference when
36 "disposing" is called.</p>
38 published interface XComponent: com::sun::star::uno::XInterface
40 /** The owner of an object calls this method to explicitly free all
41 resources kept by this object and thus break cyclic references.
43 <p>Only the owner of this object is allowed to call this method.
44 The object should release all resources and references in the
45 easiest possible manner ( for instance no serialization should
46 take place anymore ).
47 </p>
48 <p>
49 The object must notify all registered listeners using the method
50 XEventListener::disposing(). All notified objects
51 should release their references to this object without
52 calling XComponent::removeEventListener()
53 (the disposed object will release the listeners eitherway).
54 </p>
56 <p>After this method has been called, the object should behave as passive
57 as possible, thus it should ignore all calls
58 in case it can comply with its specification (for instance addEventListener()).
59 Often the object can't fulfill its specification anymore,
60 in this case it must throw the DisposedException
61 (which is derived from com::sun::star::uno::RuntimeException)
62 when it gets called.</p>
64 <p>For some objects no real owner can be identified, thus it can be
65 disposed from multiple reference holders. In this case
66 the object should be able to cope with multiple dispose()-calls (which
67 are inevitable in a multithreaded environment).
69 void dispose();
71 /** adds an event listener to the object.
73 <p>The broadcaster fires the disposing method of this listener
74 if the XComponent::dispose() method is called.</p>
76 <p>It is suggested to allow multiple registration of the same listener,
77 thus for each time a listener is added, it has to be removed.</p>
79 <p>If this XComponent is already disposed when
80 XComponent::addEventListener() is called, the call will not fail
81 with a DisposedException, but the caller will be notified via the
82 XEventListener::disposing()
83 callback. This callback can occur synchronously within the
84 addEventListener() call.</p>
86 @see XComponent::removeEventListener
88 void addEventListener( [in] XEventListener xListener );
90 /** removes an event listener from the listener list.
92 <p>It is a "noop" if the specified listener is not registered.</p>
94 <p>It is suggested to allow multiple registration of the same listener,
95 thus for each time a listener is added, it has to be removed.
97 <p>If this XComponent is already disposed when
98 XComponent::removeEventListener() is called, the call will not
99 fail with a DisposedException,
100 but will rather be ignored silently.</p>
102 @see XComponent::addEventListener
104 void removeEventListener( [in] XEventListener aListener );
109 }; }; }; };
111 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */