| 1 |
/* |
| 2 |
* Audacity: A Digital Audio Editor |
| 3 |
*/ |
| 4 |
#ifndef AU_PROJECTSCENE_PLAYBACKTOOLBARCUSTOMISEITEM_H |
| 5 |
#define AU_PROJECTSCENE_PLAYBACKTOOLBARCUSTOMISEITEM_H |
| 6 |
|
| 7 |
#include <QString> |
| 8 |
|
| 9 |
#include "ui/view/iconcodes.h" |
| 10 |
#include "uicomponents/view/selectableitemlistmodel.h" |
| 11 |
|
| 12 |
namespace au::playback { |
| 13 |
class PlaybackToolBarCustomiseItem : public muse::uicomponents::SelectableItemListModel::Item |
| 14 |
{ |
| 15 |
Q_OBJECT |
| 16 |
|
| 17 |
Q_PROPERTY(ItemType type READ type CONSTANT) |
| 18 |
Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged) |
| 19 |
Q_PROPERTY(int icon READ icon NOTIFY iconChanged) |
| 20 |
Q_PROPERTY(bool checked READ checked WRITE setChecked NOTIFY checkedChanged) |
| 21 |
|
| 22 |
public: |
| 23 |
enum ItemType { |
| 24 |
UNDEFINED = -1, |
| 25 |
ACTION, |
| 26 |
SEPARATOR |
| 27 |
}; |
| 28 |
Q_ENUM(ItemType) |
| 29 |
|
| 30 |
explicit PlaybackToolBarCustomiseItem(const ItemType& type, QObject* parent = nullptr); |
| 31 |
|
| 32 |
ItemType type() const; |
| 33 |
QString title() const; |
| 34 |
int icon() const; |
| 35 |
bool checked() const; |
| 36 |
|
| 37 |
Q_INVOKABLE QString id() const; |
| 38 |
void setId(const QString& id); |
| 39 |
|
| 40 |
public slots: |
| 41 |
void setTitle(QString title); |
| 42 |
void setIcon(muse::ui::IconCode::Code icon); |
| 43 |
void setChecked(bool checked); |
| 44 |
|
| 45 |
signals: |
| 46 |
void titleChanged(); |
| 47 |
void iconChanged(); |
| 48 |
void checkedChanged(bool checked); |
| 49 |
|
| 50 |
private: |
| 51 |
|
| 52 |
QString m_id; |
| 53 |
ItemType m_type = ItemType::UNDEFINED; |
| 54 |
QString m_title; |
| 55 |
muse::ui::IconCode::Code m_icon = muse::ui::IconCode::Code::NONE; |
| 56 |
bool m_checked = false; |
| 57 |
}; |
| 58 |
} |
| 59 |
|
| 60 |
#endif // AU_PROJECTSCENE_PLAYBACKTOOLBARCUSTOMISEITEM_H |