1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Nokia Corporation (info@qt.nokia.com)
9 ** GNU Lesser General Public License Usage
11 ** This file may be used under the terms of the GNU Lesser General Public
12 ** License version 2.1 as published by the Free Software Foundation and
13 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
14 ** Please review the following information to ensure the GNU Lesser General
15 ** Public License version 2.1 requirements will be met:
16 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
18 ** In addition, as a special exception, Nokia gives you certain additional
19 ** rights. These rights are described in the Nokia Qt LGPL Exception
20 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
24 ** Alternatively, this file may be used in accordance with the terms and
25 ** conditions contained in a signed written agreement between you and Nokia.
27 ** If you have questions regarding the use of this file, please contact
28 ** Nokia at qt-info@nokia.com.
30 **************************************************************************/
32 #ifndef QMLDIRPARSER_P_H
33 #define QMLDIRPARSER_P_H
39 // This file is not part of the Qt API. It exists purely as an
40 // implementation detail. This header file may change from version to
41 // version without notice, or even be removed.
46 #include <QtCore/QUrl>
47 #include <QtCore/QHash>
49 #include "qmljsglobal_p.h"
54 class QML_PARSER_EXPORT QmlDirParser
56 Q_DISABLE_COPY(QmlDirParser)
63 void setUrl(const QUrl &url);
65 QString source() const;
66 void setSource(const QString &source);
68 bool isParsed() const;
71 bool hasError() const;
72 QList<QmlError> errors() const;
78 Plugin(const QString &name, const QString &path)
79 : name(name), path(path) {}
88 : majorVersion(0), minorVersion(0), internal(false) {}
90 Component(const QString &typeName, const QString &fileName, int majorVersion, int minorVersion)
91 : typeName(typeName), fileName(fileName), majorVersion(majorVersion), minorVersion(minorVersion),
101 QList<Component> components() const;
102 QList<Plugin> plugins() const;
105 void reportError(int line, int column, const QString &message);
108 QList<QmlError> _errors;
111 QList<Component> _components;
112 QList<Plugin> _plugins;
113 unsigned _isParsed: 1;
116 typedef QList<QmlDirParser::Component> QmlDirComponents;
121 #endif // QMLDIRPARSER_P_H