nheko/src/dialogs/PreviewUploadOverlay.h

52 lines
1.2 KiB
C
Raw Normal View History

2021-03-05 00:35:15 +01:00
// SPDX-FileCopyrightText: 2017 Konstantinos Sideris <siderisk@auth.gr>
// SPDX-FileCopyrightText: 2021 Nheko Contributors
//
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#include <QImage>
#include <QLabel>
#include <QLineEdit>
#include <QPixmap>
2018-09-25 13:41:47 +02:00
#include <QPushButton>
#include <QWidget>
class QMimeData;
namespace dialogs {
class PreviewUploadOverlay : public QWidget
{
Q_OBJECT
public:
PreviewUploadOverlay(QWidget *parent = nullptr);
void setPreview(const QImage &src, const QString &mime);
void setPreview(const QByteArray data, const QString &mime);
void setPreview(const QString &path);
signals:
void confirmUpload(const QByteArray data, const QString &media, const QString &filename);
2020-11-15 04:52:49 +01:00
void aborted();
private:
void init();
2018-02-19 21:09:21 +01:00
void setLabels(const QString &type, const QString &mime, uint64_t upload_size);
bool isImage_;
QPixmap image_;
QByteArray data_;
QString filePath_;
QString mediaType_;
QLabel titleLabel_;
QLabel infoLabel_;
QLineEdit fileName_;
2018-09-25 13:41:47 +02:00
QPushButton upload_;
QPushButton cancel_;
};
} // dialogs