KTutorial  0.5.1
Public Member Functions
ktutorial::WaitForStepActivation Class Reference

Waits for the activation of a step. More...

#include <WaitForStepActivation.h>

Inheritance diagram for ktutorial::WaitForStepActivation:
Inheritance graph
[legend]
Collaboration diagram for ktutorial::WaitForStepActivation:
Collaboration graph
[legend]

List of all members.

Public Member Functions

Q_INVOKABLE WaitForStepActivation ()
 Creates a new WaitForStepActivation.
 WaitForStepActivation (const Tutorial *tutorial, const Step *step)
 Creates a new WaitForStepActivation.
virtual ~WaitForStepActivation ()
 Destroys this WaitForStepActivation.
Q_INVOKABLE void setStep (const Tutorial *tutorial, const Step *step)
 Sets the step to wait for its activation.
virtual bool conditionMet () const
 Returns true if the step is being activated.

Detailed Description

Waits for the activation of a step.

When the step is activated, the wait ends.

The purpose of WaitForStepActivations is to be combined with one or more WaitForProperties using a WaitForAnd. If the properties have the expected value when the step is activated, the associated slot is executed or the next step is requested (depending on the Step::addWaitFor() method used). It can be used to set "preconditions" for a step, and change to another step if some things that should have been done before that step were not done yet.

Note that the condition is met only while the step is being activated. Once the step is active, the condition is no longer met (until the next time that the step is being activated again). Due to this, it only makes sense to use WaitForStepActivation with the same step that the WaitForStepActivation is going to be added to (if used to wait for the activation of another step, the WaitForStepActivation will always be inactive when that step is being activated).

Despite waiting for the step activation, WaitForStepActivation can be safely created and added to a step in its setup, and several WaitForStepActivation can be added to the same step without problems.

See also:
WaitForAnd
WaitForProperty

Definition at line 59 of file WaitForStepActivation.h.


Constructor & Destructor Documentation

Creates a new WaitForStepActivation.

This constructor is needed to dynamically create WaitForStepActivation objects in scripts using ScriptingModule::newWaitFor(const QString&). Method setStep(const Tutorial*, const Step*) must be called to finish setting up the object. For C++ tutorials, use WaitForStepActivation(const Tutorial*, const Step*) constructor instead of this one.

Definition at line 36 of file WaitForStepActivation.cpp.

References ktutorial::WaitForStepActivationPrivate::mDuringStepActivation.

ktutorial::WaitForStepActivation::WaitForStepActivation ( const Tutorial tutorial,
const Step step 
)

Creates a new WaitForStepActivation.

Parameters:
tutorialThe tutorial that contains the step.
stepThe step to wait for its activation.

Definition at line 41 of file WaitForStepActivation.cpp.

References ktutorial::WaitForStepActivationPrivate::mDuringStepActivation, and setStep().


Member Function Documentation

Returns true if the step is being activated.

Note that true is only returned during the step activation, but not once it is already active.

Returns:
True if the step is being activated, false otherwise.

Implements ktutorial::WaitFor.

Definition at line 69 of file WaitForStepActivation.cpp.

References ktutorial::WaitForStepActivationPrivate::mDuringStepActivation.

void ktutorial::WaitForStepActivation::setStep ( const Tutorial tutorial,
const Step step 
)

Sets the step to wait for its activation.

This method can be invoked from a script.

In fact, you should only invoke this method from a script, and only once, to set up the object. For C++ tutorials, use WaitForStepActivation(const Tutorial*, const Step*) constructor when creating this WaitForStepActivation.

Parameters:
tutorialThe tutorial that contains the step.
stepThe step to wait for its activation.

Definition at line 52 of file WaitForStepActivation.cpp.

Referenced by WaitForStepActivation().


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