Eneboo - Documentación para desarrolladores
src/qt/include/private/qdialogbuttons_p.h
Ir a la documentación de este archivo.
00001 /****************************************************************************
00002 ** $Id: qt/qdialogbuttons_p.h   3.3.8   edited Jan 11 14:46 $
00003 **
00004 ** Definition of QDialogButtons class.
00005 **
00006 ** Copyright (C) 2005-2007 Trolltech ASA.  All rights reserved.
00007 **
00008 ** This file is part of the widgets module of the Qt GUI Toolkit.
00009 **
00010 ** This file may be distributed under the terms of the Q Public License
00011 ** as defined by Trolltech ASA of Norway and appearing in the file
00012 ** LICENSE.QPL included in the packaging of this file.
00013 **
00014 ** This file may be distributed and/or modified under the terms of the
00015 ** GNU General Public License version 2 as published by the Free Software
00016 ** Foundation and appearing in the file LICENSE.GPL included in the
00017 ** packaging of this file.
00018 **
00019 ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
00020 ** licenses may use this file in accordance with the Qt Commercial License
00021 ** Agreement provided with the Software.
00022 **
00023 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00024 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00025 **
00026 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
00027 **   information about Qt Commercial License Agreements.
00028 ** See http://www.trolltech.com/qpl/ for QPL licensing information.
00029 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00030 **
00031 ** Contact info@trolltech.com if any conditions of this licensing are
00032 ** not clear to you.
00033 **
00034 **********************************************************************/
00035 
00036 #ifndef QDIALOGBUTTONS_P_H
00037 #define QDIALOGBUTTONS_P_H
00038 
00039 #ifndef QT_H
00040 #ifndef QT_H
00041 #include "qwidget.h"
00042 #endif // QT_H
00043 #endif
00044 
00045 #ifndef QT_NO_DIALOGBUTTONS
00046 struct QDialogButtonsPrivate;
00047 
00048 class
00049 QDialogButtons : public QWidget
00050 {
00051     Q_OBJECT
00052 public:
00053     enum Button { None=0, Accept=0x01, Reject=0x02, Help=0x04, Apply=0x08, All=0x10, Abort=0x20, Retry=0x40, Ignore=0x80 };
00054 #ifndef QT_NO_DIALOG
00055     QDialogButtons(QDialog *parent, bool autoConnect = TRUE, Q_UINT32 buttons = Accept | Reject,
00056                    Orientation orient = Horizontal, const char *name = NULL);
00057 #endif // QT_NO_DIALOG
00058     QDialogButtons(QWidget *parent, Q_UINT32 buttons = Accept | Reject, 
00059                    Orientation orient = Horizontal, const char *name = NULL);
00060     ~QDialogButtons();
00061 
00062     void setQuestionMode(bool);
00063     bool questionMode() const;
00064 
00065     void setButtonEnabled(Button button, bool enabled);
00066     bool isButtonEnabled(Button) const;
00067 
00068     inline void showButton(Button b) { setButtonVisible(b, TRUE) ; }
00069     inline void hideButton(Button b) { setButtonVisible(b, FALSE); }
00070     virtual void setButtonVisible(Button, bool visible);
00071     bool isButtonVisible(Button) const;
00072 
00073     void addWidget(QWidget *);
00074 
00075     virtual void setDefaultButton(Button);
00076     Button defaultButton() const;
00077 
00078     virtual void setButtonText(Button, const QString &);
00079     QString buttonText(Button) const;
00080 
00081     void setOrientation(Orientation);
00082     Orientation orientation() const;
00083 
00084     virtual QSize sizeHint(Button) const;
00085     QSize minimumSizeHint() const;
00086     QSize sizeHint() const;
00087 
00088 protected:
00089     void layoutButtons();
00090     virtual QWidget *createButton(Button);
00091 
00092     void showEvent(QShowEvent *);
00093     void resizeEvent(QResizeEvent *);
00094     void styleChanged(QStyle &);
00095 
00096 private slots:
00097     void handleClicked();
00098 
00099 signals:
00100     void clicked(Button);
00101     void acceptClicked();
00102     void rejectClicked();
00103     void helpClicked();
00104     void applyClicked();
00105     void allClicked();
00106     void retryClicked();
00107     void ignoreClicked();
00108     void abortClicked();
00109 
00110 private:
00111     QDialogButtonsPrivate *d;
00112     void init(Q_UINT32, Orientation);
00113 };
00114 #endif //QT_NO_DIALOGBUTTONS
00115 #endif //QDIALOGBUTTONS_P_H
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'