KNewStuff

providercore.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2// SPDX-FileCopyrightText: 2009 Jeremy Whiting <jpwhiting@kde.org>
3// SPDX-FileCopyrightText: 2009 Frederik Gladhorn <gladhorn@kde.org>
4// SPDX-FileCopyrightText: 2021 Dan Leinir Turthra Jensen <admin@leinir.dk>
5// SPDX-FileCopyrightText: 2024 Harald Sitter <sitter@kde.org>
6
7#pragma once
8
9#include <QObject>
10
11#include "knewstuffcore_export.h"
12
13class Engine;
14
15namespace KNSCore
16{
17
18class ProviderBase;
19
20/**
21 * @short KNewStuff Base Provider class.
22 *
23 * This class provides accessors for the provider object.
24 * It should not be used directly by the application.
25 * This class is the base class and will be instantiated for
26 * static website providers.
27 *
28 * @author Jeremy Whiting <jpwhiting@kde.org>
29 * @since 6.9
30 */
31class KNEWSTUFFCORE_EXPORT ProviderCore : public QObject
32{
33 Q_OBJECT
34 Q_PROPERTY(QString version READ version NOTIFY basicsLoaded)
35 Q_PROPERTY(QUrl website READ website NOTIFY basicsLoaded)
36 Q_PROPERTY(QUrl host READ host NOTIFY basicsLoaded)
37 Q_PROPERTY(QString contactEmail READ contactEmail NOTIFY basicsLoaded)
38 Q_PROPERTY(bool supportsSsl READ supportsSsl NOTIFY basicsLoaded)
39public:
40 ~ProviderCore() override;
41 Q_DISABLE_COPY_MOVE(ProviderCore)
42
43 [[nodiscard]] QString version() const;
44 [[nodiscard]] QUrl website() const;
45 [[nodiscard]] QUrl host() const;
46 /**
47 * The general contact email for this provider
48 * @return The general contact email for this provider
49 */
50 [[nodiscard]] QString contactEmail() const;
51 /**
52 * Whether or not the provider supports SSL connections
53 * @return True if the server supports SSL connections, false if not
54 */
55 [[nodiscard]] bool supportsSsl() const;
56
57Q_SIGNALS:
58 void basicsLoaded();
59
60private:
61 friend class EngineBase;
62 friend class EngineBasePrivate;
63 friend class ResultsStream;
64 friend class ProviderBubbleWrap;
65 friend class Transaction;
66 friend class TransactionPrivate;
67 friend class ::Engine; // quick engine
68 ProviderCore(ProviderBase *base, QObject *parent = nullptr);
69 const std::unique_ptr<class ProviderCorePrivate> d;
70};
71
72} // namespace KNSCore
KNSCore::EngineBase for interfacing with QML.
Definition quickengine.h:29
KNewStuff engine.
Definition enginebase.h:56
KNewStuff Base Provider class.
The ResultsStream is returned by EngineBase::search.
KNewStuff Transaction.
Definition transaction.h:38
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:20:03 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.