merge the formfield patch from ooo-build
[ooovba.git] / toolkit / source / layout / core / table.hxx
blobb41be259023c0af1683ddd9a4130f6b3fe95e3f9
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_TABLE_HXX
33 #define LAYOUT_CORE_TABLE_HXX
35 #include <layout/core/box-base.hxx>
37 namespace layoutimpl
40 class Table : public Box_Base
42 public:
43 // Children properties
44 struct ChildData : public Box_Base::ChildData
46 sal_Bool mbExpand[ 2 ];
47 sal_Int32 mnColSpan;
48 sal_Int32 mnRowSpan;
49 int mnLeftCol;
50 int mnRightCol;
51 int mnTopRow;
52 int mnBottomRow;
54 ChildData( css::uno::Reference< css::awt::XLayoutConstrains > const& xChild );
55 bool isVisible();
58 struct ChildProps : public Box_Base::ChildProps
60 ChildProps( ChildData *pData );
63 protected:
65 // a group of children; either a column or a row
66 struct GroupData
68 sal_Bool mbExpand;
69 int mnSize; // request size (width or height)
70 GroupData() : mbExpand( false ), mnSize( 0 ) {}
73 // Table properties
74 sal_Int32 mnColsLen;
75 std::vector< GroupData > maCols;
76 std::vector< GroupData > maRows;
77 int mnColExpandables, mnRowExpandables;
79 ChildData *createChild( css::uno::Reference< css::awt::XLayoutConstrains > const& xChild );
80 ChildProps *createChildProps( Box_Base::ChildData* pData );
82 public:
83 Table();
85 // css::awt::XLayoutContainer
86 virtual void SAL_CALL addChild( const css::uno::Reference< css::awt::XLayoutConstrains >& Child )
87 throw (css::uno::RuntimeException, css::awt::MaxChildrenException);
89 virtual void SAL_CALL allocateArea( const css::awt::Rectangle &rArea )
90 throw (css::uno::RuntimeException);
92 virtual css::awt::Size SAL_CALL getMinimumSize()
93 throw(css::uno::RuntimeException);
95 // unimplemented:
96 virtual sal_Bool SAL_CALL hasHeightForWidth()
97 throw(css::uno::RuntimeException)
98 { return false; }
99 virtual sal_Int32 SAL_CALL getHeightForWidth( sal_Int32 /*nWidth*/ )
100 throw(css::uno::RuntimeException)
101 { return maRequisition.Height; }
104 } // namespace layoutimpl
106 #endif /* LAYOUT_CORE_TABLE_HXX */