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

« back to all changes in this revision

Viewing changes to src/qt3support/widgets/q3mainwindow.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 Qt 3 compatibility classes 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 Q3MAINWINDOW_H
 
30
#define Q3MAINWINDOW_H
 
31
 
 
32
#include "QtGui/qwidget.h"
 
33
#include "Qt3Support/q3toolbar.h"
 
34
#include "QtCore/qtextstream.h"
 
35
 
 
36
#ifndef QT_NO_MAINWINDOW
 
37
 
 
38
class QMenuBar;
 
39
class QStatusBar;
 
40
class QToolTipGroup;
 
41
class Q3MainWindowPrivate;
 
42
class Q3MainWindowLayout;
 
43
class Q3PopupMenu;
 
44
template<class T> class QList;
 
45
 
 
46
class Q_COMPAT_EXPORT Q3MainWindow: public QWidget
 
47
{
 
48
    Q_OBJECT
 
49
    Q_DECLARE_PRIVATE(Q3MainWindow)
 
50
 
 
51
    Q_PROPERTY(bool rightJustification READ rightJustification WRITE setRightJustification DESIGNABLE false)
 
52
    Q_PROPERTY(bool usesBigPixmaps READ usesBigPixmaps WRITE setUsesBigPixmaps)
 
53
    Q_PROPERTY(bool usesTextLabel READ usesTextLabel WRITE setUsesTextLabel)
 
54
    Q_PROPERTY(bool dockWindowsMovable READ dockWindowsMovable WRITE setDockWindowsMovable)
 
55
    Q_PROPERTY(bool opaqueMoving READ opaqueMoving WRITE setOpaqueMoving)
 
56
 
 
57
public:
 
58
    Q3MainWindow(QWidget* parent=0, const char* name=0, Qt::WFlags f = Qt::WType_TopLevel);
 
59
    ~Q3MainWindow();
 
60
 
 
61
#ifndef QT_NO_MENUBAR
 
62
    QMenuBar * menuBar() const;
 
63
#endif
 
64
    QStatusBar * statusBar() const;
 
65
#if 0
 
66
    QToolTipGroup * toolTipGroup() const;
 
67
#endif
 
68
 
 
69
    virtual void setCentralWidget(QWidget *);
 
70
    QWidget * centralWidget() const;
 
71
 
 
72
    virtual void setDockEnabled(Qt::Dock dock, bool enable);
 
73
    bool isDockEnabled(Qt::Dock dock) const;
 
74
    bool isDockEnabled(Q3DockArea *area) const;
 
75
    virtual void setDockEnabled(Q3DockWindow *tb, Qt::Dock dock, bool enable);
 
76
    bool isDockEnabled(Q3DockWindow *tb, Qt::Dock dock) const;
 
77
    bool isDockEnabled(Q3DockWindow *tb, Q3DockArea *area) const;
 
78
 
 
79
    virtual void addDockWindow(Q3DockWindow *, Qt::Dock = Qt::DockTop, bool newLine = false);
 
80
    virtual void addDockWindow(Q3DockWindow *, const QString &label,
 
81
                                Qt::Dock = Qt::DockTop, bool newLine = false);
 
82
    virtual void moveDockWindow(Q3DockWindow *, Qt::Dock = Qt::DockTop);
 
83
    virtual void moveDockWindow(Q3DockWindow *, Qt::Dock, bool nl, int index, int extraOffset = -1);
 
84
    virtual void removeDockWindow(Q3DockWindow *);
 
85
 
 
86
    void setVisible(bool);
 
87
    QSize sizeHint() const;
 
88
    QSize minimumSizeHint() const;
 
89
 
 
90
    bool rightJustification() const;
 
91
    bool usesBigPixmaps() const;
 
92
    bool usesTextLabel() const;
 
93
    bool dockWindowsMovable() const;
 
94
    bool opaqueMoving() const;
 
95
 
 
96
    bool eventFilter(QObject*, QEvent*);
 
97
 
 
98
    bool getLocation(Q3DockWindow *tb, Qt::Dock &dock, int &index, bool &nl, int &extraOffset) const;
 
99
 
 
100
    QList<Q3DockWindow *> dockWindows(Qt::Dock dock) const;
 
101
    QList<Q3DockWindow *> dockWindows() const;
 
102
    void lineUpDockWindows(bool keepNewLines = false);
 
103
 
 
104
    bool isDockMenuEnabled() const;
 
105
 
 
106
    // compatibility stuff
 
107
    bool hasDockWindow(Q3DockWindow *dw);
 
108
#ifndef QT_NO_TOOLBAR
 
109
    void addToolBar(Q3DockWindow *, Qt::Dock = Qt::DockTop, bool newLine = false);
 
110
    void addToolBar(Q3DockWindow *, const QString &label,
 
111
                     Qt::Dock = Qt::DockTop, bool newLine = false);
 
112
    void moveToolBar(Q3DockWindow *, Qt::Dock = Qt::DockTop);
 
113
    void moveToolBar(Q3DockWindow *, Qt::Dock, bool nl, int index, int extraOffset = -1);
 
114
    void removeToolBar(Q3DockWindow *);
 
115
 
 
116
    bool toolBarsMovable() const;
 
117
    QList<Q3ToolBar *> toolBars(Qt::Dock dock) const;
 
118
    void lineUpToolBars(bool keepNewLines = false);
 
119
#endif
 
120
 
 
121
    virtual Q3DockArea *dockingArea(const QPoint &p);
 
122
    Q3DockArea *leftDock() const;
 
123
    Q3DockArea *rightDock() const;
 
124
    Q3DockArea *topDock() const;
 
125
    Q3DockArea *bottomDock() const;
 
126
 
 
127
    virtual bool isCustomizable() const;
 
128
 
 
129
    bool appropriate(Q3DockWindow *dw) const;
 
130
 
 
131
    enum DockWindows { OnlyToolBars, NoToolBars, AllDockWindows };
 
132
    virtual Q3PopupMenu *createDockWindowMenu(DockWindows dockWindows = AllDockWindows) const;
 
133
 
 
134
public slots:
 
135
    virtual void setRightJustification(bool);
 
136
    virtual void setUsesBigPixmaps(bool);
 
137
    virtual void setUsesTextLabel(bool);
 
138
    virtual void setDockWindowsMovable(bool);
 
139
    virtual void setOpaqueMoving(bool);
 
140
    virtual void setDockMenuEnabled(bool);
 
141
    virtual void whatsThis();
 
142
    virtual void setAppropriate(Q3DockWindow *dw, bool a);
 
143
    virtual void customize();
 
144
 
 
145
    // compatibility stuff
 
146
    void setToolBarsMovable(bool);
 
147
 
 
148
signals:
 
149
    void pixmapSizeChanged(bool);
 
150
    void usesTextLabelChanged(bool);
 
151
    void dockWindowPositionChanged(Q3DockWindow *);
 
152
 
 
153
#ifndef QT_NO_TOOLBAR
 
154
    // compatibility stuff
 
155
    void toolBarPositionChanged(Q3ToolBar *);
 
156
#endif
 
157
 
 
158
protected slots:
 
159
    virtual void setUpLayout();
 
160
    virtual bool showDockMenu(const QPoint &globalPos);
 
161
 
 
162
protected:
 
163
    void paintEvent(QPaintEvent *);
 
164
    void childEvent(QChildEvent *);
 
165
    bool event(QEvent *);
 
166
 
 
167
private slots:
 
168
    void slotPlaceChanged();
 
169
    void doLineUp() { lineUpDockWindows(true); }
 
170
 
 
171
private:
 
172
    Q_DISABLE_COPY(Q3MainWindow)
 
173
 
 
174
    void triggerLayout(bool deleteLayout = true);
 
175
    bool dockMainWindow(QObject *dock) const;
 
176
 
 
177
#ifndef QT_NO_MENUBAR
 
178
    virtual void setMenuBar(QMenuBar *);
 
179
#endif
 
180
    virtual void setStatusBar(QStatusBar *);
 
181
#if 0
 
182
    virtual void setToolTipGroup(QToolTipGroup *);
 
183
#endif
 
184
 
 
185
    friend class Q3DockWindow;
 
186
    friend class QMenuBarPrivate;
 
187
    friend class QHideDock;
 
188
    friend class Q3ToolBar;
 
189
    friend class Q3MainWindowLayout;
 
190
};
 
