xref: /trunk/main/udkapi/com/sun/star/beans/XPropertyWithState.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_XPropertyWithState_idl__
28#define __com_sun_star_beans_XPropertyWithState_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_PropertyState_idl__
35#include <com/sun/star/beans/PropertyState.idl>
36#endif
37
38#ifndef __com_sun_star_lang_WrappedTargetException_idl__
39#include <com/sun/star/lang/WrappedTargetException.idl>
40#endif
41
42//=============================================================================
43
44module com {  module sun {  module star {  module beans {
45
46//=============================================================================
47
48/** makes it possible to query information about the state of
49    this object, seen as a property contained in a property set.
50
51    <p> This interface provides direct access to operations
52        that are available if the containing property set
53        implements <type>XPropertyState</type>.
54    </p>
55
56    <p>The state contains the information if:</p>
57    <ul>
58        <li>a value is available or void</li>
59        <li>the value is stored in the object itself, or if a default value is being used</li>
60        <li>or if the value cannot be determined, due to ambiguity
61            (multi selection with multiple values).</li>
62    </ul>
63
64    <p> Generally objects that implement this interface
65        also implement <type>XProperty</type>.
66    </p>
67 */
68published interface XPropertyWithState: com::sun::star::uno::XInterface
69{
70    //-------------------------------------------------------------------------
71
72    /** @returns
73                the state of this as a property.
74     */
75    com::sun::star::beans::PropertyState getStateAsProperty( );
76
77    //-------------------------------------------------------------------------
78
79    /** sets this to its default value.
80
81        <p> The value depends on the implementation of this interface.
82            If this is a bound property, the value changes before
83            the change events are fired.  If this is a constrained property,
84            the vetoable event is fired before the property value changes.
85        </p>
86
87            @throws  com::sun::star::lang::WrappedTargetException
88                if the implementation has an internal reason for the exception.
89                In this case the original exception is wrapped into that
90                <type scope="com::sun::star::lang">WrappedTargetException</type>.
91     */
92    void setToDefaultAsProperty( )
93            raises( com::sun::star::lang::WrappedTargetException );
94
95    //-------------------------------------------------------------------------
96
97    /**     @returns
98                an object representing the default state of this object (as a property).
99
100            <p> If no default exists, is not known or is void,
101                then the return value is <NULL/>.
102            </p>
103
104            @throws  com::sun::star::lang::WrappedTargetException
105                if the implementation has an internal reason for the exception.
106                In this case the original exception is wrapped into that
107                <type scope="com::sun::star::lang">WrappedTargetException</type>.
108     */
109    com::sun::star::uno::XInterface getDefaultAsProperty( )
110            raises( com::sun::star::lang::WrappedTargetException );
111};
112
113//=============================================================================
114
115}; }; }; };
116
117#endif
118