File indexing completed on 2024-06-23 05:18:30
0001 /* 0002 SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include <QDialog> 0010 0011 class QLineEdit; 0012 class QPushButton; 0013 class QListWidget; 0014 0015 namespace MessageComposer 0016 { 0017 class ImageScalingSelectFormatDialog : public QDialog 0018 { 0019 Q_OBJECT 0020 public: 0021 explicit ImageScalingSelectFormatDialog(QWidget *parent); 0022 ~ImageScalingSelectFormatDialog() override; 0023 0024 void setFormat(const QString &format); 0025 QString format() const; 0026 0027 private: 0028 enum { ImageRole = Qt::UserRole + 1 }; 0029 void initialize(); 0030 void addImageFormat(const QString &format, const QString &mimetype); 0031 QListWidget *mListWidget = nullptr; 0032 }; 0033 0034 class ImageScalingSelectFormat : public QWidget 0035 { 0036 Q_OBJECT 0037 public: 0038 explicit ImageScalingSelectFormat(QWidget *parent); 0039 ~ImageScalingSelectFormat() override; 0040 0041 void setFormat(const QString &format); 0042 [[nodiscard]] QString format() const; 0043 0044 Q_SIGNALS: 0045 void textChanged(const QString &); 0046 0047 private Q_SLOTS: 0048 void slotSelectFormat(); 0049 0050 private: 0051 QLineEdit *mFormat = nullptr; 0052 QPushButton *mSelectFormat = nullptr; 0053 }; 0054 }