1 /*
2    SPDX-FileCopyrightText: 2013-2021 Laurent Montel <montel@kde.org>
3 
4    SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include <QDialog>
10 
11 class QLineEdit;
12 class QPushButton;
13 class QListWidget;
14 
15 namespace MessageComposer
16 {
17 class ImageScalingSelectFormatDialog : public QDialog
18 {
19     Q_OBJECT
20 public:
21     explicit ImageScalingSelectFormatDialog(QWidget *parent);
22     ~ImageScalingSelectFormatDialog() override;
23 
24     void setFormat(const QString &format);
25     QString format() const;
26 
27 private:
28     enum { ImageRole = Qt::UserRole + 1 };
29     void initialize();
30     void addImageFormat(const QString &format, const QString &mimetype);
31     QListWidget *mListWidget = nullptr;
32 };
33 
34 class ImageScalingSelectFormat : public QWidget
35 {
36     Q_OBJECT
37 public:
38     explicit ImageScalingSelectFormat(QWidget *parent);
39     ~ImageScalingSelectFormat() override;
40 
41     void setFormat(const QString &format);
42     Q_REQUIRED_RESULT QString format() const;
43 
44 Q_SIGNALS:
45     void textChanged(const QString &);
46 
47 private Q_SLOTS:
48     void slotSelectFormat();
49 
50 private:
51     QLineEdit *mFormat = nullptr;
52     QPushButton *mSelectFormat = nullptr;
53 };
54 }
55 
56