File indexing completed on 2025-01-19 04:46:53

0001 /*
0002    SPDX-FileCopyrightText: 2022-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 #pragma once
0007 
0008 #include "openurlwith_private_export.h"
0009 #include <QWidget>
0010 class QLineEdit;
0011 class KUrlRequester;
0012 class LIBOPENURLWITHCONFIGURE_TESTS_EXPORT OpenUrlWithConfigureCreateWidget : public QWidget
0013 {
0014     Q_OBJECT
0015 public:
0016     struct OpenUrlWithInfo {
0017         QString command;
0018         QString commandLines;
0019         QString url;
0020         [[nodiscard]] bool isValid() const;
0021     };
0022 
0023     explicit OpenUrlWithConfigureCreateWidget(QWidget *parent = nullptr);
0024     ~OpenUrlWithConfigureCreateWidget() override;
0025 
0026     [[nodiscard]] OpenUrlWithInfo info() const;
0027     void setInfo(const OpenUrlWithInfo &i);
0028 Q_SIGNALS:
0029     void updateOkButton(bool enabled);
0030 
0031 private:
0032     void slotLinkClicked(const QString &link);
0033     void slotInfoChanged();
0034     QString mCommandWhatsThis;
0035     QLineEdit *const mServerName;
0036     QLineEdit *const mCommandLine;
0037     KUrlRequester *const mExecutable;
0038 };