#ifndef YMORPHEREWIDGET
#define YMORPHEREWIDGET
#include <QWidget>
#include <QMap>
#include <QString>
#include "yalgorithm.h"
#include <QTabWidget>
#include "widget.h"
#include <QWebView>
class QWebViewChild:public QWebView
{
    Q_OBJECT
public:
    QWebViewChild(QWidget *parent = 0):QWebView(parent)
    {

    }


protected:
    void closeEvent(QCloseEvent *event)
    {
        this->setHtml(QString());
        this->repaint();
    }

};


class YMorphereWidget : public QWidget
{
    Q_OBJECT
protected:

    QMap <QString, int> m_mapResult;
    YAlgorithm* m_pYAlgorithm;
    QTabWidget* m_pTabWidget;
    QString m_strName;

public:
    YMorphereWidget(QWidget *parent = 0);
    ~YMorphereWidget();
    void clearResult();
    virtual void clearViewResult() = 0;
    virtual void clearView() = 0;
    void clearParam();
    virtual void ViewResult() = 0;
    void Exec();
    void Exec(int nTitleBody);
    virtual QMap<QString, QString> convertToParam() = 0;
    virtual void SaveFile();
    virtual void SaveFileSimple();
    virtual void TestUpload();
    virtual void D3View();
    virtual void D3ViewTree();
    virtual void D3ViewFile();
    virtual void D3ViewTreeFile();
    void setTabWidget(QTabWidget* tabWidget);
    virtual void setParam(QString strJson);
    QString getName();
};

#endif // YMORPHEREWIDGET

