File indexing completed on 2024-06-23 05:13:54

0001 /* -*- mode: c++; c-basic-offset:4 -*-
0002     crypto/gui/wizardpage.cpp
0003 
0004     This file is part of Kleopatra, the KDE keymanager
0005     SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
0006 
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 
0010 #include <config-kleopatra.h>
0011 
0012 #include "wizardpage.h"
0013 
0014 #include <KGuiItem>
0015 
0016 using namespace Kleo::Crypto::Gui;
0017 
0018 class WizardPage::Private
0019 {
0020     friend class ::WizardPage;
0021     WizardPage *const q;
0022 
0023 public:
0024     explicit Private(WizardPage *qq);
0025     ~Private();
0026 
0027 private:
0028     bool commitPage = false;
0029     bool autoAdvance = false;
0030     QString title;
0031     QString subTitle;
0032     QString explanation;
0033     KGuiItem customNextButton;
0034 };
0035 
0036 WizardPage::Private::Private(WizardPage *qq)
0037     : q(qq)
0038 {
0039 }
0040 
0041 WizardPage::Private::~Private()
0042 {
0043 }
0044 
0045 WizardPage::WizardPage(QWidget *parent, Qt::WindowFlags f)
0046     : QWidget(parent, f)
0047     , d(new Private(this))
0048 {
0049 }
0050 
0051 bool WizardPage::isCommitPage() const
0052 {
0053     return d->commitPage;
0054 }
0055 
0056 void WizardPage::setCommitPage(bool commitPage)
0057 {
0058     d->commitPage = commitPage;
0059 }
0060 
0061 bool WizardPage::autoAdvance() const
0062 {
0063     return d->autoAdvance;
0064 }
0065 
0066 void WizardPage::setAutoAdvance(bool enabled)
0067 {
0068     if (d->autoAdvance == enabled) {
0069         return;
0070     }
0071     d->autoAdvance = enabled;
0072     Q_EMIT autoAdvanceChanged();
0073 }
0074 
0075 QString WizardPage::title() const
0076 {
0077     return d->title;
0078 }
0079 
0080 void WizardPage::setTitle(const QString &title)
0081 {
0082     if (d->title == title) {
0083         return;
0084     }
0085     d->title = title;
0086     Q_EMIT titleChanged();
0087 }
0088 
0089 QString WizardPage::subTitle() const
0090 {
0091     return d->subTitle;
0092 }
0093 
0094 void WizardPage::setSubTitle(const QString &subTitle)
0095 {
0096     if (d->subTitle == subTitle) {
0097         return;
0098     }
0099     d->subTitle = subTitle;
0100     Q_EMIT subTitleChanged();
0101 }
0102 
0103 QString WizardPage::explanation() const
0104 {
0105     return d->explanation;
0106 }
0107 
0108 void WizardPage::setExplanation(const QString &explanation)
0109 {
0110     if (d->explanation == explanation) {
0111         return;
0112     }
0113     d->explanation = explanation;
0114     Q_EMIT explanationChanged();
0115 }
0116 
0117 KGuiItem WizardPage::customNextButton() const
0118 {
0119     return d->customNextButton;
0120 }
0121 void WizardPage::setCustomNextButton(const KGuiItem &item)
0122 {
0123     d->customNextButton = item;
0124 }
0125 
0126 WizardPage::~WizardPage()
0127 {
0128 }
0129 
0130 void WizardPage::onNext()
0131 {
0132 }
0133 
0134 #include "moc_wizardpage.cpp"