1 | /* |
2 | This file is part of KNewStuffCore. |
3 | SPDX-FileCopyrightText: 2016 Dan Leinir Turthra Jensen <admin@leinir.dk> |
4 | |
5 | SPDX-License-Identifier: LGPL-2.1-or-later |
6 | */ |
7 | |
8 | #ifndef KNS3_QUESTIONLISTENER_H |
9 | #define KNS3_QUESTIONLISTENER_H |
10 | |
11 | #include <QObject> |
12 | |
13 | #include "knewstuffcore_export.h" |
14 | |
15 | namespace KNSCore |
16 | { |
17 | class Question; |
18 | /*! |
19 | * \class KNSCore::QuestionListener |
20 | * \inmodule KNewStuffCore |
21 | * |
22 | * \brief Implementation-side handler class for questions sent from KNewStuffCore. |
23 | * |
24 | * When implementing anything on top of KNewStuffCore, you will need to be able |
25 | * to react to questions asked from inside the framework. This is done by creating |
26 | * an instance of a QuestionListener, and reacting to any calls to the askQuestion |
27 | * slot, which you must extend and implement. Two examples of this exist, in the |
28 | * form of the KNS3::WidgetQuestionListener and KNewStuffQuick::QuickQuestionListener |
29 | * and should you need to create your own, take inspiration from them. |
30 | */ |
31 | class KNEWSTUFFCORE_EXPORT QuestionListener : public QObject |
32 | { |
33 | Q_OBJECT |
34 | public: |
35 | explicit QuestionListener(QObject *parent = nullptr); |
36 | ~QuestionListener() override; |
37 | |
38 | virtual void askQuestion(Question *question) = 0; |
39 | }; |
40 | } |
41 | |
42 | #endif // KNS3_QUESTIONLISTENER_H |
43 | |