merge the formfield patch from ooo-build
[ooovba.git] / toolkit / source / layout / core / flow.hxx
blob91aa8293dbbeed7f7fa760c11663ff11095dd39f
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 #ifndef LAYOUT_CORE_FLOW_HXX
33 #define LAYOUT_CORE_FLOW_HXX
35 #include <layout/core/container.hxx>
37 #include <list>
39 namespace layoutimpl
42 class Flow : public Container
44 protected:
45 // Box properties (i.e. affect all children)
46 sal_Int32 mnSpacing;
47 sal_Bool mbHomogeneous;
49 public:
50 // Children properties
51 struct ChildData
53 css::awt::Size aRequisition;
54 css::uno::Reference< css::awt::XLayoutConstrains > xChild;
55 css::uno::Reference< css::beans::XPropertySet > xProps;
56 bool isVisible();
59 protected:
60 std::list< ChildData * > maChildren;
61 long mnEachWidth; // on homogeneous, the width of every child
63 public:
64 Flow();
66 bool emptyVisible ();
68 // css::awt::XLayoutContainer
69 virtual void SAL_CALL addChild( const css::uno::Reference< css::awt::XLayoutConstrains >& Child )
70 throw (css::uno::RuntimeException, css::awt::MaxChildrenException);
71 virtual void SAL_CALL removeChild( const css::uno::Reference< css::awt::XLayoutConstrains >& Child )
72 throw (css::uno::RuntimeException);
74 virtual css::uno::Sequence< css::uno::Reference
75 < css::awt::XLayoutConstrains > > SAL_CALL getChildren()
76 throw (css::uno::RuntimeException);
78 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getChildProperties(
79 const css::uno::Reference< css::awt::XLayoutConstrains >& Child )
80 throw (css::uno::RuntimeException);
82 virtual void SAL_CALL allocateArea( const css::awt::Rectangle &rArea )
83 throw (css::uno::RuntimeException);
85 virtual css::awt::Size SAL_CALL getMinimumSize()
86 throw(css::uno::RuntimeException);
87 virtual sal_Bool SAL_CALL hasHeightForWidth()
88 throw(css::uno::RuntimeException);
89 virtual sal_Int32 SAL_CALL getHeightForWidth( sal_Int32 nWidth )
90 throw(css::uno::RuntimeException);
92 private:
93 // shared between getMinimumSize() and getHeightForWidth()
94 css::awt::Size calculateSize( long nMaxWidth );
97 } // namespace layoutimpl
99 #endif /* LAYOUT_FLOW_CORE_HXX */