qmdisubwindow.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 **
00003 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
00004 ** All rights reserved.
00005 ** Contact: Nokia Corporation (qt-info@nokia.com)
00006 **
00007 ** This file is part of the QtGui module of the Qt Toolkit.
00008 **
00009 ** $QT_BEGIN_LICENSE:LGPL$
00010 ** Commercial Usage
00011 ** Licensees holding valid Qt Commercial licenses may use this file in
00012 ** accordance with the Qt Commercial License Agreement provided with the
00013 ** Software or, alternatively, in accordance with the terms contained in
00014 ** a written agreement between you and Nokia.
00015 **
00016 ** GNU Lesser General Public License Usage
00017 ** Alternatively, this file may be used under the terms of the GNU Lesser
00018 ** General Public License version 2.1 as published by the Free Software
00019 ** Foundation and appearing in the file LICENSE.LGPL included in the
00020 ** packaging of this file.  Please review the following information to
00021 ** ensure the GNU Lesser General Public License version 2.1 requirements
00022 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
00023 **
00024 ** In addition, as a special exception, Nokia gives you certain additional
00025 ** rights.  These rights are described in the Nokia Qt LGPL Exception
00026 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this module.
00027 **
00028 ** GNU General Public License Usage
00029 ** Alternatively, this file may be used under the terms of the GNU
00030 ** General Public License version 3.0 as published by the Free Software
00031 ** Foundation and appearing in the file LICENSE.GPL included in the
00032 ** packaging of this file.  Please review the following information to
00033 ** ensure the GNU General Public License version 3.0 requirements will be
00034 ** met: http://www.gnu.org/copyleft/gpl.html.
00035 **
00036 ** If you have questions regarding the use of this file, please contact
00037 ** Nokia at qt-info@nokia.com.
00038 ** $QT_END_LICENSE$
00039 **
00040 ****************************************************************************/
00041 
00042 #ifndef QMDISUBWINDOW_H
00043 #define QMDISUBWINDOW_H
00044 
00045 #include <QtGui/qwidget.h>
00046 
00047 QT_BEGIN_HEADER
00048 
00049 QT_BEGIN_NAMESPACE
00050 
00051 QT_MODULE(Gui)
00052 
00053 #ifndef QT_NO_MDIAREA
00054 
00055 class QMenu;
00056 class QMdiArea;
00057 
00058 namespace QMdi { class ControlContainer; }
00059 class QMdiSubWindowPrivate;
00060 class Q_GUI_EXPORT QMdiSubWindow : public QWidget
00061 {
00062     Q_OBJECT
00063     Q_PROPERTY(int keyboardSingleStep READ keyboardSingleStep WRITE setKeyboardSingleStep)
00064     Q_PROPERTY(int keyboardPageStep READ keyboardPageStep WRITE setKeyboardPageStep)
00065 public:
00066     enum SubWindowOption {
00067         AllowOutsideAreaHorizontally = 0x1, // internal
00068         AllowOutsideAreaVertically = 0x2, // internal
00069         RubberBandResize = 0x4,
00070         RubberBandMove = 0x8
00071     };
00072     Q_DECLARE_FLAGS(SubWindowOptions, SubWindowOption)
00073 
00074     QMdiSubWindow(QWidget *parent = 0, Qt::WindowFlags flags = 0);
00075     ~QMdiSubWindow();
00076 
00077     QSize sizeHint() const;
00078     QSize minimumSizeHint() const;
00079 
00080     void setWidget(QWidget *widget);
00081     QWidget *widget() const;
00082 
00083     QWidget *maximizedButtonsWidget() const; // internal
00084     QWidget *maximizedSystemMenuIconWidget() const; // internal
00085 
00086     bool isShaded() const;
00087 
00088     void setOption(SubWindowOption option, bool on = true);
00089     bool testOption(SubWindowOption) const;
00090 
00091     void setKeyboardSingleStep(int step);
00092     int keyboardSingleStep() const;
00093 
00094     void setKeyboardPageStep(int step);
00095     int keyboardPageStep() const;
00096 
00097 #ifndef QT_NO_MENU
00098     void setSystemMenu(QMenu *systemMenu);
00099     QMenu *systemMenu() const;
00100 #endif
00101 
00102     QMdiArea *mdiArea() const;
00103 
00104 Q_SIGNALS:
00105     void windowStateChanged(Qt::WindowStates oldState, Qt::WindowStates newState);
00106     void aboutToActivate();
00107 
00108 public Q_SLOTS:
00109 #ifndef QT_NO_MENU
00110     void showSystemMenu();
00111 #endif
00112     void showShaded();
00113 
00114 protected:
00115     bool eventFilter(QObject *object, QEvent *event);
00116     bool event(QEvent *event);
00117     void showEvent(QShowEvent *showEvent);
00118     void hideEvent(QHideEvent *hideEvent);
00119     void changeEvent(QEvent *changeEvent);
00120     void closeEvent(QCloseEvent *closeEvent);
00121     void leaveEvent(QEvent *leaveEvent);
00122     void resizeEvent(QResizeEvent *resizeEvent);
00123     void timerEvent(QTimerEvent *timerEvent);
00124     void moveEvent(QMoveEvent *moveEvent);
00125     void paintEvent(QPaintEvent *paintEvent);
00126     void mousePressEvent(QMouseEvent *mouseEvent);
00127     void mouseDoubleClickEvent(QMouseEvent *mouseEvent);
00128     void mouseReleaseEvent(QMouseEvent *mouseEvent);
00129     void mouseMoveEvent(QMouseEvent *mouseEvent);
00130     void keyPressEvent(QKeyEvent *keyEvent);
00131 #ifndef QT_NO_CONTEXTMENU
00132     void contextMenuEvent(QContextMenuEvent *contextMenuEvent);
00133 #endif
00134     void focusInEvent(QFocusEvent *focusInEvent);
00135     void focusOutEvent(QFocusEvent *focusOutEvent);
00136     void childEvent(QChildEvent *childEvent);
00137 
00138 private:
00139     Q_DISABLE_COPY(QMdiSubWindow)
00140     Q_DECLARE_PRIVATE(QMdiSubWindow)
00141     Q_PRIVATE_SLOT(d_func(), void _q_updateStaysOnTopHint())
00142     Q_PRIVATE_SLOT(d_func(), void _q_enterInteractiveMode())
00143     Q_PRIVATE_SLOT(d_func(), void _q_processFocusChanged(QWidget *, QWidget *))
00144     friend class QMdiAreaPrivate;
00145 #ifndef QT_NO_TABBAR
00146     friend class QMdiAreaTabBar;
00147 #endif
00148     friend class QMdi::ControlContainer;
00149 };
00150 
00151 Q_DECLARE_OPERATORS_FOR_FLAGS(QMdiSubWindow::SubWindowOptions)
00152 
00153 QT_END_NAMESPACE
00154 
00155 QT_END_HEADER
00156 
00157 #endif // QT_NO_MDIAREA
00158 
00159 #endif // QMDISUBWINDOW_H