Eneboo - Documentación para desarrolladores
|
00001 /**************************************************************************** 00002 ** $Id: qt/qdialog.h 3.3.8 edited Jan 11 14:37 $ 00003 ** 00004 ** Definition of QDialog class 00005 ** 00006 ** Created : 950502 00007 ** 00008 ** Copyright (C) 1992-2007 Trolltech ASA. All rights reserved. 00009 ** 00010 ** This file is part of the dialogs 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 or Qt Professional Edition 00022 ** licenses may use this file in accordance with the Qt Commercial License 00023 ** Agreement provided 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 QDIALOG_H 00039 #define QDIALOG_H 00040 00041 #ifndef QT_H 00042 #include "qwidget.h" 00043 #endif // QT_H 00044 #ifndef QT_NO_DIALOG 00045 #if 0 00046 Q_OBJECT 00047 #endif 00048 00049 class QPushButton; 00050 class QDialogPrivate; 00051 00052 class Q_EXPORT QDialog : public QWidget 00053 { 00054 friend class QPushButton; 00055 Q_OBJECT 00056 Q_PROPERTY( bool sizeGripEnabled READ isSizeGripEnabled WRITE setSizeGripEnabled ) 00057 Q_PROPERTY( bool modal READ isModal WRITE setModal ) 00058 00059 public: 00060 Q_EXPLICIT QDialog( QWidget* parent=0, const char* name=0, bool modal=FALSE, 00061 WFlags f=0 ); 00062 ~QDialog(); 00063 00064 enum DialogCode { Rejected, Accepted }; 00065 00066 int result() const { return rescode; } 00067 00068 void show(); 00069 void hide(); 00070 void move( int x, int y ); 00071 void move( const QPoint &p ); 00072 void resize( int w, int h ); 00073 void resize( const QSize & ); 00074 void setGeometry( int x, int y, int w, int h ); 00075 void setGeometry( const QRect & ); 00076 00077 void setOrientation( Orientation orientation ); 00078 Orientation orientation() const; 00079 00080 void setExtension( QWidget* extension ); 00081 QWidget* extension() const; 00082 00083 QSize sizeHint() const; 00084 QSize minimumSizeHint() const; 00085 00086 void setSizeGripEnabled( bool ); 00087 bool isSizeGripEnabled() const; 00088 00089 void setModal( bool modal ); 00090 bool isModal() const; 00091 #ifdef Q_OS_TEMP 00092 bool event( QEvent * ); 00093 #endif 00094 00095 public slots: 00096 int exec(); 00097 00098 protected slots: 00099 virtual void done( int ); 00100 virtual void accept(); 00101 virtual void reject(); 00102 00103 void showExtension( bool ); 00104 00105 protected: 00106 void setResult( int r ) { rescode = r; } 00107 void keyPressEvent( QKeyEvent * ); 00108 void closeEvent( QCloseEvent * ); 00109 void resizeEvent( QResizeEvent * ); 00110 void contextMenuEvent( QContextMenuEvent * ); 00111 bool eventFilter( QObject *, QEvent * ); 00112 void adjustPosition( QWidget*); 00113 00114 private: 00115 void setDefault( QPushButton * ); 00116 void setMainDefault( QPushButton * ); 00117 void hideDefault(); 00118 #ifdef Q_OS_TEMP 00119 void hideSpecial(); 00120 #endif 00121 00122 int rescode; 00123 uint did_move : 1; 00124 uint has_relpos : 1; 00125 uint did_resize : 1; 00126 uint in_loop: 1; 00127 void adjustPositionInternal( QWidget*, bool useRelPos = FALSE ); 00128 QDialogPrivate* d; 00129 00130 private: // Disabled copy constructor and operator= 00131 #if defined(Q_DISABLE_COPY) 00132 QDialog( const QDialog & ); 00133 QDialog &operator=( const QDialog & ); 00134 #endif 00135 }; 00136 00137 #endif // QT_NO_DIALOG 00138 #endif // QDIALOG_H