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

0001 /*
0002     SPDX-FileCopyrightText: 2009 Aleix Pol <aleixpol@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef KDEVPLATFORM_IDOCUMENTATIONPROVIDER_H
0008 #define KDEVPLATFORM_IDOCUMENTATIONPROVIDER_H
0009 
0010 #include "interfacesexport.h"
0011 #include "idocumentation.h"
0012 
0013 class QIcon;
0014 class QModelIndex;
0015 class QUrl;
0016 class QAbstractItemModel;
0017 namespace KDevelop
0018 {
0019 class Declaration;
0020 
0021 class KDEVPLATFORMINTERFACES_EXPORT IDocumentationProvider
0022 {
0023 public:
0024     virtual ~IDocumentationProvider();
0025     
0026     /** @returns an IDocument instance for the specified declaration or a null pointer if none could be found.*/
0027     virtual IDocumentation::Ptr documentationForDeclaration(KDevelop::Declaration* declaration) const = 0;
0028 
0029     /** @returns an IDocumentation instance for the specified URL if the provider has a concept of
0030      *  mapping URLS to Documentations and has a Documentation related to the queried URL. Otherwise
0031      *  returns a null pointer. */
0032     virtual IDocumentation::Ptr documentation(const QUrl& url) const = 0;
0033 
0034     /** @returns an instance of an interface to create an index for all the items provided by this class.
0035      *  Should have all items at the same level */
0036     virtual QAbstractItemModel* indexModel() const = 0;
0037 
0038     /** @returns the documentation information related to the index in the model. */
0039     virtual IDocumentation::Ptr documentationForIndex(const QModelIndex& idx) const = 0;
0040 
0041     /** @returns some icon associated to the provider. */
0042     virtual QIcon icon() const = 0;
0043 
0044     /** @returns a name to identify the provider to the user. */
0045     virtual QString name() const = 0;
0046 
0047     /** @returns a documentation item where we can show some home page information such a context index. */
0048     virtual IDocumentation::Ptr homePage() const = 0;
0049 };
0050 
0051 }
0052 
0053 Q_DECLARE_INTERFACE( KDevelop::IDocumentationProvider, "org.kdevelop.IDocumentationProvider")
0054 
0055 #endif
0056