KTutorial  0.5.1
Signals | Public Member Functions
ktutorial::TutorialManager Class Reference

Manager for tutorials. More...

#include <TutorialManager.h>

List of all members.

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.

Detailed Description

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.


Member Function Documentation

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.

Parameters:
tutorialThe tutorial to register.
Returns:
True if the tutorial was registered, false otherwise.

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.

Parameters:
idThe 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().

Returns a list with the information of all the registered tutorials.

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().


The documentation for this class was generated from the following files: