#ifndef PQSCROLLBAR
#define PQSCROLLBAR

#include <QScrollBar>
#include "classes/pqwidget.h"

class PQScrollBar;
class PQScrollBar : public QScrollBar {
    Q_OBJECT
    PQ_WIDGET_EX(QScrollBar)

    Q_PROPERTY(int value READ value WRITE setValue)
    Q_PROPERTY(int singleStep READ singleStep WRITE setSingleStep)
    Q_PROPERTY(int pageStep READ pageStep WRITE setPageStep)

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

    Q_INVOKABLE int value();
    Q_INVOKABLE int singleStep();
    Q_INVOKABLE int pageStep();

public Q_SLOTS:
    Q_INVOKABLE void setRange(int min, int max);
    Q_INVOKABLE void setValue(int value);
    Q_INVOKABLE void setSingleStep(int singleStep);
    Q_INVOKABLE void setPageStep(int pageStep);

    void actionTriggered_pslot(int action);
    void rangeChanged_pslot(int min, int max);
    void sliderMoved_pslot(int value);
    void sliderPressed_pslot();
    void sliderReleased_pslot();
    void valueChanged_pslot(int value);

    PQ_ON_SIGNAL_DECL_START {
        PQ_ON_SIGNAL(actionTriggered_pslot(int));
        PQ_ON_SIGNAL(rangeChanged_pslot(int,int));
        PQ_ON_SIGNAL(sliderMoved_pslot(int));
        PQ_ON_SIGNAL(sliderPressed_pslot());
        PQ_ON_SIGNAL(sliderReleased_pslot());
        PQ_ON_SIGNAL(valueChanged_pslot(int));
        PQWIDGET_ON_SIGNALS();
    } PQ_ON_SIGNAL_DECL_END

};
#endif // PQSCROLLBAR

