#ifndef PEVIEWQT_H
#define PEVIEWQT_H

#include <QWidget>
#include <QTimer>

#include "VsMVOMacros.h"

class PEViewQtPrivate;

class PEViewQt : public QWidget
{
    Q_OBJECT
public:
    explicit PEViewQt(QWidget *parent = nullptr);
    ~PEViewQt();

    QPaintEngine *paintEngine() const override;

protected:
    void mousePressEvent(QMouseEvent *event) override;
    void mouseMoveEvent(QMouseEvent *event) override;
    void mouseReleaseEvent(QMouseEvent *event) override;
    void mouseDoubleClickEvent(QMouseEvent *event) override;
    void wheelEvent(QWheelEvent *event) override;
    void keyPressEvent(QKeyEvent *event) override;
    void keyReleaseEvent(QKeyEvent *event) override;
    void contextMenuEvent(QContextMenuEvent *evt) override;

private slots:
    void updateFrame();

private:
    UINT qtButtonToWin32Button(Qt::MouseButtons mbs);
    UINT qtButtonToWin32Button(Qt::MouseButton mb);

private:
    PEViewQtPrivate *mView;

    QTimer mTimer;
};

#endif
