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

source code of ktexteditor/src/mode/katemodemenu.h