2020-08-02 22:22:19 +00:00
|
|
|
/*
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
2017-01-11 09:21:03 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-FileCopyrightText: 2011 Lionel Chauvin <megabigbug@yahoo.fr>
|
|
|
|
SPDX-FileCopyrightText: 2011, 2012 Cédric Bellegarde <gnumdk@gmail.com>
|
|
|
|
SPDX-FileCopyrightText: 2013 Martin Gräßlin <mgraesslin@kde.org>
|
2017-01-11 09:21:03 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2022-12-16 20:08:44 +00:00
|
|
|
#pragma once
|
2017-01-11 09:21:03 +00:00
|
|
|
// Qt
|
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
class QPoint;
|
|
|
|
class OrgKdeKappmenuInterface;
|
|
|
|
class QDBusObjectPath;
|
2017-12-12 14:00:43 +00:00
|
|
|
class QDBusServiceWatcher;
|
2017-01-11 09:21:03 +00:00
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
2022-04-22 17:39:12 +00:00
|
|
|
class Window;
|
2017-01-11 09:21:03 +00:00
|
|
|
|
|
|
|
class ApplicationMenu : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2022-07-20 11:46:27 +00:00
|
|
|
explicit ApplicationMenu();
|
2017-01-11 09:21:03 +00:00
|
|
|
|
2022-04-22 17:39:12 +00:00
|
|
|
void showApplicationMenu(const QPoint &pos, Window *c, int actionId);
|
2017-01-11 09:21:03 +00:00
|
|
|
|
|
|
|
bool applicationMenuEnabled() const;
|
|
|
|
|
2017-12-12 14:00:43 +00:00
|
|
|
void setViewEnabled(bool enabled);
|
|
|
|
|
2021-06-08 07:02:14 +00:00
|
|
|
Q_SIGNALS:
|
2017-01-11 09:21:03 +00:00
|
|
|
void applicationMenuEnabledChanged(bool enabled);
|
|
|
|
|
|
|
|
private Q_SLOTS:
|
|
|
|
void slotShowRequest(const QString &serviceName, const QDBusObjectPath &menuObjectPath, int actionId);
|
|
|
|
void slotMenuShown(const QString &serviceName, const QDBusObjectPath &menuObjectPath);
|
|
|
|
void slotMenuHidden(const QString &serviceName, const QDBusObjectPath &menuObjectPath);
|
|
|
|
|
|
|
|
private:
|
|
|
|
OrgKdeKappmenuInterface *m_appmenuInterface;
|
2017-12-12 14:00:43 +00:00
|
|
|
QDBusServiceWatcher *m_kappMenuWatcher;
|
2017-01-11 09:21:03 +00:00
|
|
|
|
2022-04-28 07:44:11 +00:00
|
|
|
Window *findWindowWithApplicationMenu(const QString &serviceName, const QDBusObjectPath &menuObjectPath);
|
2017-01-11 09:21:03 +00:00
|
|
|
|
|
|
|
bool m_applicationMenuEnabled = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|