KTutorial
0.5.1
|
00001 /*************************************************************************** 00002 * Copyright (C) 2008 by Daniel Calviño Sánchez <danxuliu@gmail.com> * 00003 * Copyright (C) 2009 by Daniel Calviño Sánchez <danxuliu@gmail.com> * 00004 * Copyright (C) 2010 by Daniel Calviño Sánchez <danxuliu@gmail.com> * 00005 * Copyright (C) 2011 by Daniel Calviño Sánchez <danxuliu@gmail.com> * 00006 * Copyright (C) 2012 by Daniel Calviño Sánchez <danxuliu@gmail.com> * 00007 * * 00008 * This program is free software; you can redistribute it and/or modify * 00009 * it under the terms of the GNU General Public License as published by * 00010 * the Free Software Foundation; either version 2 of the License, or * 00011 * (at your option) any later version. * 00012 * * 00013 * This program is distributed in the hope that it will be useful, * 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00016 * GNU General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU General Public License * 00019 * along with this program; If not, see <http://www.gnu.org/licenses/>. * 00020 ***************************************************************************/ 00021 00022 #ifndef KTUTORIAL_TUTORIAL_H 00023 #define KTUTORIAL_TUTORIAL_H 00024 00025 #include <QtCore/QObject> 00026 00027 #include "ktutorial_export.h" 00028 00029 namespace ktutorial { 00030 class Step; 00031 class TutorialInformation; 00032 } 00033 00034 namespace ktutorial { 00035 00072 class KTUTORIAL_EXPORT Tutorial: public QObject { 00073 Q_OBJECT 00074 public: 00075 00084 explicit Tutorial(TutorialInformation* tutorialInformation); 00085 00090 virtual ~Tutorial(); 00091 00098 Q_INVOKABLE TutorialInformation* tutorialInformation() const; 00099 00112 Q_INVOKABLE void addStep(Step* step); 00113 00120 void start(); 00121 00129 void nextStep(Step* step); 00130 00131 public Q_SLOTS: 00132 00144 void nextStep(const QString& id); 00145 00154 void finish(); 00155 00156 Q_SIGNALS: 00157 00166 void finished(Tutorial* tutorial); 00167 00176 void stepActivated(Step* step); 00177 00178 protected: 00179 00186 void setTutorialInformation(TutorialInformation* tutorialInformation); 00187 00193 virtual void setup(); 00194 00200 virtual void tearDown(); 00201 00202 private: 00203 00204 class TutorialPrivate* d; 00205 00213 void changeToStep(Step* step); 00214 00215 }; 00216 00217 } 00218 00219 #endif