KWin
Loading...
Searching...
No Matches
appmenu.h
Go to the documentation of this file.
1/*
2 KWin - the KDE window manager
3 This file is part of the KDE project.
4
5 SPDX-FileCopyrightText: 2011 Lionel Chauvin <megabigbug@yahoo.fr>
6 SPDX-FileCopyrightText: 2011, 2012 Cédric Bellegarde <gnumdk@gmail.com>
7 SPDX-FileCopyrightText: 2013 Martin Gräßlin <mgraesslin@kde.org>
8
9 SPDX-License-Identifier: GPL-2.0-or-later
10*/
11#pragma once
12// Qt
13#include <QObject>
14// xcb
15#include <xcb/xcb.h>
16
17class QPoint;
18class OrgKdeKappmenuInterface;
19class QDBusObjectPath;
20class QDBusServiceWatcher;
21
22namespace KWin
23{
24
25class Window;
26
27class ApplicationMenu : public QObject
28{
29 Q_OBJECT
30
31public:
32 explicit ApplicationMenu();
33
34 void showApplicationMenu(const QPoint &pos, Window *c, int actionId);
35
36 bool applicationMenuEnabled() const;
37
38 void setViewEnabled(bool enabled);
39
40Q_SIGNALS:
42
43private Q_SLOTS:
44 void slotShowRequest(const QString &serviceName, const QDBusObjectPath &menuObjectPath, int actionId);
45 void slotMenuShown(const QString &serviceName, const QDBusObjectPath &menuObjectPath);
46 void slotMenuHidden(const QString &serviceName, const QDBusObjectPath &menuObjectPath);
47
48private:
49 OrgKdeKappmenuInterface *m_appmenuInterface;
50 QDBusServiceWatcher *m_kappMenuWatcher;
51
52 Window *findWindowWithApplicationMenu(const QString &serviceName, const QDBusObjectPath &menuObjectPath);
53
54 bool m_applicationMenuEnabled = false;
55};
56
57}
void showApplicationMenu(const QPoint &pos, Window *c, int actionId)
Definition appmenu.cpp:93
void applicationMenuEnabledChanged(bool enabled)
void setViewEnabled(bool enabled)
Definition appmenu.cpp:54
bool applicationMenuEnabled() const
Definition appmenu.cpp:49