merge the formfield patch from ooo-build
[ooovba.git] / toolkit / source / layout / core / bin.hxx
blob0b75bc22049302f843d1a8da4f0683f9e064388a
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile$
11 * $Revision$
13 * This file is part of OpenOffice.org.
15 * OpenOffice.org is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU Lesser General Public License version 3
17 * only, as published by the Free Software Foundation.
19 * OpenOffice.org is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License version 3 for more details
23 * (a copy is included in the LICENSE file that accompanied this code).
25 * You should have received a copy of the GNU Lesser General Public License
26 * version 3 along with OpenOffice.org. If not, see
27 * <http://www.openoffice.org/license.html>
28 * for a copy of the LGPLv3 License.
30 ************************************************************************/
32 /* A few simple binary containers */
34 #ifndef LAYOUT_CORE_BIN_HXX
35 #define LAYOUT_CORE_BIN_HXX
37 #include <layout/core/container.hxx>
39 namespace layoutimpl
42 class Bin : public Container
44 protected:
45 // Child
46 css::awt::Size maChildRequisition;
47 css::uno::Reference< css::awt::XLayoutConstrains > mxChild;
49 public:
50 Bin();
51 virtual ~Bin() {}
53 // css::awt::XLayoutContainer
54 virtual void SAL_CALL addChild( const css::uno::Reference< css::awt::XLayoutConstrains >& Child )
55 throw (css::uno::RuntimeException, css::awt::MaxChildrenException);
56 virtual void SAL_CALL removeChild( const css::uno::Reference< css::awt::XLayoutConstrains >& Child )
57 throw (css::uno::RuntimeException);
59 virtual css::uno::Sequence< css::uno::Reference
60 < css::awt::XLayoutConstrains > > SAL_CALL getChildren()
61 throw (css::uno::RuntimeException);
63 virtual void SAL_CALL allocateArea( const css::awt::Rectangle &rArea )
64 throw (css::uno::RuntimeException);
66 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getChildProperties(
67 const css::uno::Reference< css::awt::XLayoutConstrains >& Child )
68 throw (css::uno::RuntimeException);
70 virtual sal_Bool SAL_CALL hasHeightForWidth()
71 throw(css::uno::RuntimeException);
72 virtual sal_Int32 SAL_CALL getHeightForWidth( sal_Int32 nWidth )
73 throw(css::uno::RuntimeException);
75 // css::awt::XLayoutConstrains
76 virtual css::awt::Size SAL_CALL getMinimumSize()
77 throw(css::uno::RuntimeException);
80 // Align gives control over child position on the allocated space.
81 class Align : public Bin
83 friend class AlignChildProps;
84 protected:
85 // properties
86 float fHorAlign, fVerAlign;
87 float fHorFill, fVerFill;
89 public:
90 Align();
92 bool emptyVisible ();
94 // css::awt::XLayoutContainer
95 virtual void SAL_CALL allocateArea( const css::awt::Rectangle &rArea )
96 throw (css::uno::RuntimeException);
99 // Makes child request its or a specified size, whatever is larger.
100 class MinSize : public Bin
102 protected:
103 // properties
104 long mnMinWidth, mnMinHeight;
106 public:
107 MinSize();
109 bool emptyVisible ();
110 // css::awt::XLayoutContainer
111 virtual css::awt::Size SAL_CALL getMinimumSize()
112 throw(css::uno::RuntimeException);
115 } // namespace layoutimpl
117 #endif /* LAYOUT_CORE_BIN_HXX */