1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
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>
40 class Table
: public Box_Base
43 // Children properties
44 struct ChildData
: public Box_Base::ChildData
46 sal_Bool mbExpand
[ 2 ];
54 ChildData( css::uno::Reference
< css::awt::XLayoutConstrains
> const& xChild
);
58 struct ChildProps
: public Box_Base::ChildProps
60 ChildProps( ChildData
*pData
);
65 // a group of children; either a column or a row
69 int mnSize
; // request size (width or height)
70 GroupData() : mbExpand( false ), mnSize( 0 ) {}
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
);
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
);
96 virtual sal_Bool SAL_CALL
hasHeightForWidth()
97 throw(css::uno::RuntimeException
)
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 */