wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
TourEngine.h
Go to the documentation of this file.
1// Copyright 2015 - 2026, GIBIS-UNIFESP and the wiRedPanda contributors
2// SPDX-License-Identifier: GPL-3.0-or-later
3
4#pragma once
5
6#include <QObject>
7
9#include "App/Tour/TourStep.h"
10
11class TourEngine : public QObject
12{
13 Q_OBJECT
14
15public:
16 explicit TourEngine(QObject *parent = nullptr);
17
20 bool loadFromResource(const QString &resourcePath);
21
22 QString tourId() const { return m_core.id(); }
23 QString tourTitle() const { return m_core.title(); }
24
25 int currentStep() const { return m_core.currentStep(); }
26 int totalSteps() const { return m_core.totalSteps(); }
27 bool isActive() const { return m_core.isActive(); }
28
30 const TourStep &currentStepData() const;
31
32 void start();
33 void stop();
34 void goToPreviousStep();
35 void advanceStep();
36
41 void retranslate();
42
43signals:
44 void stepChanged(int step, int total, const TourStep &data);
48
49private:
50 void emitCurrentStep();
51 void markCompleted();
52
54};
Shared step-navigation state machine for ExerciseEngine/TourEngine.
Owns the id/title/step-list/progress state machine shared by ExerciseEngine and TourEngine,...
void tourStopped()
void retranslate()
const TourStep & currentStepData() const
Returns the data for the current step.
TourEngine(QObject *parent=nullptr)
void stop()
int totalSteps() const
Definition TourEngine.h:26
QString tourId() const
Definition TourEngine.h:22
void retranslated()
QString tourTitle() const
Definition TourEngine.h:23
int currentStep() const
Definition TourEngine.h:25
void stepChanged(int step, int total, const TourStep &data)
void start()
bool loadFromResource(const QString &resourcePath)
void tourCompleted()
void advanceStep()
bool isActive() const
Definition TourEngine.h:27
void goToPreviousStep()