xref: /trunk/main/udkapi/com/sun/star/beans/XIntrospectionAccess.idl (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
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.
14 *
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).
20 *
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.
25 *
26 ************************************************************************/
27#ifndef __com_sun_star_beans_XIntrospectionAccess_idl__
28#define __com_sun_star_beans_XIntrospectionAccess_idl__
29
30#ifndef __com_sun_star_uno_XInterface_idl__
31#include <com/sun/star/uno/XInterface.idl>
32#endif
33
34#ifndef __com_sun_star_beans_Property_idl__
35#include <com/sun/star/beans/Property.idl>
36#endif
37
38#ifndef __com_sun_star_container_NoSuchElementException_idl__
39#include <com/sun/star/container/NoSuchElementException.idl>
40#endif
41
42#ifndef __com_sun_star_reflection_XIdlMethod_idl__
43#include <com/sun/star/reflection/XIdlMethod.idl>
44#endif
45
46#ifndef __com_sun_star_lang_NoSuchMethodException_idl__
47#include <com/sun/star/lang/NoSuchMethodException.idl>
48#endif
49
50#ifndef __com_sun_star_reflection_XIdlClass_idl__
51#include <com/sun/star/reflection/XIdlClass.idl>
52#endif
53
54#ifndef __com_sun_star_beans_IllegalTypeException_idl__
55#include <com/sun/star/beans/IllegalTypeException.idl>
56#endif
57
58//=============================================================================
59
60 module com {  module sun {  module star {  module beans {
61
62//=============================================================================
63
64/** represents the result of an introspection operation done by
65    the inspect method of <type scope="com::sun::star::beans">
66    XIntrospection</type>.
67
68    <p>This interface gives information about an object's
69    properties and methods as detected in the introspection
70    process. It's not possible to access properties or call
71    methods directly using this interface but it provides
72    access to other interfaces to do so.
73    See <member scope="com::sun::star::beans">
74    XIntrospectionAccess::queryAdapter()</member></p>
75
76    <p>The <type>XExactName</type> interface has to be supported
77    in order to implement inaccurate name access for all objects
78    which implement the <type scope="com::sun::star::container">
79    XNameAccess</type> interface or <type>XPropertySet</type>.</p>
80
81    <p>The <type>XMaterialHolder</type> interface has to be
82    supported to give access to the inspected object.</p>
83
84        @see XPropertySet
85        @see com::sun::star::beans::XExactName
86 */
87published interface XIntrospectionAccess: com::sun::star::uno::XInterface
88{
89    //-------------------------------------------------------------------------
90    /** returns information about which method concepts described in
91        the <type>MethodConcept</type> constants group are supported
92        by this <type>XIntrospectionAccess</type> implementation.
93
94        <p>The minimum supported concepts should be:</p>
95
96        <ul>
97            <li> <const>MethodConcept::PROPERTY</const>, </li>
98            <li> <const>MethodConcept::LISTENER</const>, </li>
99            <li> <const>MethodConcept::ENUMERATION</const>, </li>
100            <li> <const>MethodConcept::NAMECONTAINER</const></li>
101            <li> <const>MethodConcept::INDEXCONTAINER</const>; </li>
102        </ul>
103
104        @returns
105            zero or more constants of the <type>MethodConcept</type>
106            constants group combined by an arithmetical or-operation.
107     */
108    long getSuppliedMethodConcepts();
109
110    //-------------------------------------------------------------------------
111    /** returns information about which property concepts described in
112        the <type>PropertyConcept</type> constants group are supported
113        by this <type>XIntrospectionAccess</type> implementation.
114
115        <p>The minimum supported concepts should be:</p>
116
117        <ul>
118            <li> <const>PropertyConcept::PROPERTYSET</const>, </li>
119            <li> <const>PropertyConcept::ATTRIBUTES</const> and </li>
120            <li> <const>PropertyConcept::METHODS</const>.  </li>
121        </ul>
122
123        @returns
124            zero or more constants of the <type>PropertyConcept</type>
125            constants group.combined by an arithmetical or-operation.
126     */
127    long getSuppliedPropertyConcepts();
128
129    //-------------------------------------------------------------------------
130    /** returns information about a property if a property with
131        the demanded name exists and if it accords to one of the
132        demanded <type>PropertyConcept</type>s. The information
133        is provided as <type>Property</type> struct.
134
135        @returns
136            A <type>Property</type> struct providing
137            information about the demanded property,
138            if a corresponding property exists.
139
140        @param aName
141            the name of the property.
142
143        @param nPropertyConcepts
144            zero or more constants of the <type>PropertyConcept
145            </type> constants group combined by an arithmetical
146            or-operation.
147
148        @throws NoSuchElementException
149            when a property with the demanded name doesn't exist
150            or if it accords to a wrong <type>PropertyConcept
151            </type>.
152     */
153    com::sun::star::beans::Property getProperty( [in] string aName,
154             [in] long nPropertyConcepts )
155            raises( com::sun::star::container::NoSuchElementException );
156
157    //-------------------------------------------------------------------------
158    /** allows to ask if a property with the demanded name exists
159        and if it accords to one of the demanded <type>
160        PropertyConcept</type>s.
161
162        @returns
163            <TRUE/> if the property exists and accords to one of
164            the demanded <type>PropertyConcept</type>s, otherwise
165            <FALSE/> is returned.
166
167        @param aName
168            the name of the property.
169
170        @param nPropertyConcepts
171            zero or more constants of the <type>PropertyConcept
172            </type> constants group combined by an arithmetical
173            or-operation.
174     */
175    boolean hasProperty( [in] string aName,
176             [in] long nPropertyConcepts );
177
178    //-------------------------------------------------------------------------
179    /** returns a sequence of properties of the introspected object
180
181        @returns
182            all properties of the introspected object which accord
183            to the demanded <type>PropertyConcept</type>s.
184
185        @param nPropertyConcepts
186            zero or more constants of the <type>PropertyConcept
187            </type> constants group combined by an arithmetical
188            or-operation.
189     */
190    sequence<com::sun::star::beans::Property> getProperties(
191                [in] long nPropertyConcepts );
192
193    //-------------------------------------------------------------------------
194    /** returns information about a method if a method with
195        the demanded name exists and if it accords to one of
196        the demanded MethodConcepts. The information is
197        provided as <type scope="com::sun::star::reflection">
198        XIdlMethod</type>.
199
200        @returns
201            A <type scope="com::sun::star::reflection">
202            XIdlMethod</type> providing information about and
203            access to the demanded method if a corresponding
204            method exists.
205
206        @param aName
207            the name of the method.
208
209        @param nMethodConcepts
210            zero or more constants of the <type>MethodConcept
211            </type> constants group combined by an arithmetical
212            or-operation.
213
214        @throws NoSuchElementException
215            when a method with the demanded name doesn't exist
216            or if it accords to a wrong <type>MethodConcept</type>.
217     */
218    com::sun::star::reflection::XIdlMethod getMethod( [in] string aName,
219             [in] long nMethodConcepts )
220            raises( com::sun::star::lang::NoSuchMethodException );
221
222    //-------------------------------------------------------------------------
223    /** allows to ask if a method with the demanded name exists
224        and if it accords to one of the demanded <type>MethodConcept
225        </type>s.
226
227        @returns
228            <TRUE/> if the method exists and accords to one of
229            the demanded <type>MethodConcept</type>s, otherwise
230            <FALSE/> is returned.
231
232        @param aName
233            the name of the method.
234
235        @param nMethodConcepts
236            zero or more constants of the <type>MethodConcept
237            </type> constants group combined by an arithmetical
238            or-operation.
239     */
240    boolean hasMethod( [in] string aName,
241             [in] long nMethodConcepts );
242
243    //-------------------------------------------------------------------------
244    /** returns a sequence of methods of the introspected object.
245
246        @returns
247            all methods of the introspected object which accord
248            to the demanded <type>MethodConcept</type>s.
249
250        @param nMethodConcepts
251            zero or more constants of the <type>MethodConcept
252            </type> constants group combined by an arithmetical
253            or-operation.
254     */
255    sequence<com::sun::star::reflection::XIdlMethod> getMethods(
256            [in] long nMethodConcepts );
257
258    //-------------------------------------------------------------------------
259    /** returns the listener types supported by the introspected
260        object.
261
262        <p>If the introspected object has the methods
263        <code>addFooListener( XFooListener xFoo )</code> and
264        <code>removeFooListener( XFooListener xFoo )</code>
265        the type of XFooListener will be one of the elements
266        in the returned sequence.
267
268        @returns
269            a sequence of the types of listener interfaces
270            which are supported by the introspected object.
271     */
272    sequence<type> getSupportedListeners();
273
274    //-------------------------------------------------------------------------
275    /** creates an adapter that implements an interface with the
276        specified type.
277
278        <p>To access properties, query for the <type>XPropertySet
279        </type> interface. If the <type>XPropertySet</type> can
280        be queried, the <type>XFastPropertySet</type> interface
281        must be supported too.  </p>
282
283        <p>If the introspected object implements a name container,
284        the introspection should return the <type scope=
285        "com::sun::star::container">XNameAccess</type> and <type
286        scope="com::sun::star::container">XNameContainer</type>
287        interfaces.</p>
288
289        <p>If the introspected object implements an index container,
290        the introspection should return the <type scope=
291        "com::sun::star::container">XIndexAccess</type> and <type
292        scope="com::sun::star::container">XIndexContainer</type>
293        interfaces.</p>
294
295        <p>If the introspected object implements an enumeration
296        container, the introspection should return the <type scope=
297        "com::sun::star::container">XEnumerationAccess</type>
298        interface.</p>
299
300        <p>If the introspected object implements the <type scope=
301        "com::sun::star::reflection">XIdlArray</type> interface,
302        the introspection should return this.</p>
303
304        <p>To implement inaccurate name access, at all objects,
305        which implement the <type scope="com::sun::star::container">
306        XNameAccess</type> or <type>XPropertySet</type> interface,
307        the <type>XExactName</type> interface has to be supported.
308        </p>
309
310        @see com::sun::star::beans::XExactName
311     */
312    com::sun::star::uno::XInterface queryAdapter( [in] type aInterfaceType )
313            raises( com::sun::star::beans::IllegalTypeException );
314
315};
316
317//=============================================================================
318
319}; }; }; };
320
321#endif
322