| 1 | /****************************************************************************
|
|---|
| 2 | ** $Id: qworkspace.h 2 2005-11-16 15:49:26Z dmik $
|
|---|
| 3 | **
|
|---|
| 4 | ** Definition of the QWorkspace class
|
|---|
| 5 | **
|
|---|
| 6 | ** Created : 990210
|
|---|
| 7 | **
|
|---|
| 8 | ** Copyright (C) 1999-2000 Trolltech AS. All rights reserved.
|
|---|
| 9 | **
|
|---|
| 10 | ** This file is part of the workspace module of the Qt GUI Toolkit.
|
|---|
| 11 | **
|
|---|
| 12 | ** This file may be distributed under the terms of the Q Public License
|
|---|
| 13 | ** as defined by Trolltech AS of Norway and appearing in the file
|
|---|
| 14 | ** LICENSE.QPL included in the packaging of this file.
|
|---|
| 15 | **
|
|---|
| 16 | ** This file may be distributed and/or modified under the terms of the
|
|---|
| 17 | ** GNU General Public License version 2 as published by the Free Software
|
|---|
| 18 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
|---|
| 19 | ** packaging of this file.
|
|---|
| 20 | **
|
|---|
| 21 | ** Licensees holding valid Qt Enterprise Edition licenses may use this
|
|---|
| 22 | ** file in accordance with the Qt Commercial License Agreement provided
|
|---|
| 23 | ** with the Software.
|
|---|
| 24 | **
|
|---|
| 25 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|---|
| 26 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|---|
| 27 | **
|
|---|
| 28 | ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
|
|---|
| 29 | ** information about Qt Commercial License Agreements.
|
|---|
| 30 | ** See http://www.trolltech.com/qpl/ for QPL licensing information.
|
|---|
| 31 | ** See http://www.trolltech.com/gpl/ for GPL licensing information.
|
|---|
| 32 | **
|
|---|
| 33 | ** Contact info@trolltech.com if any conditions of this licensing are
|
|---|
| 34 | ** not clear to you.
|
|---|
| 35 | **
|
|---|
| 36 | **********************************************************************/
|
|---|
| 37 |
|
|---|
| 38 | #ifndef QWORKSPACE_H
|
|---|
| 39 | #define QWORKSPACE_H
|
|---|
| 40 |
|
|---|
| 41 | #ifndef QT_H
|
|---|
| 42 | #include "qwidget.h"
|
|---|
| 43 | #include "qwidgetlist.h"
|
|---|
| 44 | #endif // QT_H
|
|---|
| 45 |
|
|---|
| 46 | #ifndef QT_NO_WORKSPACE
|
|---|
| 47 |
|
|---|
| 48 | #if !defined( QT_MODULE_WORKSPACE ) || defined( QT_INTERNAL_WORKSPACE )
|
|---|
| 49 | #define QM_EXPORT_WORKSPACE
|
|---|
| 50 | #else
|
|---|
| 51 | #define QM_EXPORT_WORKSPACE Q_EXPORT
|
|---|
| 52 | #endif
|
|---|
| 53 |
|
|---|
| 54 | class QWorkspaceChild;
|
|---|
| 55 | class QShowEvent;
|
|---|
| 56 | class QWorkspacePrivate;
|
|---|
| 57 | class QPopupMenu;
|
|---|
| 58 | class QDockWindow;
|
|---|
| 59 |
|
|---|
| 60 | class QM_EXPORT_WORKSPACE QWorkspace : public QWidget
|
|---|
| 61 | {
|
|---|
| 62 | Q_OBJECT
|
|---|
| 63 | Q_PROPERTY( bool scrollBarsEnabled READ scrollBarsEnabled WRITE setScrollBarsEnabled )
|
|---|
| 64 |
|
|---|
| 65 | #ifdef QT_WORKSPACE_WINDOWMODE
|
|---|
| 66 | public:
|
|---|
| 67 | #endif
|
|---|
| 68 | enum WindowMode { TopLevel, MDI, AutoDetect };
|
|---|
| 69 | WindowMode windowMode() const;
|
|---|
| 70 | #ifdef QT_WORKSPACE_WINDOWMODE
|
|---|
| 71 | private:
|
|---|
| 72 | #endif
|
|---|
| 73 |
|
|---|
| 74 | public:
|
|---|
| 75 | #ifdef QT_WORKSPACE_WINDOWMODE
|
|---|
| 76 | QWorkspace( WindowMode mode, QWidget* parent=0, const char* name=0 );
|
|---|
| 77 | #endif
|
|---|
| 78 | QWorkspace( QWidget* parent=0, const char* name=0 );
|
|---|
| 79 |
|
|---|
| 80 | ~QWorkspace();
|
|---|
| 81 |
|
|---|
| 82 | enum WindowOrder { CreationOrder, StackingOrder };
|
|---|
| 83 |
|
|---|
| 84 | QWidget* activeWindow() const;
|
|---|
| 85 | QWidgetList windowList() const; // ### merge with below in 4.0
|
|---|
| 86 | QWidgetList windowList( WindowOrder order ) const;
|
|---|
| 87 |
|
|---|
| 88 | QSize sizeHint() const;
|
|---|
| 89 |
|
|---|
| 90 | bool scrollBarsEnabled() const;
|
|---|
| 91 | void setScrollBarsEnabled( bool enable );
|
|---|
| 92 |
|
|---|
| 93 | void setPaletteBackgroundColor( const QColor & );
|
|---|
| 94 | void setPaletteBackgroundPixmap( const QPixmap & );
|
|---|
| 95 |
|
|---|
| 96 | signals:
|
|---|
| 97 | void windowActivated( QWidget* w);
|
|---|
| 98 |
|
|---|
| 99 | public slots:
|
|---|
| 100 | void cascade();
|
|---|
| 101 | void tile();
|
|---|
| 102 | void closeActiveWindow();
|
|---|
| 103 | void closeAllWindows();
|
|---|
| 104 | void activateNextWindow();
|
|---|
| 105 | void activatePrevWindow();
|
|---|
| 106 |
|
|---|
| 107 | protected:
|
|---|
| 108 | #ifndef QT_NO_STYLE
|
|---|
| 109 | void styleChange( QStyle& );
|
|---|
| 110 | #endif
|
|---|
| 111 | void childEvent( QChildEvent * );
|
|---|
| 112 | void resizeEvent( QResizeEvent * );
|
|---|
| 113 | bool eventFilter( QObject *, QEvent * );
|
|---|
| 114 | void showEvent( QShowEvent *e );
|
|---|
| 115 | void hideEvent( QHideEvent *e );
|
|---|
| 116 | #ifndef QT_NO_WHEELEVENT
|
|---|
| 117 | void wheelEvent( QWheelEvent *e );
|
|---|
| 118 | #endif
|
|---|
| 119 |
|
|---|
| 120 | private slots:
|
|---|
| 121 | void normalizeActiveWindow();
|
|---|
| 122 | void minimizeActiveWindow();
|
|---|
| 123 | void showOperationMenu();
|
|---|
| 124 | void popupOperationMenu( const QPoint& );
|
|---|
| 125 | void operationMenuActivated( int );
|
|---|
| 126 | void operationMenuAboutToShow();
|
|---|
| 127 | void toolMenuAboutToShow();
|
|---|
| 128 | void activatePreviousWindow(); // ### remove in Qt 4.0
|
|---|
| 129 | void dockWindowsShow();
|
|---|
| 130 | void scrollBarChanged();
|
|---|
| 131 |
|
|---|
| 132 | private:
|
|---|
| 133 | void init();
|
|---|
| 134 | void handleUndock( QDockWindow* w);
|
|---|
| 135 | void insertIcon( QWidget* w);
|
|---|
| 136 | void removeIcon( QWidget* w);
|
|---|
| 137 | void place( QWidget* );
|
|---|
| 138 |
|
|---|
| 139 | QWorkspaceChild* findChild( QWidget* w);
|
|---|
| 140 | void showMaximizeControls();
|
|---|
| 141 | void hideMaximizeControls();
|
|---|
| 142 | void activateWindow( QWidget* w, bool change_focus = TRUE );
|
|---|
| 143 | void showWindow( QWidget* w);
|
|---|
| 144 | void maximizeWindow( QWidget* w);
|
|---|
| 145 | void minimizeWindow( QWidget* w);
|
|---|
| 146 | void normalizeWindow( QWidget* w);
|
|---|
| 147 |
|
|---|
| 148 | QRect updateWorkspace();
|
|---|
| 149 |
|
|---|
| 150 | QPopupMenu* popup;
|
|---|
| 151 | QWorkspacePrivate* d;
|
|---|
| 152 |
|
|---|
| 153 | friend class QWorkspacePrivate;
|
|---|
| 154 | friend class QWorkspaceChild;
|
|---|
| 155 |
|
|---|
| 156 | private: // Disabled copy constructor and operator=
|
|---|
| 157 | #if defined(Q_DISABLE_COPY)
|
|---|
| 158 | QWorkspace( const QWorkspace & );
|
|---|
| 159 | QWorkspace& operator=( const QWorkspace & );
|
|---|
| 160 | #endif
|
|---|
| 161 | };
|
|---|
| 162 |
|
|---|
| 163 |
|
|---|
| 164 | #endif // QT_NO_WORKSPACE
|
|---|
| 165 |
|
|---|
| 166 | #endif // QWORKSPACE_H
|
|---|