191
 
 
192
#ifndef QT_NO_TOOLBAR
 
193
inline void Q3MainWindow::addToolBar(Q3DockWindow *w, Qt::ToolBarDock dock, bool newLine)
 
194
{
 
195
    addDockWindow(w, dock, newLine);
 
196
}
 
197
 
 
198
inline void Q3MainWindow::addToolBar(Q3DockWindow *w, const QString &label,
 
199
                              Qt::ToolBarDock dock, bool newLine)
 
200
{
 
201
    addDockWindow(w, label, dock, newLine);
 
202
}
 
203
 
 
204
inline void Q3MainWindow::moveToolBar(Q3DockWindow *w, Qt::ToolBarDock dock)
 
205
{
 
206
    moveDockWindow(w, dock);
 
207
}
 
208
 
 
209
inline void Q3MainWindow::moveToolBar(Q3DockWindow *w, Qt::ToolBarDock dock, bool nl, int index, int extraOffset)
 
210
{
 
211
    moveDockWindow(w, dock, nl, index, extraOffset);
 
212
}
 
213
 
 
214
inline void Q3MainWindow::removeToolBar(Q3DockWindow *w)
 
215
{
 
216
    removeDockWindow(w);
 
217
}
 
218
 
 
219
inline bool Q3MainWindow::toolBarsMovable() const
 
220
{
 
221
    return dockWindowsMovable();
 
222
}
 
223
 
 
224
inline void Q3MainWindow::lineUpToolBars(bool keepNewLines)
 
225
{
 
226
    lineUpDockWindows(keepNewLines);
 
227
}
 
228
 
 
229
inline void Q3MainWindow::setToolBarsMovable(bool b)
 
230
{
 
231
    setDockWindowsMovable(b);
 
232
}
 
233
#endif
 
234
 
 
235
#ifndef QT_NO_TEXTSTREAM
 
236
Q_COMPAT_EXPORT QTextStream &operator<<(QTextStream &, const Q3MainWindow &);
 
237
Q_COMPAT_EXPORT QTextStream &operator>>(QTextStream &, Q3MainWindow &);
 
238
#endif
 
239
 
 
240
#endif // QT_NO_MAINWINDOW
 
241
 
 
242
#endif // Q3MAINWINDOW_H