File indexing completed on 2024-04-28 04:37:16

0001 /*
0002     SPDX-FileCopyrightText: 2009 Aleix Pol Gonzalez <aleixpol@kde.org>
0003     SPDX-FileCopyrightText: 2010 Benjamin Port <port.benjamin@gmail.com>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-only
0006 */
0007 
0008 #ifndef KDEVPLATFORM_DOCUMENTATIONCONTROLLER_H
0009 #define KDEVPLATFORM_DOCUMENTATIONCONTROLLER_H
0010 
0011 #include <interfaces/idocumentationcontroller.h>
0012 
0013 class DocumentationViewFactory;
0014 
0015 class QAction;
0016 
0017 namespace KDevelop
0018 {
0019 
0020 class Core;
0021 class Context;
0022 class ContextMenuExtension;
0023 
0024 class DocumentationController : public IDocumentationController
0025 {
0026     Q_OBJECT
0027 public:
0028     explicit DocumentationController(Core* core);
0029     ~DocumentationController() override;
0030 
0031     void initialize();
0032 
0033     QList<IDocumentationProvider*> documentationProviders() const override;
0034     IDocumentation::Ptr documentationForDeclaration(Declaration* declaration) override;
0035     IDocumentation::Ptr documentation(const QUrl& url) const override;
0036     void showDocumentation(const IDocumentation::Ptr& doc) override;
0037     ContextMenuExtension contextMenuExtension(Context* context, QWidget* parent);
0038 
0039 public Q_SLOTS:
0040     void changedDocumentationProviders() override;
0041 
0042 private Q_SLOTS:
0043     void doShowDocumentation();
0044 
0045 private:
0046     DocumentationViewFactory* m_factory;
0047     QAction* m_showDocumentation;
0048 };
0049 
0050 }
0051 
0052 #endif // KDEVPLATFORM_DOCUMENTATIONCONTROLLER_H