summaryrefslogtreecommitdiffstats
path: root/src/scxml/qscxmlcompiler.h
blob: 3eecca53e4bbc4e0ad42d58adec03f193dbc356f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#ifndef QSCXMLCOMPILER_H
#define QSCXMLCOMPILER_H

#include <QtScxml/qscxmlerror.h>
#include <QtCore/qstring.h>

QT_BEGIN_NAMESPACE
class QXmlStreamReader;
class QScxmlStateMachine;

class QScxmlCompilerPrivate;
class Q_SCXML_EXPORT QScxmlCompiler
{
public:
    class Q_SCXML_EXPORT Loader
    {
    public:
        Loader();
        virtual ~Loader();
        virtual QByteArray load(const QString &name,
                                const QString &baseDir,
                                QStringList *errors) = 0;
    };

public:
    QScxmlCompiler(QXmlStreamReader *xmlReader);
    ~QScxmlCompiler();

    QString fileName() const;
    void setFileName(const QString &fileName);

    Loader *loader() const;
    void setLoader(Loader *newLoader);

    QScxmlStateMachine *compile();
    QList<QScxmlError> errors() const;

private:
    friend class QScxmlCompilerPrivate;
    QScxmlCompilerPrivate *d;
};

QT_END_NAMESPACE

#endif // QSCXMLCOMPILER_H