tageditor/gui/attachmentsedit.h

69 lines
1.4 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;
}
namespace QtGui {
class AttachmentsModel;
namespace Ui {
class AttachmentsEdit;
}
class AttachmentsEdit : public QWidget
{
Q_OBJECT
public:
2018-03-06 23:10:13 +01:00
explicit AttachmentsEdit(TagParser::MediaFileInfo *fileInfo, QWidget *parent = nullptr);
2015-04-22 19:33:53 +02:00
~AttachmentsEdit();
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
public slots:
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();
private slots:
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;
}
}
#endif // ATTACHMENTSEDIT_H