on a142f21 help sign in
unity8/plugins/Utils/unitymenumodelpaths.h
82 lines 2.7 kB history raw
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU 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 General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Author: Nick Dedekind <nick.dedekind@canonical.com>
17 */
19#ifndef UNITY_MENU_MODEL_PATHS_H
20#define UNITY_MENU_MODEL_PATHS_H
22#include <QVariant>
24class UnityMenuModelPaths : public QObject
26 Q_OBJECT
28 Q_PROPERTY(QVariant source READ source WRITE setSource NOTIFY sourceChanged)
29 Q_PROPERTY(QByteArray busName READ busName NOTIFY busNameChanged)
30 Q_PROPERTY(QVariantMap actions READ actions NOTIFY actionsChanged)
31 Q_PROPERTY(QByteArray menuObjectPath READ menuObjectPath NOTIFY menuObjectPathChanged)
33 Q_PROPERTY(QByteArray busNameHint READ busNameHint WRITE setBusNameHint NOTIFY busNameHintChanged)
34 Q_PROPERTY(QByteArray actionsHint READ actionsHint WRITE setActionsHint NOTIFY actionsHintChanged)
35 Q_PROPERTY(QByteArray menuObjectPathHint READ menuObjectPathHint WRITE setMenuObjectPathHint NOTIFY menuObjectPathHintChanged)
37public:
38 explicit UnityMenuModelPaths(QObject *parent = 0);
40 QVariant source() const;
41 void setSource(const QVariant& data);
43 QByteArray busName() const;
44 QVariantMap actions() const;
45 QByteArray menuObjectPath() const;
47 QByteArray busNameHint() const;
48 QByteArray actionsHint() const;
49 QByteArray menuObjectPathHint() const;
51Q_SIGNALS:
52 void sourceChanged();
53 void busNameChanged();
54 void actionsChanged();
55 void menuObjectPathChanged();
57 void busNameHintChanged();
58 void actionsHintChanged();
59 void menuObjectPathHintChanged();
61private:
62 void setBusName(const QByteArray &name);
63 void setActions(const QVariantMap& actions);
64 void setMenuObjectPath(const QByteArray &path);
66 void setBusNameHint(const QByteArray& nameHint);
67 void setActionsHint(const QByteArray &actionsHint);
68 void setMenuObjectPathHint(const QByteArray &pathHint);
70 void updateData();
72 QVariant m_sourceData;
73 QByteArray m_busName;
74 QVariantMap m_actions;
75 QByteArray m_menuObjectPath;
77 QByteArray m_busNameHint;
78 QByteArray m_actionsHint;
79 QByteArray m_menuObjectPathHint;
80};
82#endif // UNITY_MENU_MODEL_PATHS_H