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#ifndef __com_sun_star_awt_XLayoutContainer_idl__
23#define __com_sun_star_awt_XLayoutContainer_idl__
24
25#ifndef __com_sun_star_awt_XLayoutConstrains_idl__
26#include <com/sun/star/awt/XLayoutConstrains.idl>
27#endif
28#ifndef __com_sun_star_awt_Rectangle_idl__
29#include <com/sun/star/awt/Rectangle.idl>
30#endif
31#ifndef __com_sun_star_beans_XPropertySet_idl__
32#include <com/sun/star/beans/XPropertySet.idl>
33#endif
34#ifndef __com_sun_star_container_XChild_idl__
35#include <com/sun/star/container/XChild.idl>
36#endif
37#ifndef __com_sun_star_awt_MaxChildrenException_idl__
38#include <com/sun/star/awt/MaxChildrenException.idl>
39#endif
40#ifndef __com_sun_star_awt_XLayoutUnit_idl__
41#include <com/sun/star/awt/XLayoutUnit.idl>
42#endif
43
44//=============================================================================
45
46module com {  module sun {  module star {  module awt {
47
48//=============================================================================
49
50interface XLayoutUnit;
51
52/** specifies the layout constraints for a surrounding container.
53
54    @since OOo 3.0
55 */
56interface XLayoutContainer: com::sun::star::container::XChild
57{
58	/** Adds a child. Some containers provide an interface for
59	   adding children which you should use. */
60    void addChild( [in] com::sun::star::awt::XLayoutConstrains Child )
61		raises( com::sun::star::awt::MaxChildrenException );
62
63	/** Remove a child. Some containers provide an interface for
64	   adding children which you should use.
65    */
66    void removeChild( [in] com::sun::star::awt::XLayoutConstrains Child );
67
68    /** Returns a sequence of the children of this container. */
69    sequence< com::sun::star::awt::XLayoutConstrains > getChildren();
70
71	/** Read/modify some child layout properties. XPropertySet provides a
72	   rich API that allows, e.g., for introspection.
73	   Should rarely be a need to use; containers shall provide an interface
74	   for setting properties more confortably. */
75    com::sun::star::beans::XPropertySet getChildProperties(
76		[in] com::sun::star::awt::XLayoutConstrains Child );
77
78	/** Set at initilization, this object should be notified when a containers state
79	   changes, that may affect its size, to queue a layout re-calculation. */
80	void setLayoutUnit( [in] com::sun::star::awt::XLayoutUnit Unit );
81
82	// TEMP: no need for this...
83	com::sun::star::awt::XLayoutUnit getLayoutUnit();
84
85	/** To be used by the parent for the purpose of layout management.
86	   For widgets, use XWindow::setPosSize() */
87    void allocateArea( [in] com::sun::star::awt::Rectangle NewArea );
88
89	/** Used by the layouting unit to evaluate size damage, and force a
90	   re-allocation. */
91	com::sun::star::awt::Size getRequestedSize();
92
93	/** Used by the layouting unit to evaluate size damage, and force a
94	   re-allocation. */
95    com::sun::star::awt::Rectangle getAllocatedArea();
96
97	/** For flow layouting (e.g. wrap-able labels). TODO: We might want to
98	   re-design this approach -- check XLayoutConstrains::calcAdjustedSize(). */
99	long getHeightForWidth( [in] long Width );
100
101	/** For flow layouting (e.g. wrap-able labels). TODO: We might want to
102	   re-design this approach -- check XLayoutConstrains::calcAdjustedSize(). */
103	boolean hasHeightForWidth();
104};
105
106//=============================================================================
107
108}; }; }; };
109
110#endif
111