2 * Copyright (C) 2016 Canonical, Ltd.
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.
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.
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/>.
17#ifndef APPLICATIONMENUREGISTRY_H
18#define APPLICATIONMENUREGISTRY_H
21#include <QDBusContext>
22#include <QDBusObjectPath>
25Q_DECLARE_LOGGING_CATEGORY(UNITY_APPMENU)
27class MenuServicePath : public QObject
30 Q_PROPERTY(QByteArray service MEMBER m_service CONSTANT)
31 Q_PROPERTY(QByteArray menuPath MEMBER m_menuPath CONSTANT)
32 Q_PROPERTY(QByteArray actionPath MEMBER m_actionPath CONSTANT)
34 explicit MenuServicePath(const QString &service,
35 const QDBusObjectPath &menuPath,
36 const QDBusObjectPath &actionPath)
37 : m_service(service.toUtf8())
38 , m_menuPath(menuPath.path().toUtf8())
39 , m_actionPath(actionPath.path().toUtf8())
42 const QByteArray m_service;
43 const QByteArray m_menuPath;
44 const QByteArray m_actionPath;
47class ApplicationMenuRegistry : public QObject
51 virtual ~ApplicationMenuRegistry();
54 Q_INVOKABLE QList<QObject*> getMenusForSurface(const QString &surfaceId) const;
57 void RegisterAppMenu(pid_t processId,
58 const QDBusObjectPath &menuObjectPath,
59 const QDBusObjectPath &actionObjectPath,
60 const QString &service);
61 void UnregisterAppMenu(pid_t processId, const QDBusObjectPath &menuObjectPath);
63 void RegisterSurfaceMenu(const QString &surfaceId,
64 const QDBusObjectPath &menuObjectPath,
65 const QDBusObjectPath &actionObjectPath,
66 const QString &service);
67 void UnregisterSurfaceMenu(const QString &surfaceId, const QDBusObjectPath &menuObjectPath);
70 void appMenuRegistered(uint processId);
71 void appMenuUnregistered(uint processId);
73 void surfaceMenuRegistered(const QString& surfaceId);
74 void surfaceMenuUnregistered(const QString& surfaceId);
77 explicit ApplicationMenuRegistry(QObject *parent = 0);
79 QMultiMap<pid_t, MenuServicePath*> m_appMenus;
80 QMultiMap<QString, MenuServicePath*> m_surfaceMenus;
83#endif // APPLICATIONMENUREGISTRY_H
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list