Changeset View
Changeset View
Standalone View
Standalone View
src/core/questionlistener.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | This file is part of KNewStuffCore. | ||||
3 | | ||||
4 | Copyright (c) 2016 Dan Leinir Turthra Jensen <admin@leinir.dk> | ||||
5 | | ||||
6 | This library is free software; you can redistribute it and/or | ||||
7 | modify it under the terms of the GNU Lesser General Public | ||||
8 | License as published by the Free Software Foundation; either | ||||
9 | version 2.1 of the License, or (at your option) any later version. | ||||
10 | | ||||
11 | This library is distributed in the hope that it will be useful, | ||||
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||
14 | Lesser General Public License for more details. | ||||
15 | | ||||
16 | You should have received a copy of the GNU Lesser General Public | ||||
17 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||||
18 | */ | ||||
19 | | ||||
20 | #ifndef KNS3_QUESTIONLISTENER_H | ||||
21 | #define KNS3_QUESTIONLISTENER_H | ||||
22 | | ||||
23 | #include <QObject> | ||||
24 | | ||||
25 | #include "knewstuffcore_export.h" | ||||
26 | | ||||
27 | namespace KNSCore | ||||
28 | { | ||||
29 | class Question; | ||||
30 | /** | ||||
31 | * @short Implementation-side handler class for questions sent from KNewStuffCore | ||||
32 | * | ||||
33 | * When implementing anything on top of KNewStuffCore, you will need to be able | ||||
34 | * to react to questions asked from inside the framework. This is done by creating | ||||
35 | * an instance of a QuestionListener, and reacting to any calls to the askQuestion | ||||
36 | * slot, which you must extend and implement. Two examples of this exist, in the | ||||
37 | * form of the KNS3::WidgetQuestionListener and KNewStuffQuick::QuickQuestionListener | ||||
38 | * and should you need to create your own, take inspiration from them. | ||||
39 | */ | ||||
40 | class KNEWSTUFFCORE_EXPORT QuestionListener : public QObject | ||||
41 | { | ||||
42 | Q_OBJECT | ||||
43 | public: | ||||
44 | explicit QuestionListener(QObject* parent = 0); | ||||
45 | virtual ~QuestionListener(); | ||||
46 | | ||||
47 | Q_SLOT virtual void askQuestion(Question* question); | ||||
48 | }; | ||||
49 | } | ||||
50 | | ||||
51 | #endif//KNS3_QUESTIONLISTENER_H |