KDStateMachineEditor API Documentation 2.1
Loading...
Searching...
No Matches
commandfactory_p.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 COMMAND_COMMANDFACTORY_P_H
17#define COMMAND_COMMANDFACTORY_P_H
18
19#include "kdsme_view_export.h"
20
21#include "element.h"
22#include "elementmodel.h"
23
24#include <QObject>
25
26namespace KDSME {
27class CreateElementCommand;
28class DeleteElementCommand;
29class LayoutSnapshotCommand;
30class ModifyPropertyCommand;
31class ModifyElementCommand;
32class ModifyTransitionCommand;
33class ReparentElementCommand;
34class ChangeStateMachineCommand;
35class Transition;
36class StateMachineScene;
37}
38
39class CommandFactory : public QObject
40{
41 Q_OBJECT
42 Q_PROPERTY(KDSME::StateModel *model READ model WRITE setModel NOTIFY modelChanged)
43
44public:
45 explicit CommandFactory(QObject *parent = nullptr);
46
47 KDSME::StateModel *model() const;
49
52 Q_INVOKABLE KDSME::LayoutSnapshotCommand *layoutSnapshot(KDSME::StateMachineScene *view, const QString &text = QString()) const;
53 Q_INVOKABLE KDSME::ModifyPropertyCommand *modifyProperty(QObject *object, const char *property, const QVariant &value, const QString &text = QString());
54 Q_INVOKABLE KDSME::ModifyPropertyCommand *modifyProperty(QObject *object, const QJsonObject &propertyMap, const QString &text = QString());
59
60Q_SIGNALS:
62
63private:
64 KDSME::StateModel *m_model;
65};
66
67Q_DECLARE_METATYPE(CommandFactory *)
68
69#endif
void modelChanged(KDSME::StateModel *model)
Q_INVOKABLE KDSME::ReparentElementCommand * reparentElement(KDSME::StateMachineScene *view, KDSME::Element *element)
void setModel(KDSME::StateModel *model)
Q_INVOKABLE KDSME::ChangeStateMachineCommand * changeStateMachineElement(KDSME::StateMachineScene *view, KDSME::StateMachine *statemachine)
Q_INVOKABLE KDSME::ModifyElementCommand * modifyElement(KDSME::Element *item)
Q_INVOKABLE KDSME::LayoutSnapshotCommand * layoutSnapshot(KDSME::StateMachineScene *view, const QString &text=QString()) const
KDSME::StateModel * model
Q_INVOKABLE KDSME::DeleteElementCommand * deleteElement(KDSME::StateMachineScene *view, KDSME::Element *element) const
Q_INVOKABLE KDSME::CreateElementCommand * createElement(KDSME::StateModel *model, KDSME::Element::Type type, KDSME::Element *parentElement=nullptr) const
Q_INVOKABLE KDSME::ModifyPropertyCommand * modifyProperty(QObject *object, const char *property, const QVariant &value, const QString &text=QString())
Q_INVOKABLE KDSME::ModifyTransitionCommand * modifyTransition(KDSME::Transition *transition, KDSME::StateModel *model)
Changes the state machine of a KDSME::StateMachineScene and records the old state machine the scene w...
This is the inverse operation to the KDSME::CreateElementCommand command.
Creates a snapshot of the current layout of the state chart.
Command for modifying properties of KDSME::Element.
Modifies any specific property of a QObject.
Command for modifying properties of a KDSME::Transition.
Modifies the parent element of a KDSME::Element.

© 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