on master help sign in
unity8/plugins/Unity/Indicators/sharedunitymenumodel.h
66 lines 1.9 kB history raw
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 */
18#ifndef SHAREDUNITYMENUMODEL_H
19#define SHAREDUNITYMENUMODEL_H
21#include "unityindicatorsglobal.h"
23#include <QObject>
24#include <QSharedPointer>
25#include <QVariantMap>
27class UnityMenuModel;
29class UNITYINDICATORS_EXPORT SharedUnityMenuModel : public QObject
31 Q_OBJECT
32 Q_PROPERTY(QByteArray busName READ busName WRITE setBusName NOTIFY busNameChanged)
33 Q_PROPERTY(QByteArray menuObjectPath READ menuObjectPath WRITE setMenuObjectPath NOTIFY menuObjectPathChanged)
34 Q_PROPERTY(QVariantMap actions READ actions WRITE setActions NOTIFY actionsChanged)
35 Q_PROPERTY(UnityMenuModel* model READ model NOTIFY modelChanged)
37public:
38 SharedUnityMenuModel(QObject* parent = nullptr);
40 QByteArray busName() const;
41 void setBusName(const QByteArray&);
43 QByteArray menuObjectPath() const;
44 void setMenuObjectPath(const QByteArray&);
46 QVariantMap actions() const;
47 void setActions(const QVariantMap&);
49 UnityMenuModel* model() const;
51Q_SIGNALS:
52 void busNameChanged();
53 void menuObjectPathChanged();
54 void actionsChanged();
55 void modelChanged();
57private:
58 void initialize();
60 QByteArray m_busName;
61 QByteArray m_menuObjectPath;
62 QVariantMap m_actions;
63 QSharedPointer<UnityMenuModel> m_model;
64};
66#endif // SHAREDUNITYMENUMODEL_H