1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef SD_TOOLPANEL_I_LAYOUTABLE_WINDOW_HXX
21 #define SD_TOOLPANEL_I_LAYOUTABLE_WINDOW_HXX
23 #include <tools/gen.hxx>
24 #include <sal/types.h>
28 namespace sd
{ namespace toolpanel
{
34 /** This method is called by layoutable controls when they have to be
37 virtual void RequestResize (void) = 0;
45 /** This interface has to be implemented by windows that want to be
46 layouted by a SubToolPanel or ScrollablePanel object.
48 class ILayoutableWindow
51 virtual ~ILayoutableWindow (void) {};
53 /** Return the preferred size without constraints on either the
55 The size the window will later be set to may but does not have
56 to be equal to this size.
58 virtual Size
GetPreferredSize (void) = 0;
60 /** Return the preferred width with the constraint, that the
61 window will be set to the given height.
62 The width the window will later be set to may but does not have
63 to be equal to this width.
65 virtual sal_Int32
GetPreferredWidth (sal_Int32 nHeight
) = 0;
67 /** Return the preferred height with the constraint, that the
68 window will be set to the given width.
69 The height the window will later be set to may but does not have
70 to be equal to this height.
72 virtual sal_Int32
GetPreferredHeight (sal_Int32 nWidth
) = 0;
74 /** Return whether the window is generally resizable. When used by
75 a VerticalLayouter then the width will always be resized and
76 the return value of this method determines whether the height
77 may be modified as well.
79 virtual bool IsResizable (void) = 0;
81 /** Return the window so that its size and position can be set.
83 Returns the window which is layouted or NULL to indicate
84 that the object is in an invalid state.
86 virtual ::Window
* GetWindow (void) = 0;
88 /** Return the minimal width of the window.
90 virtual sal_Int32
GetMinimumWidth (void) = 0;
95 } } // end of namespace ::sd::toolpanel
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */