/
menu.h
63 lines (48 loc) · 1.29 KB
/
menu.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
SPDX-FileCopyrightText: 2018 Michail Vourlakos <mvourlakos@gmail.com>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef MENU_H
#define MENU_H
// Qt
#include <QObject>
// Plasma
#include <Plasma/ContainmentActions>
class QAction;
class QMenu;
struct LayoutInfo {
QString layoutName;
bool isBackgroundFileIcon;
QString iconName;
};
class Menu : public Plasma::ContainmentActions
{
Q_OBJECT
public:
Menu(QObject *parent, const QVariantList &args);
~Menu() override;
QList<QAction *> contextualActions() override;
void restore(const KConfigGroup &) override;
QAction *action(const QString &name);
private Q_SLOTS:
void populateLayouts();
void populateMoveToLayouts();
void populateViewTemplates();
void quitApplication();
void requestConfiguration();
void requestWidgetExplorer();
void updateVisibleActions();
void addView(QAction *action);
void moveToLayout(QAction *action);
void switchToLayout(QAction *action);
private:
QStringList m_data;
QStringList m_viewTemplates;
QStringList m_actionsAlwaysShown;
QStringList m_activeLayoutNames;
QHash<QString, QAction *> m_actions;
QMenu *m_addViewMenu{nullptr};
QMenu *m_switchLayoutsMenu{nullptr};
QMenu *m_moveToLayoutMenu{nullptr};
};
#endif