File indexing completed on 2024-04-28 15:28:58
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_QUESTIONMANAGER_H 0009 #define KNS3_QUESTIONMANAGER_H 0010 0011 #include <QObject> 0012 0013 #include "knewstuffcore_export.h" 0014 0015 #include "question.h" 0016 0017 namespace KNSCore 0018 { 0019 class QuestionManagerPrivate; 0020 /** 0021 * @short The central class handling Question redirection 0022 * 0023 * This class is used to ensure that KNSCore::Question instances get redirected 0024 * to the appropriate KNSCore::QuestionListener instances. It is a very dumb class 0025 * which only ensures the listeners have somewhere to listen to, and the 0026 * questions have somewhere to ask to be asked. 0027 */ 0028 class KNEWSTUFFCORE_EXPORT QuestionManager : public QObject 0029 { 0030 Q_OBJECT 0031 Q_DISABLE_COPY(QuestionManager) 0032 public: 0033 static QuestionManager *instance(); 0034 ~QuestionManager() override; 0035 0036 Q_SIGNALS: 0037 void askQuestion(KNSCore::Question *question); 0038 0039 private: 0040 QuestionManager(); 0041 const std::unique_ptr<QuestionManagerPrivate> d; 0042 }; 0043 } 0044 0045 #endif // KNS3_QUESTIONMANAGER_H