KTutorial supports tutorials written in script languages thanks to Kross. Kross acts as a bridge between C++ code and script languages interpreters, so KTutorial exposes a C++ API to be used from scripts. That API is almost the same provided by the normal KTutorial C++ classes, but it is not exactly the same. Some classes had to be created and some had to be subclassed to add specific features, setup the environment or workaround some limitations of this approach.
Another drawback of scripts is that using just Kross (that is, without language bindings), objects of C++ classes can't be created. Thus, a way to create steps, options and waitfors is needed.
ScriptingModule takes care of that, acting as a factory for those classes. As KTutorial supports custom WaitFor objects, ScriptingModule also supports (thanks to Qt Meta-Object System) creating objects of custom C++ WaitFor subclasses in the scripts just registering these classes (provided they have a default constructor).
Unlike C++ tutorials which are part of the code of the application, scripted tutorials, by its very nature, are external elements. They are like any other data: icons, sounds, images... That is, they have to be placed somewhere to be found.
ScriptManager class takes care of looking for the tutorials in their standard locations and creating a ScriptedTutorial for each of them. If the tutorial was successfully created, it also registers it automatically in the general tutorial manager, as it was already said.
Here it is the final diagram for scripting design, that includes all the explained elements and shows (if size doesn't prevent it) the relations between each of them: