File indexing completed on 2024-04-21 14:55:52

0001 /*  This file is part of the KDE project
0002     Copyright (C) 2007 Matthias Kretz <kretz@kde.org>
0003 
0004     This library is free software; you can redistribute it and/or
0005     modify it under the terms of the GNU Library General Public
0006     License version 2 as published by the Free Software Foundation.
0007 
0008     This library is distributed in the hope that it will be useful,
0009     but WITHOUT ANY WARRANTY; without even the implied warranty of
0010     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0011     Library General Public License for more details.
0012 
0013     You should have received a copy of the GNU Library General Public License
0014     along with this library; see the file COPYING.LIB.  If not, write to
0015     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0016     Boston, MA 02110-1301, USA.
0017 
0018 */
0019 
0020 #ifndef KDEUI_KDIALOG_P_H
0021 #define KDEUI_KDIALOG_P_H
0022 
0023 #include "kdialog.h"
0024 #include <QPointer>
0025 #include <QSignalMapper>
0026 #include <QSize>
0027 #include <QHash>
0028 
0029 class QBoxLayout;
0030 class KPushButton;
0031 class KUrlLabel;
0032 class KSeparator;
0033 class QDialogButtonBox;
0034 
0035 class KDialogPrivate
0036 {
0037     Q_DECLARE_PUBLIC(KDialog)
0038 protected:
0039     KDialogPrivate()
0040         : mDetailsVisible(false), mSettingDetails(false), mDeferredDelete(false),
0041           mDetailsWidget(nullptr),
0042           mTopLayout(nullptr), mMainWidget(nullptr), mUrlHelp(nullptr), mActionSeparator(nullptr),
0043           mButtonOrientation(Qt::Horizontal),
0044           mDefaultButton(KDialog::NoDefault),
0045           mButtonBox(nullptr)
0046     {
0047     }
0048 
0049     virtual ~KDialogPrivate() {}
0050 
0051     KDialog *q_ptr;
0052 
0053     void setupLayout();
0054     void appendButton(KDialog::ButtonCode code, const KGuiItem &item);
0055 
0056     bool mDetailsVisible;
0057     bool mSettingDetails;
0058     bool mDeferredDelete;
0059     QWidget *mDetailsWidget;
0060     QSize mIncSize;
0061     QSize mMinSize;
0062     QString mDetailsButtonText;
0063 
0064     QBoxLayout *mTopLayout;
0065     QPointer<QWidget> mMainWidget;
0066     KUrlLabel *mUrlHelp;
0067     KSeparator *mActionSeparator;
0068 
0069     QString mAnchor;
0070     QString mHelpApp;
0071     QString mHelpLinkText;
0072 
0073     Qt::Orientation mButtonOrientation;
0074     KDialog::ButtonCode mDefaultButton;
0075     KDialog::ButtonCode mEscapeButton;
0076 
0077     QDialogButtonBox *mButtonBox;
0078     QHash<int, KPushButton *> mButtonList;
0079     QSignalMapper mButtonSignalMapper;
0080 
0081 protected Q_SLOTS:
0082     void queuedLayoutUpdate();
0083     void helpLinkClicked();
0084 
0085 private:
0086     void init(KDialog *);
0087     bool dirty: 1;
0088 };
0089 
0090 #endif // KDEUI_KDIALOG_P_H