1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24#ifndef __com_sun_star_inspection_XPropertyControl_idl__
25#define __com_sun_star_inspection_XPropertyControl_idl__
26
27#ifndef __com_sun_star_beans_IllegalTypeException_idl__
28#include <com/sun/star/beans/IllegalTypeException.idl>
29#endif
30#ifndef __com_sun_star_awt_XWindow_idl__
31#include <com/sun/star/awt/XWindow.idl>
32#endif
33
34//=============================================================================
35module com {  module sun {  module star {  module inspection {
36
37published interface XPropertyControlContext;
38
39//-----------------------------------------------------------------------------
40/** defines the interface for a single control in an <type>ObjectInspector</type>
41
42    @since OpenOffice 2.0.3
43*/
44published interface XPropertyControl
45{
46    /** denotes the type of the control, as one of the <type>PropertyControlType</type>
47        constants
48    */
49    [attribute, readonly] short ControlType;
50
51    /** denotes the current content of the control.
52
53        <p>At every point in time, this value is either <void/>, or of the type
54        described by <member>ValueType</member>.</p>
55
56        @throws com::sun::star::beans::IllegalTypeException
57            if an attempt is made to set a value which is not <void/> and whose
58            type does not equal <member>ValueType</member>.
59    */
60    [attribute] any Value
61    {
62        set raises ( com::sun::star::beans::IllegalTypeException );
63    };
64
65    /** denotes the value type of the control.
66
67        @see Value
68    */
69    [attribute, readonly] type ValueType;
70
71    /** specifies the context of the control within the <type>ObjectInspector</type>.
72
73        <p>The property control should actively notify its state changes to the context.
74        In particular, changes in the focus and the value of the control must be notified.
75    */
76    [attribute] XPropertyControlContext ControlContext;
77
78    /** determines whether the control content is currently modified
79
80        <p>An <type>XPropertyControl</type> internally manages a flag indicating whether
81        its content is modified. This flag is reset to <FALSE/> every time our
82        <member>ControlContext</member> is notified of our current value. Also, the control
83        implementation must set this flag to <TRUE/> if and only if the user changed the
84        control content.</p>
85
86        @see notifyModifiedValue
87        @see ControlContext
88        @see XPropertyControlContext::valueChanged
89    */
90    boolean isModified();
91
92    /** notifies the context in which the control lives of the current control value,
93        if this value is currently modified
94
95        @see isModified
96        @see ControlContext
97        @see XPropertyControlListener::valueChanged
98    */
99    void notifyModifiedValue();
100
101    /** denotes the window which is the real UI representation of the property control.
102
103        <p>The <type>ObjectInspector</type> will automatically position and size this control
104        as needed, care for its Z-order, and so on.</p>
105
106        <p>This Window must not be <NULL/>, else the whole control is not usable.</p>
107    */
108    [attribute, readonly] com::sun::star::awt::XWindow ControlWindow;
109};
110
111//=============================================================================
112
113}; }; }; };
114
115#endif
116
117