KTutorial
0.5.1
|
Manager for tutorials. More...
#include <TutorialManager.h>
Signals | |
void | started (Tutorial *tutorial) |
This signal is emitted when the given tutorial is about to be started. | |
void | finished () |
This signal is emitted when the started tutorial finishes, or if no tutorial could be started. | |
Public Member Functions | |
TutorialManager () | |
Creates a new TutorialManager. | |
virtual | ~TutorialManager () |
Destroys this TutorialManager. | |
bool | registerTutorial (Tutorial *tutorial) |
Registers a Tutorial with this TutorialManager. | |
QList< const TutorialInformation * > | tutorialInformations () const |
Returns a list with the information of all the registered tutorials. | |
void | start (const QString &id) |
Starts a tutorial identified by its id. |
Manager for tutorials.
A TutorialManager contains several tutorials and is responsible for start the desired tutorial. Also, it emits a finished() signal when the Tutorial ends.
There is only one TutorialManager for each application, created and used internally in KTutorial class. To register a Tutorial, use KTutorial::register(Tutorial*).
Definition at line 44 of file TutorialManager.h.
bool ktutorial::TutorialManager::registerTutorial | ( | Tutorial * | tutorial | ) |
Registers a Tutorial with this TutorialManager.
Only Tutorials with a identifier not added yet can be added. If the Tutorial couldn't be added, false is returned.
The Tutorial is reparented to this TutorialManager, and thus deleted when this manager is deleted.
tutorial | The tutorial to register. |
Definition at line 45 of file TutorialManager.cpp.
References ktutorial::TutorialInformation::id(), ktutorial::TutorialManagerPrivate::mTutorialInformations, ktutorial::TutorialManagerPrivate::mTutorials, and ktutorial::Tutorial::tutorialInformation().
Referenced by ktutorial::KTutorial::registerTutorial(), and ktutorial::customization::DefaultKdeCustomization::setup().
void ktutorial::TutorialManager::start | ( | const QString & | id | ) |
Starts a tutorial identified by its id.
When the tutorial finishes, the signal finished() is emitted. It is also emitted if there is no tutorial with the specified id. In this case, no tutorial is started.
If a KTutorial customization is used, this method must be called when the tutorial has to be started.
id | The id of the tutorial. |
Definition at line 68 of file TutorialManager.cpp.
References finished(), ktutorial::TutorialManagerPrivate::mTutorialInformations, ktutorial::TutorialManagerPrivate::mTutorials, ktutorial::Tutorial::start(), and started().
QList< const TutorialInformation * > ktutorial::TutorialManager::tutorialInformations | ( | ) | const |
Returns a list with the information of all the registered tutorials.
Definition at line 63 of file TutorialManager.cpp.
References ktutorial::TutorialManagerPrivate::mTutorialInformations.
Referenced by ktutorial::view::TutorialListModel::getTutorialInformationForIndex(), and ktutorial::view::TutorialListModel::rowCount().