| 
									
										
										
										
											2011-04-13 08:42:33 +02:00
										 |  |  | /**************************************************************************
 | 
					
						
							| 
									
										
										
										
											2010-03-18 12:06:43 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2011-04-13 08:42:33 +02:00
										 |  |  | ** This file is part of Qt Creator | 
					
						
							| 
									
										
										
										
											2010-03-18 12:06:43 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2011-04-13 08:42:33 +02:00
										 |  |  | ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies). | 
					
						
							| 
									
										
										
										
											2010-03-18 12:06:43 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2011-11-02 15:59:12 +01:00
										 |  |  | ** Contact: Nokia Corporation (qt-info@nokia.com) | 
					
						
							| 
									
										
										
										
											2010-03-18 12:06:43 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2011-05-12 13:25:35 +02:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2010-03-18 12:06:43 +01:00
										 |  |  | ** GNU Lesser General Public License Usage | 
					
						
							| 
									
										
										
										
											2011-04-13 08:42:33 +02:00
										 |  |  | ** | 
					
						
							|  |  |  | ** This file may be used under the terms of the GNU Lesser General Public | 
					
						
							|  |  |  | ** License version 2.1 as published by the Free Software Foundation and | 
					
						
							|  |  |  | ** appearing in the file LICENSE.LGPL included in the packaging of this file. | 
					
						
							|  |  |  | ** Please review the following information to ensure the GNU Lesser General | 
					
						
							|  |  |  | ** Public License version 2.1 requirements will be met: | 
					
						
							|  |  |  | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
 | 
					
						
							| 
									
										
										
										
											2010-03-18 12:06:43 +01:00
										 |  |  | ** | 
					
						
							|  |  |  | ** In addition, as a special exception, Nokia gives you certain additional | 
					
						
							| 
									
										
										
										
											2011-04-13 08:42:33 +02:00
										 |  |  | ** rights. These rights are described in the Nokia Qt LGPL Exception | 
					
						
							| 
									
										
										
										
											2010-03-18 12:06:43 +01:00
										 |  |  | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | 
					
						
							|  |  |  | ** | 
					
						
							| 
									
										
										
										
											2011-04-13 08:42:33 +02:00
										 |  |  | ** Other Usage | 
					
						
							| 
									
										
										
										
											2010-03-18 12:06:43 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2011-04-13 08:42:33 +02:00
										 |  |  | ** Alternatively, this file may be used in accordance with the terms and | 
					
						
							|  |  |  | ** conditions contained in a signed written agreement between you and Nokia. | 
					
						
							| 
									
										
										
										
											2010-03-18 12:06:43 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2011-04-13 08:42:33 +02:00
										 |  |  | ** If you have questions regarding the use of this file, please contact | 
					
						
							| 
									
										
										
										
											2011-11-02 15:59:12 +01:00
										 |  |  | ** Nokia at qt-info@nokia.com. | 
					
						
							| 
									
										
										
										
											2010-03-18 12:06:43 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2011-04-13 08:42:33 +02:00
										 |  |  | **************************************************************************/ | 
					
						
							| 
									
										
										
										
											2010-03-18 12:06:43 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | #ifndef QMLDIRPARSER_P_H
 | 
					
						
							|  |  |  | #define QMLDIRPARSER_P_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | //  W A R N I N G
 | 
					
						
							|  |  |  | //  -------------
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // This file is not part of the Qt API.  It exists purely as an
 | 
					
						
							|  |  |  | // implementation detail.  This header file may change from version to
 | 
					
						
							|  |  |  | // version without notice, or even be removed.
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // We mean it.
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <QtCore/QUrl>
 | 
					
						
							|  |  |  | #include <QtCore/QHash>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-03-18 15:43:33 +01:00
										 |  |  | #include "qmljsglobal_p.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-03-18 12:06:43 +01:00
										 |  |  | QT_BEGIN_NAMESPACE | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class QmlError; | 
					
						
							| 
									
										
										
										
											2010-03-18 15:43:33 +01:00
										 |  |  | class QML_PARSER_EXPORT QmlDirParser | 
					
						
							| 
									
										
										
										
											2010-03-18 12:06:43 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     Q_DISABLE_COPY(QmlDirParser) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  |     QmlDirParser(); | 
					
						
							|  |  |  |     ~QmlDirParser(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     QUrl url() const; | 
					
						
							|  |  |  |     void setUrl(const QUrl &url); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-13 08:42:52 +02:00
										 |  |  |     QString fileSource() const; | 
					
						
							|  |  |  |     void setFileSource(const QString &filePath); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-03-18 12:06:43 +01:00
										 |  |  |     QString source() const; | 
					
						
							|  |  |  |     void setSource(const QString &source); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     bool isParsed() const; | 
					
						
							|  |  |  |     bool parse(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     bool hasError() const; | 
					
						
							| 
									
										
										
										
											2011-09-13 08:42:52 +02:00
										 |  |  |     QList<QmlError> errors(const QString &uri) const; | 
					
						
							| 
									
										
										
										
											2010-03-18 12:06:43 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     struct Plugin | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         Plugin() {} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         Plugin(const QString &name, const QString &path) | 
					
						
							|  |  |  |             : name(name), path(path) {} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         QString name; | 
					
						
							|  |  |  |         QString path; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     struct Component | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         Component() | 
					
						
							| 
									
										
										
										
											2010-03-25 14:11:23 +01:00
										 |  |  |             : majorVersion(0), minorVersion(0), internal(false) {} | 
					
						
							| 
									
										
										
										
											2010-03-18 12:06:43 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-12-07 11:16:26 +01:00
										 |  |  |         Component(const QString &typeName, const QString &fileName, int majorVersion, int minorVersion) | 
					
						
							| 
									
										
										
										
											2010-03-25 14:11:23 +01:00
										 |  |  |             : typeName(typeName), fileName(fileName), majorVersion(majorVersion), minorVersion(minorVersion), | 
					
						
							|  |  |  |             internal(false) {} | 
					
						
							| 
									
										
										
										
											2010-03-18 12:06:43 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-12-07 11:16:26 +01:00
										 |  |  |         QString typeName; | 
					
						
							| 
									
										
										
										
											2010-03-18 12:06:43 +01:00
										 |  |  |         QString fileName; | 
					
						
							|  |  |  |         int majorVersion; | 
					
						
							|  |  |  |         int minorVersion; | 
					
						
							| 
									
										
										
										
											2010-03-25 14:11:23 +01:00
										 |  |  |         bool internal; | 
					
						
							| 
									
										
										
										
											2010-03-18 12:06:43 +01:00
										 |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     QList<Component> components() const; | 
					
						
							|  |  |  |     QList<Plugin> plugins() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-05-12 13:25:35 +02:00
										 |  |  | #ifdef QT_CREATOR
 | 
					
						
							|  |  |  |     struct TypeInfo | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         TypeInfo() {} | 
					
						
							|  |  |  |         TypeInfo(const QString &fileName) | 
					
						
							|  |  |  |             : fileName(fileName) {} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         QString fileName; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     QList<TypeInfo> typeInfos() const; | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-03-18 12:06:43 +01:00
										 |  |  | private: | 
					
						
							|  |  |  |     void reportError(int line, int column, const QString &message); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							|  |  |  |     QList<QmlError> _errors; | 
					
						
							|  |  |  |     QUrl _url; | 
					
						
							|  |  |  |     QString _source; | 
					
						
							| 
									
										
										
										
											2011-09-13 08:42:52 +02:00
										 |  |  |     QString _filePathSouce; | 
					
						
							| 
									
										
										
										
											2010-03-18 12:06:43 +01:00
										 |  |  |     QList<Component> _components; | 
					
						
							|  |  |  |     QList<Plugin> _plugins; | 
					
						
							| 
									
										
										
										
											2011-05-12 13:25:35 +02:00
										 |  |  | #ifdef QT_CREATOR
 | 
					
						
							|  |  |  |     QList<TypeInfo> _typeInfos; | 
					
						
							|  |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2010-03-18 12:06:43 +01:00
										 |  |  |     unsigned _isParsed: 1; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-03-25 14:11:23 +01:00
										 |  |  | typedef QList<QmlDirParser::Component> QmlDirComponents; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-03-18 12:06:43 +01:00
										 |  |  | QT_END_NAMESPACE | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif // QMLDIRPARSER_P_H
 |