File indexing completed on 2024-05-12 05:12:50
0001 /* 0002 This file is part of Akregator. 0003 0004 SPDX-FileCopyrightText: 2005 Frank Osterfeld <osterfeld@kde.org> 0005 0006 SPDX-License-Identifier: GPL-2.0-or-later WITH Qt-Commercial-exception-1.0 0007 */ 0008 0009 #pragma once 0010 0011 #include <QObject> 0012 0013 #include "akregator_export.h" 0014 0015 class QAction; 0016 0017 class QWidget; 0018 0019 namespace WebEngineViewer 0020 { 0021 class ZoomActionMenu; 0022 } 0023 0024 namespace Akregator 0025 { 0026 /** 0027 * interface for accessing actions, popup menus etc. from 0028 * widgets. 0029 * (Extracted from the implementation to avoid dependencies 0030 * between widgets and Akregator::Part). 0031 */ 0032 class AKREGATOR_EXPORT ActionManager : public QObject 0033 { 0034 Q_OBJECT 0035 0036 public: 0037 static ActionManager *getInstance(); 0038 static void setInstance(ActionManager *manager); 0039 0040 explicit ActionManager(QObject *parent = nullptr); 0041 ~ActionManager() override; 0042 0043 virtual QAction *action(const QString &name) = 0; 0044 virtual QWidget *container(const QString &name) = 0; 0045 0046 virtual WebEngineViewer::ZoomActionMenu *zoomActionMenu() const = 0; 0047 0048 virtual void setArticleActionsEnabled(bool enabled) = 0; 0049 0050 private: 0051 static ActionManager *m_self; 0052 }; 0053 } // namespace Akregator