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

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_IDOCUMENTATION_H
0008 #define KDEVPLATFORM_IDOCUMENTATION_H
0009 
0010 #include <QString>
0011 #include <QExplicitlySharedDataPointer>
0012 #include "interfacesexport.h"
0013 #include <util/ksharedobject.h>
0014 
0015 class QWidget;
0016 
0017 namespace KDevelop
0018 {
0019 
0020 class DocumentationFindWidget;
0021 class IDocumentationProvider;
0022 
0023 class KDEVPLATFORMINTERFACES_EXPORT IDocumentation : public QObject, public KSharedObject
0024 {
0025     Q_OBJECT
0026     Q_PROPERTY(QString name READ name CONSTANT)
0027     Q_PROPERTY(QString description READ description NOTIFY descriptionChanged)
0028     Q_PROPERTY(IDocumentationProvider* provider READ provider CONSTANT)
0029 public:
0030     using Ptr = QExplicitlySharedDataPointer<IDocumentation>;
0031     IDocumentation();
0032 
0033     ~IDocumentation() override;
0034 
0035     /** @returns the name of the documented information*/
0036     virtual QString name() const = 0;
0037 
0038     /** @returns a HTML-formatted short description. */
0039     virtual QString description() const = 0;
0040 
0041     /** @returns a widget with all the needed documentation information.
0042         @param parent defines the widget's parent
0043         @param findWidget can be used to tell how do we want to deal with Search
0044             inside the documentation widget. The implementation will have to enable the
0045             widget if it means to support the search feature.
0046     */
0047     virtual QWidget* documentationWidget(DocumentationFindWidget* findWidget, QWidget* parent = nullptr) = 0;
0048 
0049     virtual IDocumentationProvider* provider() const = 0;
0050 
0051 Q_SIGNALS:
0052     void descriptionChanged();
0053 };
0054 
0055 }
0056 
0057 Q_DECLARE_METATYPE(KDevelop::IDocumentation::Ptr)
0058 
0059 #endif