Lomiri
Loading...
Searching...
No Matches
sharedlomirimenumodel.h
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 */
17
18#ifndef SHAREDLOMIRIMENUMODEL_H
19#define SHAREDLOMIRIMENUMODEL_H
20
21#include "lomiriindicatorsglobal.h"
22
23#include <QObject>
24#include <QSharedPointer>
25#include <QVariantMap>
26
27class AyatanaMenuModel;
28
29class LOMIRIINDICATORS_EXPORT SharedLomiriMenuModel : public QObject
30{
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(AyatanaMenuModel* model READ model NOTIFY modelChanged)
36
37public:
38 SharedLomiriMenuModel(QObject* parent = nullptr);
39
40 QByteArray busName() const;
41 void setBusName(const QByteArray&);
42
43 QByteArray menuObjectPath() const;
44 void setMenuObjectPath(const QByteArray&);
45
46 QVariantMap actions() const;
47 void setActions(const QVariantMap&);
48
49 AyatanaMenuModel* model() const;
50
51Q_SIGNALS:
52 void busNameChanged();
53 void menuObjectPathChanged();
54 void actionsChanged();
55 void modelChanged();
56
57private:
58 void initialize();
59
60 QByteArray m_busName;
61 QByteArray m_menuObjectPath;
62 QVariantMap m_actions;
63 QSharedPointer<AyatanaMenuModel> m_model;
64};
65
66#endif // SHAREDLOMIRIMENUMODEL_H