20 #ifndef ROOTACTIONSTATE_H
21 #define ROOTACTIONSTATE_H
23 #include "unityindicatorsglobal.h"
25 #include <actionstateparser.h>
29 class UNITYINDICATORS_EXPORT RootActionState :
public ActionStateParser
32 Q_PROPERTY(UnityMenuModel* menu READ menu WRITE setMenu NOTIFY menuChanged)
34 Q_PROPERTY(
bool valid READ isValid NOTIFY validChanged)
35 Q_PROPERTY(QString title READ title NOTIFY titleChanged)
36 Q_PROPERTY(QString leftLabel READ leftLabel NOTIFY leftLabelChanged)
37 Q_PROPERTY(QString rightLabel READ rightLabel NOTIFY rightLabelChanged)
38 Q_PROPERTY(QStringList icons READ icons NOTIFY iconsChanged)
39 Q_PROPERTY(QString accessibleName READ accessibleName NOTIFY accessibleNameChanged)
40 Q_PROPERTY(
bool indicatorVisible READ indicatorVisible NOTIFY indicatorVisibleChanged)
42 RootActionState(QObject *parent = 0);
43 virtual ~RootActionState();
45 UnityMenuModel* menu()
const;
46 void setMenu(UnityMenuModel* menu);
49 void setIndex(
int index);
52 QString title()
const;
53 QString leftLabel()
const;
54 QString rightLabel()
const;
55 QStringList icons()
const;
56 QString accessibleName()
const;
57 bool indicatorVisible()
const;
60 virtual QVariant toQVariant(GVariant* state)
const override;
70 void leftLabelChanged();
71 void rightLabelChanged();
73 void accessibleNameChanged();
74 void indicatorVisibleChanged();
77 void onModelRowsAdded(
const QModelIndex& parent,
int start,
int end);
78 void onModelRowsRemoved(
const QModelIndex& parent,
int start,
int end);
79 void onModelDataChanged(
const QModelIndex& topLeft,
const QModelIndex& bottomRight,
const QVector<int>&);
83 void updateActionState();
85 UnityMenuModel* m_menu;
86 QVariantMap m_cachedState;
89 #endif // ROOTACTIONSTATE_H