xref: /trunk/main/offapi/com/sun/star/awt/XLayoutContainer.idl (revision ffd38472365e95f6a578737bc9a5eb0fac624a86)
1d1766043SAndrew Rist/**************************************************************
2d1766043SAndrew Rist *
3d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5d1766043SAndrew Rist * distributed with this work for additional information
6d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10d1766043SAndrew Rist *
11d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12d1766043SAndrew Rist *
13d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14d1766043SAndrew Rist * software distributed under the License is distributed on an
15d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17d1766043SAndrew Rist * specific language governing permissions and limitations
18d1766043SAndrew Rist * under the License.
19d1766043SAndrew Rist *
20d1766043SAndrew Rist *************************************************************/
21d1766043SAndrew Rist
22cdf0e10cSrcweir#ifndef __com_sun_star_awt_XLayoutContainer_idl__
23cdf0e10cSrcweir#define __com_sun_star_awt_XLayoutContainer_idl__
24cdf0e10cSrcweir
25cdf0e10cSrcweir#ifndef __com_sun_star_awt_XLayoutConstrains_idl__
26cdf0e10cSrcweir#include <com/sun/star/awt/XLayoutConstrains.idl>
27cdf0e10cSrcweir#endif
28cdf0e10cSrcweir#ifndef __com_sun_star_awt_Rectangle_idl__
29cdf0e10cSrcweir#include <com/sun/star/awt/Rectangle.idl>
30cdf0e10cSrcweir#endif
31cdf0e10cSrcweir#ifndef __com_sun_star_beans_XPropertySet_idl__
32cdf0e10cSrcweir#include <com/sun/star/beans/XPropertySet.idl>
33cdf0e10cSrcweir#endif
34cdf0e10cSrcweir#ifndef __com_sun_star_container_XChild_idl__
35cdf0e10cSrcweir#include <com/sun/star/container/XChild.idl>
36cdf0e10cSrcweir#endif
37cdf0e10cSrcweir#ifndef __com_sun_star_awt_MaxChildrenException_idl__
38cdf0e10cSrcweir#include <com/sun/star/awt/MaxChildrenException.idl>
39cdf0e10cSrcweir#endif
40cdf0e10cSrcweir#ifndef __com_sun_star_awt_XLayoutUnit_idl__
41cdf0e10cSrcweir#include <com/sun/star/awt/XLayoutUnit.idl>
42cdf0e10cSrcweir#endif
43cdf0e10cSrcweir
44cdf0e10cSrcweir//=============================================================================
45cdf0e10cSrcweir
46cdf0e10cSrcweirmodule com {  module sun {  module star {  module awt {
47cdf0e10cSrcweir
48cdf0e10cSrcweir//=============================================================================
49cdf0e10cSrcweir
50cdf0e10cSrcweirinterface XLayoutUnit;
51cdf0e10cSrcweir
52cdf0e10cSrcweir/** specifies the layout constraints for a surrounding container.
53cdf0e10cSrcweir
54*d1e7efc3SJürgen Schmidt    @since OpenOffice 3.0
55cdf0e10cSrcweir */
56cdf0e10cSrcweirinterface XLayoutContainer: com::sun::star::container::XChild
57cdf0e10cSrcweir{
58cdf0e10cSrcweir    /** Adds a child. Some containers provide an interface for
59cdf0e10cSrcweir       adding children which you should use. */
60cdf0e10cSrcweir    void addChild( [in] com::sun::star::awt::XLayoutConstrains Child )
61cdf0e10cSrcweir        raises( com::sun::star::awt::MaxChildrenException );
62cdf0e10cSrcweir
63cdf0e10cSrcweir    /** Remove a child. Some containers provide an interface for
64cdf0e10cSrcweir       adding children which you should use.
65cdf0e10cSrcweir    */
66cdf0e10cSrcweir    void removeChild( [in] com::sun::star::awt::XLayoutConstrains Child );
67cdf0e10cSrcweir
68cdf0e10cSrcweir    /** Returns a sequence of the children of this container. */
69cdf0e10cSrcweir    sequence< com::sun::star::awt::XLayoutConstrains > getChildren();
70cdf0e10cSrcweir
71cdf0e10cSrcweir    /** Read/modify some child layout properties. XPropertySet provides a
72cdf0e10cSrcweir       rich API that allows, e.g., for introspection.
73cdf0e10cSrcweir       Should rarely be a need to use; containers shall provide an interface
74cdf0e10cSrcweir       for setting properties more confortably. */
75cdf0e10cSrcweir    com::sun::star::beans::XPropertySet getChildProperties(
76cdf0e10cSrcweir        [in] com::sun::star::awt::XLayoutConstrains Child );
77cdf0e10cSrcweir
78cdf0e10cSrcweir    /** Set at initilization, this object should be notified when a containers state
79cdf0e10cSrcweir       changes, that may affect its size, to queue a layout re-calculation. */
80cdf0e10cSrcweir    void setLayoutUnit( [in] com::sun::star::awt::XLayoutUnit Unit );
81cdf0e10cSrcweir
82cdf0e10cSrcweir    // TEMP: no need for this...
83cdf0e10cSrcweir    com::sun::star::awt::XLayoutUnit getLayoutUnit();
84cdf0e10cSrcweir
85cdf0e10cSrcweir    /** To be used by the parent for the purpose of layout management.
86cdf0e10cSrcweir       For widgets, use XWindow::setPosSize() */
87cdf0e10cSrcweir    void allocateArea( [in] com::sun::star::awt::Rectangle NewArea );
88cdf0e10cSrcweir
89cdf0e10cSrcweir    /** Used by the layouting unit to evaluate size damage, and force a
90cdf0e10cSrcweir       re-allocation. */
91cdf0e10cSrcweir    com::sun::star::awt::Size getRequestedSize();
92cdf0e10cSrcweir
93cdf0e10cSrcweir    /** Used by the layouting unit to evaluate size damage, and force a
94cdf0e10cSrcweir       re-allocation. */
95cdf0e10cSrcweir    com::sun::star::awt::Rectangle getAllocatedArea();
96cdf0e10cSrcweir
97cdf0e10cSrcweir    /** For flow layouting (e.g. wrap-able labels). TODO: We might want to
98cdf0e10cSrcweir       re-design this approach -- check XLayoutConstrains::calcAdjustedSize(). */
99cdf0e10cSrcweir    long getHeightForWidth( [in] long Width );
100cdf0e10cSrcweir
101cdf0e10cSrcweir    /** For flow layouting (e.g. wrap-able labels). TODO: We might want to
102cdf0e10cSrcweir       re-design this approach -- check XLayoutConstrains::calcAdjustedSize(). */
103cdf0e10cSrcweir    boolean hasHeightForWidth();
104cdf0e10cSrcweir};
105cdf0e10cSrcweir
106cdf0e10cSrcweir//=============================================================================
107cdf0e10cSrcweir
108cdf0e10cSrcweir}; }; }; };
109cdf0e10cSrcweir
110cdf0e10cSrcweir#endif
111