Eneboo - Documentación para desarrolladores
|
00001 /**************************************************************************** 00002 ** $Id: qt/qworkspace.h 3.3.8 edited Jan 11 14:46 $ 00003 ** 00004 ** Definition of the QWorkspace class 00005 ** 00006 ** Created : 990210 00007 ** 00008 ** Copyright (C) 1999-2007 Trolltech ASA. All rights reserved. 00009 ** 00010 ** This file is part of the workspace module of the Qt GUI Toolkit. 00011 ** 00012 ** This file may be distributed under the terms of the Q Public License 00013 ** as defined by Trolltech ASA of Norway and appearing in the file 00014 ** LICENSE.QPL included in the packaging of this file. 00015 ** 00016 ** This file may be distributed and/or modified under the terms of the 00017 ** GNU General Public License version 2 as published by the Free Software 00018 ** Foundation and appearing in the file LICENSE.GPL included in the 00019 ** packaging of this file. 00020 ** 00021 ** Licensees holding valid Qt Enterprise Edition licenses may use this 00022 ** file in accordance with the Qt Commercial License Agreement provided 00023 ** with the Software. 00024 ** 00025 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00026 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00027 ** 00028 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 00029 ** information about Qt Commercial License Agreements. 00030 ** See http://www.trolltech.com/qpl/ for QPL licensing information. 00031 ** See http://www.trolltech.com/gpl/ for GPL licensing information. 00032 ** 00033 ** Contact info@trolltech.com if any conditions of this licensing are 00034 ** not clear to you. 00035 ** 00036 **********************************************************************/ 00037 00038 #ifndef QWORKSPACE_H 00039 #define QWORKSPACE_H 00040 00041 #ifndef QT_H 00042 #include "qwidget.h" 00043 #include "qwidgetlist.h" 00044 #endif // QT_H 00045 00046 #ifndef QT_NO_WORKSPACE 00047 00048 #if !defined( QT_MODULE_WORKSPACE ) || defined( QT_INTERNAL_WORKSPACE ) 00049 #define QM_EXPORT_WORKSPACE 00050 #else 00051 #define QM_EXPORT_WORKSPACE Q_EXPORT 00052 #endif 00053 00054 class QWorkspaceChild; 00055 class QShowEvent; 00056 class QWorkspacePrivate; 00057 class QPopupMenu; 00058 class QDockWindow; 00059 00060 class QM_EXPORT_WORKSPACE QWorkspace : public QWidget 00061 { 00062 Q_OBJECT 00063 Q_PROPERTY( bool scrollBarsEnabled READ scrollBarsEnabled WRITE setScrollBarsEnabled ) 00064 00065 #ifdef QT_WORKSPACE_WINDOWMODE 00066 public: 00067 #endif 00068 enum WindowMode { TopLevel, MDI, AutoDetect }; 00069 WindowMode windowMode() const; 00070 #ifdef QT_WORKSPACE_WINDOWMODE 00071 private: 00072 #endif 00073 00074 public: 00075 #ifdef QT_WORKSPACE_WINDOWMODE 00076 QWorkspace( WindowMode mode, QWidget* parent=0, const char* name=0 ); 00077 #endif 00078 QWorkspace( QWidget* parent=0, const char* name=0 ); 00079 00080 ~QWorkspace(); 00081 00082 enum WindowOrder { CreationOrder, StackingOrder }; 00083 00084 QWidget* activeWindow() const; 00085 QWidgetList windowList() const; // ### merge with below in 4.0 00086 QWidgetList windowList( WindowOrder order ) const; 00087 00088 QSize sizeHint() const; 00089 00090 bool scrollBarsEnabled() const; 00091 void setScrollBarsEnabled( bool enable ); 00092 00093 void setPaletteBackgroundColor( const QColor & ); 00094 void setPaletteBackgroundPixmap( const QPixmap & ); 00095 00096 signals: 00097 void windowActivated( QWidget* w); 00098 00099 public slots: 00100 void cascade(); 00101 void tile(); 00102 void closeActiveWindow(); 00103 void closeAllWindows(); 00104 void activateNextWindow(); 00105 void activatePrevWindow(); 00106 00107 protected: 00108 #ifndef QT_NO_STYLE 00109 void styleChange( QStyle& ); 00110 #endif 00111 void childEvent( QChildEvent * ); 00112 void resizeEvent( QResizeEvent * ); 00113 bool eventFilter( QObject *, QEvent * ); 00114 void showEvent( QShowEvent *e ); 00115 void hideEvent( QHideEvent *e ); 00116 #ifndef QT_NO_WHEELEVENT 00117 void wheelEvent( QWheelEvent *e ); 00118 #endif 00119 00120 private slots: 00121 void normalizeActiveWindow(); 00122 void minimizeActiveWindow(); 00123 void showOperationMenu(); 00124 void popupOperationMenu( const QPoint& ); 00125 void operationMenuActivated( int ); 00126 void operationMenuAboutToShow(); 00127 void toolMenuAboutToShow(); 00128 void activatePreviousWindow(); // ### remove in Qt 4.0 00129 void dockWindowsShow(); 00130 void scrollBarChanged(); 00131 00132 private: 00133 void init(); 00134 void handleUndock( QDockWindow* w); 00135 void insertIcon( QWidget* w); 00136 void removeIcon( QWidget* w); 00137 void place( QWidget* ); 00138 00139 QWorkspaceChild* findChild( QWidget* w); 00140 void showMaximizeControls(); 00141 void hideMaximizeControls(); 00142 void activateWindow( QWidget* w, bool change_focus = TRUE ); 00143 void showWindow( QWidget* w); 00144 void maximizeWindow( QWidget* w); 00145 void minimizeWindow( QWidget* w); 00146 void normalizeWindow( QWidget* w); 00147 00148 QRect updateWorkspace(); 00149 00150 QPopupMenu* popup; 00151 QWorkspacePrivate* d; 00152 00153 friend class QWorkspacePrivate; 00154 friend class QWorkspaceChild; 00155 00156 private: // Disabled copy constructor and operator= 00157 #if defined(Q_DISABLE_COPY) 00158 QWorkspace( const QWorkspace & ); 00159 QWorkspace& operator=( const QWorkspace & ); 00160 #endif 00161 }; 00162 00163 00164 #endif // QT_NO_WORKSPACE 00165 00166 #endif // QWORKSPACE_H