1/*
2 This file is part of the KDE project
3 SPDX-FileCopyrightText: 2006 Olivier Goffart <ogoffart@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#ifndef kmenumenuhandler_p_h
9#define kmenumenuhandler_p_h
10
11#include <QObject>
12
13class QAction;
14class QMenu;
15
16class KXMLGUIBuilder;
17class KSelectAction;
18
19namespace KDEPrivate
20{
21/**
22 * @internal
23 * This class handle the context menu of QMenu.
24 * Used by KXmlGuiBuilder
25 * @author Olivier Goffart <ogoffart@kde.org>
26 */
27class KMenuMenuHandler : public QObject
28{
29 Q_OBJECT
30public:
31 explicit KMenuMenuHandler(KXMLGUIBuilder *b);
32 ~KMenuMenuHandler() override
33 {
34 }
35 void insertMenu(QMenu *menu);
36 bool eventFilter(QObject *watched, QEvent *event) override;
37
38private Q_SLOTS:
39 void slotSetShortcut();
40 void buildToolbarAction();
41 void slotAddToToolBar(int);
42
43private:
44 void showContextMenu(QMenu *menu, const QPoint &pos);
45
46 KXMLGUIBuilder *m_builder = nullptr;
47 KSelectAction *m_toolbarAction = nullptr;
48 QMenu *m_popupMenu = nullptr;
49 QAction *m_popupAction = nullptr;
50 QMenu *m_contextMenu = nullptr;
51};
52
53} // END namespace KDEPrivate
54
55#endif
56

source code of kxmlgui/src/kmenumenuhandler_p.h