File indexing completed on 2024-05-05 17:39:30
0001 /* 0002 * Copyright 2018 Michail Vourlakos <mvourlakos@gmail.com> 0003 * 0004 * This file is part of Latte-Dock 0005 * 0006 * Latte-Dock is free software; you can redistribute it and/or 0007 * modify it under the terms of the GNU General Public License as 0008 * published by the Free Software Foundation; either version 2 of 0009 * the License, or (at your option) any later version. 0010 * 0011 * Latte-Dock is distributed in the hope that it will be useful, 0012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0014 * GNU General Public License for more details. 0015 * 0016 * You should have received a copy of the GNU General Public License 0017 * along with this program. If not, see <http://www.gnu.org/licenses/>. 0018 */ 0019 0020 #ifndef MENU_H 0021 #define MENU_H 0022 0023 // Qt 0024 #include <QObject> 0025 0026 // Plasma 0027 #include <Plasma/ContainmentActions> 0028 0029 class QAction; 0030 class QMenu; 0031 0032 class Menu : public Plasma::ContainmentActions 0033 { 0034 Q_OBJECT 0035 0036 public: 0037 Menu(QObject *parent, const QVariantList &args); 0038 ~Menu() override; 0039 0040 QList<QAction *> contextualActions() override; 0041 0042 QAction *action(const QString &name); 0043 private Q_SLOTS: 0044 void makeActions(); 0045 void populateLayouts(); 0046 void requestConfiguration(); 0047 void switchToLayout(QAction *action); 0048 0049 0050 private: 0051 QStringList m_data; 0052 0053 QList<QAction *>m_actions; 0054 0055 QAction *m_separator1{nullptr}; 0056 0057 QAction *m_addWidgetsAction{nullptr}; 0058 QAction *m_configureAction{nullptr}; 0059 QAction *m_printAction{nullptr}; 0060 QAction *m_layoutsAction{nullptr}; 0061 0062 QMenu *m_switchLayoutsMenu{nullptr}; 0063 }; 0064 0065 #endif