2 * Copyright (C) 2003 by Unai Garro <ugarro@users.sourceforge.net>
3 * Copyright (C) 2004 by Enrico Ros <rosenric@dei.unipd.it>
4 * Copyright (C) 2004 by Stephan Kulow <coolo@kde.org>
5 * Copyright (C) 2004 by Oswald Buddenhagen <ossi@kde.org>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
36 // virtual ~KdmLayout() {};
38 // Adds an item that will be managed
39 void addItem( KdmItem
*item
) { m_children
.append( item
); }
41 // Return false if any item are managed by this layouter
42 bool isEmpty() { return m_children
.isEmpty(); }
44 // Updates the layout of all items knowing that the parent
45 // has the @p parentGeometry geometry
46 // virtual void update( QStack<QRect> &parentGeometries ) = 0;
49 QList
<KdmItem
*> m_children
;
52 class KdmLayoutFixed
: public KdmLayout
{
55 KdmLayoutFixed( const QDomNode
&node
);
57 // Updates the layout of all boxed items knowing that the parent
58 // has the @p parentGeometry geometry
59 void update( QStack
<QSize
> &parentSizes
, const QRect
&parentGeometry
, bool force
);
63 * this is a container for a lot of other stuff
64 * but can be treated like a usual widget
67 class KdmLayoutBox
: public KdmLayout
{
70 KdmLayoutBox( const QDomNode
&node
);
72 // Updates the layout of all boxed items knowing that they
73 // should fit into @p parentGeometry container
74 void update( QStack
<QSize
> &parentSizes
, const QRect
&parentGeometry
, bool force
);
76 // Computes the size hint of the box, telling which is the
77 // smallest size inside which boxed items will fit
78 QSize
sizeHint( QStack
<QSize
> &parentSizes
);