#ifndef PQSCROLLAREA
#define PQSCROLLAREA

#include <QScrollArea>
#include <QAbstractScrollArea>
#include "classes/pqwidget.h"

class PQScrollArea;
class PQScrollArea : public QScrollArea {
    Q_OBJECT
    PQ_WIDGET_EX(QScrollArea)

    Q_PROPERTY(int verticalScrollBarPolicy READ verticalScrollBarPolicy WRITE setVerticalScrollBarPolicy)
    Q_PROPERTY(int horizontalScrollBarPolicy READ horizontalScrollBarPolicy WRITE setHorizontalScrollBarPolicy)
    Q_PROPERTY(QWidget* viewport READ viewport WRITE setViewport)
    Q_PROPERTY(QWidget* widget READ widget WRITE setWidget)

public:
    Q_INVOKABLE explicit PQScrollArea(QWidget * parent=0);
    virtual ~PQScrollArea();

    Q_INVOKABLE int verticalScrollBarPolicy();
    Q_INVOKABLE int horizontalScrollBarPolicy();
    Q_INVOKABLE void setVerticalScrollBarPolicy(int policy);
    Q_INVOKABLE void setHorizontalScrollBarPolicy(int policy);
    Q_INVOKABLE void setHorizontalScrollBar(QScrollBar *scrollBar);
    Q_INVOKABLE void setVerticalScrollBar(QScrollBar *scrollBar);
    Q_INVOKABLE void setWidget(QWidget *widget);
    Q_INVOKABLE void setViewport(QWidget *widget);
    Q_INVOKABLE void setBaseSize(int w, int h);
    Q_INVOKABLE void setSizeAdjustPolicy(int policy);
    Q_INVOKABLE QWidget *viewport();
    Q_INVOKABLE QWidget *widget();

    PQ_ON_SIGNAL_DECL_START {
        PQWIDGET_ON_SIGNALS();
    } PQ_ON_SIGNAL_DECL_END

public Q_SLOTS:
    Q_INVOKABLE void setWidgetResizable(bool b);
};

#endif // PQSCROLLAREA

