#ifndef PQTOOLBAR
#define PQTOOLBAR

#include "classes/pqwidget.h"
#include "classes/pqaction.h"
#include <QToolBar>

class PQToolBar;
class PQToolBar : public QToolBar {
    Q_OBJECT
    PQ_WIDGET_EX(QToolBar)

    Q_PROPERTY( int allowedAreas READ allowedAreas WRITE setAllowedAreas )
    Q_PROPERTY( bool floatable READ isFloatable WRITE setFloatable )
    Q_PROPERTY( bool floating READ isFloating )
    Q_PROPERTY( bool movable READ isMovable WRITE setMovable )
    Q_PROPERTY( int orientation READ orientation WRITE setOrientation )
    Q_PROPERTY( int toolButtonStyle READ toolButtonStyle WRITE setToolButtonStyle )

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

    Q_INVOKABLE void addSeparator();
    Q_INVOKABLE void addWidget(QWidget *widget);
    Q_INVOKABLE PQAction *addAction(const QString &title);
    Q_INVOKABLE PQAction *addAction(const QString &iconPath, const QString &title);
    Q_INVOKABLE PQAction *addAction(PQAction *action);
    Q_INVOKABLE void setAllowedAreas(int areas);
    Q_INVOKABLE int allowedAreas();
    Q_INVOKABLE bool isFloatable();
    Q_INVOKABLE bool isFloating();
    Q_INVOKABLE bool isMovable();
    Q_INVOKABLE void setIconSize(int w, int h);
    Q_INVOKABLE QSize iconSize();
    Q_INVOKABLE void setOrientation(int orientation);
    Q_INVOKABLE int orientation();
    Q_INVOKABLE void setToolButtonStyle(int style);
    Q_INVOKABLE int toolButtonStyle();

public Q_SLOTS:
    Q_INVOKABLE void setFloatable(bool floatable);
    Q_INVOKABLE void setMovable(bool movable);

    void actionTriggered_pslot(QAction * action);
    void allowedAreasChanged_pslot(int allowedAreas);
    void iconSizeChanged_pslot(const QSize &iconSize);
    void movableChanged_pslot(bool movable);
    void orientationChanged_pslot(int orientation);
    void toolButtonStyleChanged_pslot(int toolButtonStyle);
    void topLevelChanged_pslot(bool topLevel);
    void visibilityChanged_pslot(bool visible);

    PQ_ON_SIGNAL_DECL_START {
        PQ_ON_SIGNAL(actionTriggered_pslot(QAction*));
        PQ_ON_SIGNAL(allowedAreasChanged_pslot(int));
        PQ_ON_SIGNAL(iconSizeChanged_pslot(QSize));
        PQ_ON_SIGNAL(movableChanged_pslot(bool));
        PQ_ON_SIGNAL(orientationChanged_pslot(int));
        PQ_ON_SIGNAL(toolButtonStyleChanged_pslot(int));
        PQ_ON_SIGNAL(topLevelChanged_pslot(bool));
        PQ_ON_SIGNAL(visibilityChanged_pslot(bool));
        PQWIDGET_ON_SIGNALS();
    } PQ_ON_SIGNAL_DECL_END

};

#endif // PQTOOLBAR

