File indexing completed on 2024-04-21 04:58:02
0001 /* 0002 SPDX-FileCopyrightText: 2001 Dawit Alemayehu <adawit@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #ifndef __UACHANGER_PLUGIN_H 0008 #define __UACHANGER_PLUGIN_H 0009 0010 #include <QMap> 0011 #include <QStringList> 0012 #include <QUrl> 0013 0014 #include <konq_kpart_plugin.h> 0015 #include <kparts/readonlypart.h> 0016 0017 class KActionMenu; 0018 class QAction; 0019 class QActionGroup; 0020 class KConfig; 0021 0022 namespace KIO 0023 { 0024 } 0025 0026 class UAChangerPlugin : public KonqParts::Plugin 0027 { 0028 Q_OBJECT 0029 0030 public: 0031 UAChangerPlugin(QObject* parent, const QVariantList&); 0032 ~UAChangerPlugin() override; 0033 0034 protected slots: 0035 void slotAboutToShow(); 0036 void slotItemSelected(QAction *); 0037 0038 private: 0039 using TemplateMap = QMap<QString, QString>; 0040 0041 void initMenu(); 0042 QList<QAction*> fillMenu(const TemplateMap &templates); 0043 void clearMenu(); 0044 0045 KParts::ReadOnlyPart *m_part; 0046 KActionMenu *m_pUAMenu; 0047 QAction *m_defaultAction; 0048 QActionGroup *m_actionGroup; 0049 }; 0050 0051 #endif