KDStateMachineEditor API Documentation 2.1
Loading...
Searching...
No Matches
runtimecontroller.h
Go to the documentation of this file.
1/*
2 This file is part of the KDAB State Machine Editor Library.
3
4 SPDX-FileCopyrightText: 2015 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
5 Author: Kevin Funk <kevin.funk@kdab.com>
6
7 SPDX-License-Identifier: LGPL-2.1-only OR LicenseRef-KDAB-KDStateMachineEditor
8
9 Licensees holding valid commercial KDAB State Machine Editor Library
10 licenses may use this file in accordance with the KDAB State Machine Editor
11 Library License Agreement provided with the Software.
12
13 Contact info@kdab.com if any conditions of this licensing are not clear to you.
14*/
15
16#ifndef KDSME_RUNTIMECONTROLLER_H
17#define KDSME_RUNTIMECONTROLLER_H
18
19#include "kdsme_core_export.h"
20
21#include "state.h"
22#include "transition.h"
23
24#include <QObject>
25#include <QRectF>
26#include <QSet>
27
28namespace KDSME {
29
30class KDSME_CORE_EXPORT RuntimeController : public QObject
31{
32 Q_OBJECT
33 Q_PROPERTY(QSet<KDSME::State *> activeConfiguration READ activeConfiguration NOTIFY activeConfigurationChanged)
34 Q_PROPERTY(KDSME::Transition *lastTransition READ lastTransition NOTIFY lastTransitionChanged)
35 Q_PROPERTY(bool isRunning READ isRunning NOTIFY isRunningChanged)
36 Q_PROPERTY(QRectF activeRegion READ activeRegion NOTIFY activeRegionChanged)
37
38public:
39 typedef QSet<State *> Configuration;
40
41 explicit RuntimeController(QObject *parent = nullptr);
43
44 Configuration activeConfiguration() const;
45 QList<Configuration> lastConfigurations() const;
46 void setActiveConfiguration(const Configuration &configuration);
47
48 QList<Transition *> lastTransitions() const;
49 Transition *lastTransition() const;
50 void setLastTransition(Transition *transition);
51
52 bool isRunning() const;
53 void setIsRunning(bool isRunning);
54
55 Q_INVOKABLE float activenessForState(KDSME::State *state) const;
56 Q_INVOKABLE float activenessForTransition(KDSME::Transition *transition);
57
58 int historySize() const;
59 void setHistorySize(int size);
60
61 QRectF activeRegion() const;
62
63 void clear();
64
65Q_SIGNALS:
66 void activeConfigurationChanged(const QSet<KDSME::State *> &configuration);
67 void lastTransitionChanged(KDSME::Transition *transition);
68 void isRunningChanged(bool isRunning);
69 void activeRegionChanged(const QRectF &region);
70
71private:
72 struct Private;
73 QScopedPointer<Private> d;
74};
75
76}
77
78#endif

© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDStateMachineEditor
Create Qt State Machine metacode using a graphical user interface
https://github.com/KDAB/KDStateMachineEditor
Generated on Tue Jul 15 2025 15:21:47 for KDStateMachineEditor API Documentation by doxygen 1.9.8