pollymc/logic/screenshots/ScreenshotList.h

71 lines
1.2 KiB
C
Raw Normal View History

2014-02-24 02:44:24 +05:30
#pragma once
#include <QAbstractListModel>
#include "logic/BaseInstance.h"
#include "logic/tasks/Task.h"
2014-02-25 05:21:24 +05:30
#include "Screenshot.h"
2014-02-24 02:44:24 +05:30
class ScreenshotList : public QAbstractListModel
{
Q_OBJECT
public:
2014-03-30 23:41:05 +05:30
ScreenshotList(InstancePtr instance, QObject *parent = 0);
2014-02-24 02:44:24 +05:30
QVariant data(const QModelIndex &index, int role) const;
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
int rowCount(const QModelIndex &parent) const;
Qt::ItemFlags flags(const QModelIndex &index) const;
Task *load();
2014-02-25 05:21:24 +05:30
void loadShots(QList<ScreenshotPtr> shots)
2014-02-24 02:44:24 +05:30
{
m_screenshots = shots;
}
2014-02-25 05:21:24 +05:30
QList<ScreenshotPtr> screenshots() const
2014-02-24 02:44:24 +05:30
{
return m_screenshots;
}
2014-03-30 23:41:05 +05:30
InstancePtr instance() const
2014-02-24 02:44:24 +05:30
{
return m_instance;
}
2014-02-25 04:10:05 +05:30
void deleteSelected(class ScreenshotDialog *dialog);
2014-02-24 02:44:24 +05:30
signals:
public
slots:
private:
2014-02-25 05:21:24 +05:30
QList<ScreenshotPtr> m_screenshots;
2014-03-30 23:41:05 +05:30
InstancePtr m_instance;
2014-02-24 02:44:24 +05:30
};
class ScreenshotLoadTask : public Task
{
Q_OBJECT
public:
explicit ScreenshotLoadTask(ScreenshotList *list);
~ScreenshotLoadTask();
2014-02-25 05:21:24 +05:30
QList<ScreenshotPtr> screenShots() const
2014-02-24 02:44:24 +05:30
{
return m_results;
}
protected:
virtual void executeTask();
private:
ScreenshotList *m_list;
2014-02-25 05:21:24 +05:30
QList<ScreenshotPtr> m_results;
2014-02-24 02:44:24 +05:30
};