File indexing completed on 2024-03-24 03:59:14
0001 /* 0002 This file is part of KNewStuffCore. 0003 SPDX-FileCopyrightText: 2016 Dan Leinir Turthra Jensen <admin@leinir.dk> 0004 0005 SPDX-License-Identifier: LGPL-2.1-or-later 0006 */ 0007 0008 #ifndef KNS3_QUESTIONLISTENER_H 0009 #define KNS3_QUESTIONLISTENER_H 0010 0011 #include <QObject> 0012 0013 #include "knewstuffcore_export.h" 0014 0015 namespace KNSCore 0016 { 0017 class Question; 0018 /** 0019 * @short Implementation-side handler class for questions sent from KNewStuffCore 0020 * 0021 * When implementing anything on top of KNewStuffCore, you will need to be able 0022 * to react to questions asked from inside the framework. This is done by creating 0023 * an instance of a QuestionListener, and reacting to any calls to the askQuestion 0024 * slot, which you must extend and implement. Two examples of this exist, in the 0025 * form of the KNS3::WidgetQuestionListener and KNewStuffQuick::QuickQuestionListener 0026 * and should you need to create your own, take inspiration from them. 0027 */ 0028 class KNEWSTUFFCORE_EXPORT QuestionListener : public QObject 0029 { 0030 Q_OBJECT 0031 public: 0032 explicit QuestionListener(QObject *parent = nullptr); 0033 ~QuestionListener() override; 0034 0035 virtual void askQuestion(Question *question) = 0; 0036 }; 0037 } 0038 0039 #endif // KNS3_QUESTIONLISTENER_H