File indexing completed on 2024-04-28 04:36:29

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_IDOCUMENTATIONCONTROLLER_H
0009 #define KDEVPLATFORM_IDOCUMENTATIONCONTROLLER_H
0010 
0011 #include <interfaces/idocumentation.h>
0012 #include <QObject>
0013 
0014 class QUrl;
0015 
0016 namespace KDevelop {
0017 class IDocumentationProvider;
0018 class Declaration;
0019 
0020 /**
0021  * Allows to access the documentation.
0022  *
0023  * @author Aleix Pol <aleixpol@kde.org>
0024  */
0025 class KDEVPLATFORMINTERFACES_EXPORT IDocumentationController: public QObject
0026 {
0027     Q_OBJECT
0028 public:
0029     IDocumentationController();
0030     ~IDocumentationController() override;
0031 
0032     /** Return the documentation provider plugin instances. */
0033     virtual QList<IDocumentationProvider*> documentationProviders() const = 0;
0034 
0035     /** Return the corresponding documentation instance for a determinate declaration. */
0036     virtual IDocumentation::Ptr documentationForDeclaration(Declaration* declaration) = 0;
0037     /** Returns a corresponding documentation if a provider has one for the given URL*/
0038     virtual IDocumentation::Ptr documentation(const QUrl& url) const = 0;
0039 public Q_SLOTS:
0040     /** Show the documentation specified by @p doc. */
0041     virtual void showDocumentation(const IDocumentation::Ptr& doc) = 0;
0042 
0043     /** Emit signal when the documentation providers list changed. */
0044     virtual void changedDocumentationProviders() = 0;
0045 
0046 Q_SIGNALS:
0047     /** Emitted when providers list changed */
0048     void providersChanged();
0049 };
0050 
0051 }
0052 
0053 #endif