tageditor/gui/attachmentsedit.h

68 lines
1.5 KiB
C
Raw Normal View History

2015-04-22 19:33:53 +02:00
#ifndef ATTACHMENTSEDIT_H
#define ATTACHMENTSEDIT_H
#include <QWidget>
#include <memory>
2018-03-06 23:10:13 +01:00
namespace TagParser {
2015-04-22 19:33:53 +02:00
class MediaFileInfo;
class AbstractAttachment;
2018-03-07 01:18:01 +01:00
} // namespace TagParser
2015-04-22 19:33:53 +02:00
namespace QtGui {
class AttachmentsModel;
namespace Ui {
class AttachmentsEdit;
}
2018-03-07 01:18:01 +01:00
class AttachmentsEdit : public QWidget {
2015-04-22 19:33:53 +02:00
Q_OBJECT
public:
2018-03-06 23:10:13 +01:00
explicit AttachmentsEdit(TagParser::MediaFileInfo *fileInfo, QWidget *parent = nullptr);
2019-06-01 12:45:12 +02:00
~AttachmentsEdit() override;
2015-04-22 19:33:53 +02:00
2018-03-06 23:10:13 +01:00
TagParser::MediaFileInfo *fileInfo();
void setFileInfo(TagParser::MediaFileInfo *fileInfo, bool updateUi = true);
const QList<TagParser::AbstractAttachment *> &currentAttachments() const;
2015-04-22 19:33:53 +02:00
2020-03-08 14:04:29 +01:00
public Q_SLOTS:
2015-04-22 19:33:53 +02:00
void clear();
void restore();
void apply();
void invalidate();
void addFile(const QString &path);
2015-04-22 19:33:53 +02:00
void showFileSelection();
void extractSelected();
2020-03-08 14:04:29 +01:00
private Q_SLOTS:
2015-04-22 19:33:53 +02:00
void selectionChanged(const QModelIndex &current, const QModelIndex &previous);
private:
void setupUi();
std::unique_ptr<Ui::AttachmentsEdit> m_ui;
2018-03-06 23:10:13 +01:00
TagParser::MediaFileInfo *m_fileInfo;
QList<TagParser::AbstractAttachment *> m_currentAttachments;
QList<TagParser::AbstractAttachment *> m_addedAttachments;
2015-04-22 19:33:53 +02:00
AttachmentsModel *m_model;
};
2018-03-06 23:10:13 +01:00
inline TagParser::MediaFileInfo *AttachmentsEdit::fileInfo()
2015-04-22 19:33:53 +02:00
{
return m_fileInfo;
}
2018-03-06 23:10:13 +01:00
inline const QList<TagParser::AbstractAttachment *> &AttachmentsEdit::currentAttachments() const
2015-04-22 19:33:53 +02:00
{
return m_currentAttachments;
}
2018-03-07 01:18:01 +01:00
} // namespace QtGui
2015-04-22 19:33:53 +02:00
#endif // ATTACHMENTSEDIT_H