2016-10-14 22:27:28 +00:00
|
|
|
#ifndef VIEWERBASE_H
|
|
|
|
#define VIEWERBASE_H
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QStackedWidget>
|
|
|
|
#include <QToolBar>
|
|
|
|
#include <QComboBox>
|
|
|
|
|
|
|
|
#include "fileviewerinterface.h"
|
|
|
|
#include "genericfile.h"
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class ViewerBase;
|
|
|
|
}
|
|
|
|
|
|
|
|
class ViewerBase : public QMainWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit ViewerBase(QWidget *parent = 0);
|
|
|
|
~ViewerBase();
|
|
|
|
|
|
|
|
void setFile(GenericFile *file);
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void showViewer(QString descriptor);
|
2016-10-15 15:13:53 +00:00
|
|
|
|
2016-10-14 22:27:28 +00:00
|
|
|
protected:
|
|
|
|
void closeEvent(QCloseEvent *event);
|
|
|
|
void addViewer(QString descriptor, FileViewerInterface *viewer);
|
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::ViewerBase *ui;
|
|
|
|
QStackedWidget *m_stack;
|
|
|
|
QToolBar *m_toolbar;
|
|
|
|
QComboBox *m_viewercombo;
|
|
|
|
|
|
|
|
QMap<QString,FileViewerInterface *> m_viewers;
|
|
|
|
GenericFile *m_file;
|
2016-10-15 15:13:53 +00:00
|
|
|
QMenu *m_optionMenu;
|
2016-10-14 22:27:28 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // VIEWERBASE_H
|