1/*
2 SPDX-FileCopyrightText: 2001-2003 Christoph Cullmann <cullmann@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#ifndef KATE_HIGHLIGHTMENU_H
8#define KATE_HIGHLIGHTMENU_H
9
10#include <QPointer>
11
12#include <KActionMenu>
13
14#include <vector>
15
16namespace KTextEditor
17{
18class DocumentPrivate;
19}
20
21class KateHighlightingMenu : public KActionMenu
22{
23 Q_OBJECT
24
25public:
26 KateHighlightingMenu(const QString &text, QObject *parent)
27 : KActionMenu(text, parent)
28 {
29 init();
30 setPopupMode(QToolButton::InstantPopup);
31 }
32
33 void updateMenu(KTextEditor::DocumentPrivate *doc);
34
35private:
36 void init();
37
38 QPointer<KTextEditor::DocumentPrivate> m_doc;
39 std::vector<QString> subMenusName;
40 std::vector<QString> names;
41 std::vector<QMenu *> subMenus;
42 std::vector<QAction *> subActions;
43 QActionGroup *m_actionGroup;
44
45public Q_SLOTS:
46 void slotAboutToShow();
47
48private Q_SLOTS:
49 void setHl();
50};
51
52#endif
53

source code of ktexteditor/src/syntax/katehighlightmenu.h