2#include "qml_material/style/common_state.hpp"
3#include "qml_material/token/type_scale.hpp"
4Q_MOC_INCLUDE(
"qml_material/control/tool_bar.hpp")
8class QML_MATERIAL_API AppBarState :
public CommonState {
10 QML_NAMED_ELEMENT(StateAppBar)
11 Q_PROPERTY(qml_material::ToolBar* item READ item WRITE setItem NOTIFY itemChanged FINAL)
12 Q_PROPERTY(
int type READ type WRITE setType NOTIFY typeChanged BINDABLE bindableType)
13 Q_PROPERTY(
bool showBackground READ showBackground WRITE setShowBackground NOTIFY
14 showBackgroundChanged BINDABLE bindableShowBackground)
16 resetTypescale NOTIFY typescaleChanged BINDABLE bindableTypescale)
18 int containerHeight READ containerHeight WRITE setContainerHeight RESET resetContainerHeight
19 NOTIFY containerHeightChanged BINDABLE bindableContainerHeight)
21 explicit AppBarState(QObject* parent =
nullptr);
22 ~AppBarState()
override;
23 ToolBar* item()
const;
24 void setItem(ToolBar*);
25 Q_SIGNAL
void itemChanged();
28 QBindable<int> bindableType();
29 Q_SIGNAL
void typeChanged();
30 bool showBackground()
const;
31 void setShowBackground(
bool);
32 QBindable<bool> bindableShowBackground();
33 Q_SIGNAL
void showBackgroundChanged();
34 token::TypeScaleItem typescale()
const;
35 void setTypescale(
const token::TypeScaleItem&);
36 QBindable<token::TypeScaleItem> bindableTypescale();
37 void resetTypescale();
38 Q_SIGNAL
void typescaleChanged();
39 int containerHeight()
const;
40 void setContainerHeight(
int);
41 QBindable<int> bindableContainerHeight();
42 void resetContainerHeight();
43 Q_SIGNAL
void containerHeightChanged();
46 enum class Specification
54 Specification state = Specification::Base;
55 quint64 generation = 0;
56 bool operator==(
const Selection&)
const =
default;
58 void selectionChanged();
59 StateBindingSet<Specification> m_bindings { Specification::Base };
60 QProperty<ToolBar*> m_item {
nullptr };
61 QMetaObject::Connection m_destroyed;
63 Q_OBJECT_BINDABLE_PROPERTY(AppBarState, Selection, m_selection, &AppBarState::selectionChanged)
64 Q_OBJECT_BINDABLE_PROPERTY_WITH_ARGS(AppBarState,
int, m_type,
65 int(Enum::AppBarType::AppBarCenterAligned),
66 &AppBarState::typeChanged)
67 Q_OBJECT_BINDABLE_PROPERTY_WITH_ARGS(AppBarState,
bool, m_showBackground,
false,
68 &AppBarState::showBackgroundChanged)
69 Q_OBJECT_BINDABLE_PROPERTY(AppBarState, token::TypeScaleItem, m_typescale,
70 &AppBarState::typescaleChanged)
71 Q_OBJECT_BINDABLE_PROPERTY(AppBarState,
int, m_containerHeight,
72 &AppBarState::containerHeightChanged)
73 PropertyKey<token::TypeScaleItem> m_typescaleKey;
74 PropertyKey<int> m_heightKey;
75 StateBindingSet<Specification>::Lifetime m_lifetime { m_bindings.lifetime() };
TypeScaleItem.
Definition type_scale.hpp:36