| 1 | // Copyright (C) 2016 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QSCXMLCOMPILER_H |
| 5 | #define QSCXMLCOMPILER_H |
| 6 | |
| 7 | #include <QtScxml/qscxmlerror.h> |
| 8 | #include <QtCore/qstring.h> |
| 9 | |
| 10 | QT_BEGIN_NAMESPACE |
| 11 | class QXmlStreamReader; |
| 12 | class QScxmlStateMachine; |
| 13 | |
| 14 | class QScxmlCompilerPrivate; |
| 15 | class Q_SCXML_EXPORT QScxmlCompiler |
| 16 | { |
| 17 | public: |
| 18 | class Q_SCXML_EXPORT Loader |
| 19 | { |
| 20 | public: |
| 21 | Loader(); |
| 22 | virtual ~Loader(); |
| 23 | virtual QByteArray load(const QString &name, |
| 24 | const QString &baseDir, |
| 25 | QStringList *errors) = 0; |
| 26 | }; |
| 27 | |
| 28 | public: |
| 29 | QScxmlCompiler(QXmlStreamReader *xmlReader); |
| 30 | ~QScxmlCompiler(); |
| 31 | |
| 32 | QString fileName() const; |
| 33 | void setFileName(const QString &fileName); |
| 34 | |
| 35 | Loader *loader() const; |
| 36 | void setLoader(Loader *newLoader); |
| 37 | |
| 38 | QScxmlStateMachine *compile(); |
| 39 | QList<QScxmlError> errors() const; |
| 40 | |
| 41 | private: |
| 42 | friend class QScxmlCompilerPrivate; |
| 43 | QScxmlCompilerPrivate *d; |
| 44 | }; |
| 45 | |
| 46 | QT_END_NAMESPACE |
| 47 | |
| 48 | #endif // QSCXMLCOMPILER_H |
| 49 | |