~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to src/gui/kernel/qboxlayout.h

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
**
 
3
** Copyright (C) 1992-2005 Trolltech AS. All rights reserved.
 
4
**
 
5
** This file is part of the gui module of the Qt Toolkit.
 
6
**
 
7
** This file may be distributed under the terms of the Q Public License
 
8
** as defined by Trolltech AS of Norway and appearing in the file
 
9
** LICENSE.QPL included in the packaging of this file.
 
10
**
 
11
** This file may be distributed and/or modified under the terms of the
 
12
** GNU General Public License version 2 as published by the Free Software
 
13
** Foundation and appearing in the file LICENSE.GPL included in the
 
14
** packaging of this file.
 
15
**
 
16
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
 
17
**   information about Qt Commercial License Agreements.
 
18
** See http://www.trolltech.com/qpl/ for QPL licensing information.
 
19
** See http://www.trolltech.com/gpl/ for GPL licensing information.
 
20
**
 
21
** Contact info@trolltech.com if any conditions of this licensing are
 
22
** not clear to you.
 
23
**
 
24
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 
25
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 
26
**
 
27
****************************************************************************/
 
28
 
 
29
#ifndef QBOXLAYOUT_H
 
30
#define QBOXLAYOUT_H
 
31
 
 
32
#include "QtGui/qlayout.h"
 
33
#ifdef QT_INCLUDE_COMPAT
 
34
#include "QtGui/qwidget.h"
 
35
#endif
 
36
 
 
37
#include <limits.h>
 
38
 
 
39
#ifndef QT_NO_LAYOUT
 
40
 
 
41
class QBoxLayoutPrivate;
 
42
 
 
43
class Q_GUI_EXPORT QBoxLayout : public QLayout
 
44
{
 
45
    Q_OBJECT
 
46
    Q_DECLARE_PRIVATE(QBoxLayout)
 
47
public:
 
48
    enum Direction { LeftToRight, RightToLeft, TopToBottom, BottomToTop,
 
49
                     Down = TopToBottom, Up = BottomToTop };
 
50
 
 
51
    explicit QBoxLayout(Direction, QWidget *parent = 0);
 
52
 
 
53
#ifdef QT3_SUPPORT
 
54
    QT3_SUPPORT_CONSTRUCTOR QBoxLayout(QWidget *parent, Direction, int border = 0, int spacing = -1,
 
55
                const char *name = 0);
 
56
    QT3_SUPPORT_CONSTRUCTOR  QBoxLayout(QLayout *parentLayout, Direction, int spacing = -1,
 
57
                const char *name = 0);
 
58
    QT3_SUPPORT_CONSTRUCTOR  QBoxLayout(Direction, int spacing, const char *name = 0);
 
59
#endif
 
60
    ~QBoxLayout();
 
61
 
 
62
    Direction direction() const;
 
63
    void setDirection(Direction);
 
64
 
 
65
    void addSpacing(int size);
 
66
    void addStretch(int stretch = 0);
 
67
    void addWidget(QWidget *, int stretch = 0, Qt::Alignment alignment = 0);
 
68
    void addLayout(QLayout *layout, int stretch = 0);
 
69
    void addStrut(int);
 
70
    void addItem(QLayoutItem *);
 
71
 
 
72
    void insertSpacing(int index, int size);
 
73
    void insertStretch(int index, int stretch = 0);
 
74
    void insertWidget(int index, QWidget *widget, int stretch = 0, Qt::Alignment alignment = 0);
 
75
    void insertLayout(int index, QLayout *layout, int stretch = 0);
 
76
 
 
77
    bool setStretchFactor(QWidget *w, int stretch);
 
78
    bool setStretchFactor(QLayout *l, int stretch);
 
79
 
 
80
    QSize sizeHint() const;
 
81
    QSize minimumSize() const;
 
82
    QSize maximumSize() const;
 
83
 
 
84
    bool hasHeightForWidth() const;
 
85
    int heightForWidth(int) const;
 
86
    int minimumHeightForWidth(int) const;
 
87
 
 
88
    Qt::Orientations expandingDirections() const;
 
89
    void invalidate();
 
90
    QLayoutItem *itemAt(int) const;
 
91
    QLayoutItem *takeAt(int);
 
92
    int count() const;
 
93
    void setGeometry(const QRect&);
 
94
#ifdef QT3_SUPPORT
 
95
    inline QT3_SUPPORT int findWidget(QWidget* w) {return indexOf(w);}
 
96
#endif
 
97
protected:
 
98
    void insertItem(int index, QLayoutItem *);
 
99
 
 
100
private:
 
101
    Q_DISABLE_COPY(QBoxLayout)
 
102
};
 
103
 
 
104
class Q_GUI_EXPORT QHBoxLayout : public QBoxLayout
 
105
{
 
106
    Q_OBJECT
 
107
public:
 
108
    QHBoxLayout();
 
109
    explicit QHBoxLayout(QWidget *parent);
 
110
    ~QHBoxLayout();
 
111
 
 
112
#ifdef QT3_SUPPORT
 
113
    QT3_SUPPORT_CONSTRUCTOR QHBoxLayout(QWidget *parent, int border,
 
114
                 int spacing = -1, const char *name = 0);
 
115
    QT3_SUPPORT_CONSTRUCTOR QHBoxLayout(QLayout *parentLayout,
 
116
                 int spacing = -1, const char *name = 0);
 
117
    QT3_SUPPORT_CONSTRUCTOR QHBoxLayout(int spacing, const char *name = 0);
 
118
#endif
 
119
 
 
120
private:
 
121
    Q_DISABLE_COPY(QHBoxLayout)
 
122
};
 
123
 
 
124
class Q_GUI_EXPORT QVBoxLayout : public QBoxLayout
 
125
{
 
126
    Q_OBJECT
 
127
public:
 
128
    QVBoxLayout();
 
129
    explicit QVBoxLayout(QWidget *parent);
 
130
    ~QVBoxLayout();
 
131
 
 
132
#ifdef QT3_SUPPORT
 
133
    QT3_SUPPORT_CONSTRUCTOR QVBoxLayout(QWidget *parent, int border,
 
134
                 int spacing = -1, const char *name = 0);
 
135
    QT3_SUPPORT_CONSTRUCTOR QVBoxLayout(QLayout *parentLayout,
 
136
                 int spacing = -1, const char *name = 0);
 
137
    QT3_SUPPORT_CONSTRUCTOR QVBoxLayout(int spacing, const char *name = 0);
 
138
#endif
 
139
 
 
140
private:
 
141
    Q_DISABLE_COPY(QVBoxLayout)
 
142
};
 
143
 
 
144
#endif // QT_NO_LAYOUT
 
145
 
 
146
#endif // QBOXLAYOUT_H