File indexing completed on 2024-11-24 04:16:56
0001 /* 0002 SPDX-FileCopyrightText: 2022-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include <QWidget> 0010 class QLineEdit; 0011 class QCheckBox; 0012 class LibreTranslateEngineConfigureWidget : public QWidget 0013 { 0014 Q_OBJECT 0015 public: 0016 explicit LibreTranslateEngineConfigureWidget(QWidget *parent = nullptr); 0017 ~LibreTranslateEngineConfigureWidget() override; 0018 0019 [[nodiscard]] QString serverUrl() const; 0020 void setServerUrl(const QString &serverUrl); 0021 0022 [[nodiscard]] QString apiKey() const; 0023 void setApiKey(const QString &key); 0024 0025 [[nodiscard]] bool serverRequiredApiKey() const; 0026 void setServerRequiredApiKey(bool state); 0027 0028 private: 0029 void updateApiKeyState(bool state); 0030 QLineEdit *const mServerUrl; 0031 QLineEdit *const mApiKey; 0032 QCheckBox *const mRequiredApiKey; 0033 };