File indexing completed on 2024-05-12 16:02:08

0001 /*  This file is part of the KDE project
0002     SPDX-FileCopyrightText: 2007 Matthias Kretz <kretz@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-only
0005 
0006 */
0007 
0008 #ifndef KODIALOG_P_H
0009 #define KODIALOG_P_H
0010 
0011 #include "KoDialog.h"
0012 #include <QPointer>
0013 #include <KisSignalMapper.h>
0014 #include <QSize>
0015 #include <QHash>
0016 
0017 class QBoxLayout;
0018 class QPushButton;
0019 class KUrlLabel;
0020 class KSeparator;
0021 class QDialogButtonBox;
0022 
0023 class KoDialogPrivate
0024 {
0025     Q_DECLARE_PUBLIC(KoDialog)
0026 protected:
0027     KoDialogPrivate()
0028         : mDetailsVisible(false), mSettingDetails(false), mDeferredDelete(false),
0029           mDetailsWidget(0),
0030           mTopLayout(0), mMainWidget(0), mUrlHelp(0), mActionSeparator(0),
0031           mButtonOrientation(Qt::Horizontal),
0032           mDefaultButton(KoDialog::NoDefault),
0033           mButtonBox(0)
0034     {
0035     }
0036 
0037     virtual ~KoDialogPrivate() {}
0038 
0039     KoDialog *q_ptr {nullptr};
0040 
0041     void setupLayout();
0042     void appendButton(KoDialog::ButtonCode code, const KGuiItem &item);
0043 
0044     bool mDetailsVisible {false};
0045     bool mSettingDetails {false};
0046     bool mDeferredDelete {false};
0047     QWidget *mDetailsWidget {nullptr};
0048     QSize mIncSize;
0049     QSize mMinSize;
0050     QString mDetailsButtonText;
0051 
0052     QBoxLayout *mTopLayout {nullptr};
0053     QPointer<QWidget> mMainWidget;
0054     KUrlLabel *mUrlHelp {nullptr};
0055     KSeparator *mActionSeparator {nullptr};
0056 
0057     QString mAnchor;
0058     QString mHelpApp;
0059     QString mHelpLinkText;
0060 
0061     Qt::Orientation mButtonOrientation;
0062     KoDialog::ButtonCode mDefaultButton {KoDialog::NoDefault};
0063     KoDialog::ButtonCode mEscapeButton {KoDialog::None};
0064 
0065     QDialogButtonBox *mButtonBox {nullptr};
0066     QHash<int, QPushButton *> mButtonList;
0067 
0068 protected Q_SLOTS:
0069     void queuedLayoutUpdate();
0070     void helpLinkClicked();
0071 
0072 private:
0073     void init(KoDialog *);
0074     bool dirty {false};
0075 };
0076 
0077 #endif // KDEUI_KDIALOG_P_H