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
9 * $RCSfile: ILayoutableWindow.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SD_TOOLPANEL_I_LAYOUTABLE_WINDOW_HXX
32 #define SD_TOOLPANEL_I_LAYOUTABLE_WINDOW_HXX
34 #include <tools/gen.hxx>
35 #include <sal/types.h>
39 namespace sd
{ namespace toolpanel
{
45 /** This method is called by layoutable controls when they have to be
48 virtual void RequestResize (void) = 0;
53 /** This interface has to be implemented by windows that want to be
54 layouted by a ToolPanel, SubToolPanel, or ScrollablePanel object.
56 class ILayoutableWindow
59 virtual ~ILayoutableWindow (void) {};
61 /** Return the preferred size without constraints on either the
63 The size the window will later be set to may but does not have
64 to be equal to this size.
66 virtual Size
GetPreferredSize (void) = 0;
68 /** Return the preferred width with the constraint, that the
69 window will be set to the given height.
70 The width the window will later be set to may but does not have
71 to be equal to this width.
73 virtual sal_Int32
GetPreferredWidth (sal_Int32 nHeight
) = 0;
75 /** Return the preferred height with the constraint, that the
76 window will be set to the given width.
77 The height the window will later be set to may but does not have
78 to be equal to this height.
80 virtual sal_Int32
GetPreferredHeight (sal_Int32 nWidth
) = 0;
82 /** Return wether the window is generally resizable. When used by
83 a VerticalLayouter then the width will always be resized and
84 the return value of this method determines whether the height
85 may be modified as well.
87 virtual bool IsResizable (void) = 0;
89 /** Return the window so that its size and position can be set.
91 Returns the window which is layouted or NULL to indicate
92 that the object is in an invalid state.
94 virtual ::Window
* GetWindow (void) = 0;
96 /** Return the minimal width of the window.
98 virtual sal_Int32
GetMinimumWidth (void) = 0;
103 } } // end of namespace ::sd::toolpanel