#ifndef PQSTACKEDWIDGET
#define PQSTACKEDWIDGET

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

class PQStackedWidget;
class PQStackedWidget : public QStackedWidget {
    Q_OBJECT
    PQ_WIDGET_EX(QStackedWidget)

    Q_PROPERTY( int currentIndex READ currentIndex WRITE setCurrentIndex )
    Q_PROPERTY( QWidget *currentWidget READ currentWidget WRITE setCurrentWidget )
    Q_PROPERTY( int frameShape READ frameShape WRITE setFrameShape )
    Q_PROPERTY( int frameShadow READ frameShadow WRITE setFrameShadow )
    Q_PROPERTY( int lineWidth READ lineWidth WRITE setLineWidth )

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

    Q_INVOKABLE int addWidget(QWidget *w);
    Q_INVOKABLE int count();
    Q_INVOKABLE int currentIndex();
    Q_INVOKABLE QWidget *currentWidget();
    Q_INVOKABLE int indexOf(QWidget *w);
    Q_INVOKABLE int insertWidget(int index, QWidget *w);
    Q_INVOKABLE void removeWidget(QWidget *w);
    Q_INVOKABLE QWidget *widget(int index);
    Q_INVOKABLE void setFrameShape(int shape);
    Q_INVOKABLE int frameShape();
    Q_INVOKABLE void setFrameShadow(int shadow);
    Q_INVOKABLE int frameShadow();
    Q_INVOKABLE void setLineWidth(int width);
    Q_INVOKABLE int lineWidth();

public Q_SLOTS:
    Q_INVOKABLE void setCurrentIndex(int index);
    Q_INVOKABLE void setCurrentWidget(QWidget *w);

    void currentChanged_pslot(int index);
    void widgetRemoved_pslot(int index);

    PQ_ON_SIGNAL_DECL_START {
        PQ_ON_SIGNAL(currentChanged_pslot(int));
        PQ_ON_SIGNAL(widgetRemoved_pslot(int));
        PQWIDGET_ON_SIGNALS();
    } PQ_ON_SIGNAL_DECL_END

};

#endif // PQSTACKEDWIDGET

