kexi

kexiflowlayout.h
1/* This file is part of the KDE project
2 Copyright (C) 2005 Cedric Pasteur <cedric.pasteur@free.fr>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef KEXIFLOWLAYOUT_H
21#define KEXIFLOWLAYOUT_H
22
23#include <tqlayout.h>
24#include <tqptrlist.h>
25
27class KEXIGUIUTILS_EXPORT KexiFlowLayout : public TQLayout
28{
29 public:
30 KexiFlowLayout(TQWidget *parent, int border=0, int space=-1, const char *name=0);
31 KexiFlowLayout(TQLayout* parent, int space=-1, const char *name=0);
32 KexiFlowLayout(int space=-1, const char *name=0);
33
34 ~KexiFlowLayout();
35
38 TQPtrList<TQWidget>* widgetList() const;
39
41 void setOrientation(TQt::Orientation orientation) { m_orientation = orientation; }
42
44 TQt::Orientation orientation() const { return m_orientation; }
45
46 void setJustified(bool justify) { m_justify = justify; }
47 bool isJustified() const { return m_justify; }
48
49 virtual void addItem(TQLayoutItem *item);
50 virtual void addSpacing(int size);
51 virtual TQLayoutIterator iterator();
52 virtual void invalidate();
53
54 virtual bool hasHeightForWidth() const;
55 virtual int heightForWidth(int width) const;
56 virtual TQSize sizeHint() const;
57 virtual TQSize minimumSize() const;
58 virtual TQSizePolicy::ExpandData expanding() const;
59
60 virtual bool isEmpty();
61
62 protected:
63 virtual void setGeometry(const TQRect&);
64 int simulateLayout(const TQRect &r);
65 int doHorizontalLayout(const TQRect&, bool testonly = false);
66 int doVerticalLayout(const TQRect&, bool testonly = false);
67
68 private:
69 TQPtrList<TQLayoutItem> m_list;
70 int m_cached_width;
71 int m_cached_hfw;
72 bool m_justify;
73 TQt::Orientation m_orientation;
74 TQSize m_cached_sizeHint;
75 TQSize m_cached_minSize;
76};
77
78#endif
79
TQt::Orientation orientation() const
void setOrientation(TQt::Orientation orientation)
TQPtrList< TQWidget > * widgetList() const