| 
									
										
										
										
											2010-02-16 13:39:13 +01:00
										 |  |  | /**************************************************************************
 | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** This file is part of Qt Creator | 
					
						
							|  |  |  | ** | 
					
						
							| 
									
										
										
										
											2010-03-05 11:25:49 +01:00
										 |  |  | ** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). | 
					
						
							| 
									
										
										
										
											2010-02-16 13:39:13 +01:00
										 |  |  | ** | 
					
						
							|  |  |  | ** Contact: Nokia Corporation (qt-info@nokia.com) | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** Commercial Usage | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** Licensees holding valid Qt Commercial licenses may use this file in | 
					
						
							|  |  |  | ** accordance with the Qt Commercial License Agreement provided with the | 
					
						
							|  |  |  | ** Software or, alternatively, in accordance with the terms contained in | 
					
						
							|  |  |  | ** a written agreement between you and Nokia. | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** GNU Lesser General Public License Usage | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** Alternatively, 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.
 | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** If you are unsure which license is appropriate for your use, please | 
					
						
							|  |  |  | ** contact the sales department at http://qt.nokia.com/contact.
 | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | **************************************************************************/ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef QMLPROJECTRUNCONFIGURATION_H
 | 
					
						
							|  |  |  | #define QMLPROJECTRUNCONFIGURATION_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "qmlprojectmanager_global.h"
 | 
					
						
							|  |  |  | #include <projectexplorer/runconfiguration.h>
 | 
					
						
							| 
									
										
										
										
											2010-04-13 10:58:30 +02:00
										 |  |  | #include <QWeakPointer>
 | 
					
						
							|  |  |  | #include <QComboBox>
 | 
					
						
							| 
									
										
										
										
											2010-08-20 11:34:02 +02:00
										 |  |  | #include <QLabel>
 | 
					
						
							| 
									
										
										
										
											2010-04-13 10:58:30 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | QT_FORWARD_DECLARE_CLASS(QStringListModel); | 
					
						
							| 
									
										
										
										
											2010-02-16 13:39:13 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-03-05 11:11:05 +01:00
										 |  |  | namespace Core { | 
					
						
							|  |  |  |     class IEditor; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-11-29 12:50:44 +01:00
										 |  |  | namespace Utils { | 
					
						
							|  |  |  |     class Environment; | 
					
						
							|  |  |  |     class EnvironmentItem; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-10-04 15:03:01 +02:00
										 |  |  | namespace Qt4ProjectManager { | 
					
						
							| 
									
										
										
										
											2010-11-29 09:45:30 +01:00
										 |  |  |     class QtVersion; | 
					
						
							| 
									
										
										
										
											2010-10-04 15:03:01 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-16 13:39:13 +01:00
										 |  |  | namespace QmlProjectManager { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace Internal { | 
					
						
							| 
									
										
										
										
											2010-11-29 09:45:30 +01:00
										 |  |  |     class QmlProjectTarget; | 
					
						
							|  |  |  |     class QmlProjectRunConfigurationFactory; | 
					
						
							| 
									
										
										
										
											2010-11-29 11:42:58 +01:00
										 |  |  |     class QmlProjectRunConfigurationWidget; | 
					
						
							| 
									
										
										
										
											2010-02-16 13:39:13 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class QMLPROJECTMANAGER_EXPORT QmlProjectRunConfiguration : public ProjectExplorer::RunConfiguration | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     Q_OBJECT | 
					
						
							|  |  |  |     friend class Internal::QmlProjectRunConfigurationFactory; | 
					
						
							| 
									
										
										
										
											2010-11-29 11:42:58 +01:00
										 |  |  |     friend class Internal::QmlProjectRunConfigurationWidget; | 
					
						
							| 
									
										
										
										
											2010-02-16 13:39:13 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-10-06 10:03:51 +02:00
										 |  |  |     // used in qmldumptool.cpp
 | 
					
						
							|  |  |  |     Q_PROPERTY(int qtVersionId READ qtVersionId) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-16 13:39:13 +01:00
										 |  |  | public: | 
					
						
							|  |  |  |     QmlProjectRunConfiguration(Internal::QmlProjectTarget *parent); | 
					
						
							|  |  |  |     virtual ~QmlProjectRunConfiguration(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     Internal::QmlProjectTarget *qmlTarget() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     QString viewerPath() const; | 
					
						
							| 
									
										
										
										
											2010-10-04 15:03:01 +02:00
										 |  |  |     QString observerPath() const; | 
					
						
							| 
									
										
										
										
											2010-10-19 11:14:03 +02:00
										 |  |  |     QString viewerArguments() const; | 
					
						
							| 
									
										
										
										
											2010-02-16 13:39:13 +01:00
										 |  |  |     QString workingDirectory() const; | 
					
						
							| 
									
										
										
										
											2010-10-06 10:03:51 +02:00
										 |  |  |     int qtVersionId() const; | 
					
						
							| 
									
										
										
										
											2010-10-05 10:54:05 +02:00
										 |  |  |     Qt4ProjectManager::QtVersion *qtVersion() const; | 
					
						
							| 
									
										
										
										
											2010-02-16 13:39:13 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-12-03 17:04:29 +01:00
										 |  |  |     enum MainScriptSource { | 
					
						
							|  |  |  |         FileInEditor, | 
					
						
							|  |  |  |         FileInProjectFile, | 
					
						
							|  |  |  |         FileInSettings | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     MainScriptSource mainScriptSource() const; | 
					
						
							|  |  |  |     void setScriptSource(MainScriptSource source, const QString &settingsPath = QString()); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-11-29 11:42:58 +01:00
										 |  |  |     QString mainScript() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-11-29 12:50:44 +01:00
										 |  |  |     Utils::Environment environment() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-16 13:39:13 +01:00
										 |  |  |     // RunConfiguration
 | 
					
						
							| 
									
										
										
										
											2010-11-29 11:42:58 +01:00
										 |  |  |     bool isEnabled(ProjectExplorer::BuildConfiguration *bc) const; | 
					
						
							| 
									
										
										
										
											2010-04-16 11:46:47 +02:00
										 |  |  |     virtual QWidget *createConfigurationWidget(); | 
					
						
							| 
									
										
										
										
											2010-10-18 12:39:02 +02:00
										 |  |  |     ProjectExplorer::OutputFormatter *createOutputFormatter() const; | 
					
						
							| 
									
										
										
										
											2010-02-16 13:39:13 +01:00
										 |  |  |     QVariantMap toMap() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-03-08 14:36:44 +01:00
										 |  |  | public slots: | 
					
						
							| 
									
										
										
										
											2010-03-05 11:11:05 +01:00
										 |  |  |     void changeCurrentFile(Core::IEditor*); | 
					
						
							| 
									
										
										
										
											2010-03-08 14:36:44 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | private slots: | 
					
						
							| 
									
										
										
										
											2010-08-19 16:51:27 +02:00
										 |  |  |     void updateEnabled(); | 
					
						
							| 
									
										
										
										
											2010-10-04 15:03:01 +02:00
										 |  |  |     void updateQtVersions(); | 
					
						
							| 
									
										
										
										
											2010-02-16 13:39:13 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | protected: | 
					
						
							| 
									
										
										
										
											2010-11-29 09:45:30 +01:00
										 |  |  |     QmlProjectRunConfiguration(Internal::QmlProjectTarget *parent, | 
					
						
							|  |  |  |                                QmlProjectRunConfiguration *source); | 
					
						
							| 
									
										
										
										
											2010-02-16 13:39:13 +01:00
										 |  |  |     virtual bool fromMap(const QVariantMap &map); | 
					
						
							| 
									
										
										
										
											2010-03-05 11:11:05 +01:00
										 |  |  |     void setEnabled(bool value); | 
					
						
							| 
									
										
										
										
											2010-02-16 13:39:13 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							|  |  |  |     void ctor(); | 
					
						
							| 
									
										
										
										
											2010-10-04 15:03:01 +02:00
										 |  |  |     static bool isValidVersion(Qt4ProjectManager::QtVersion *version); | 
					
						
							| 
									
										
										
										
											2010-10-13 13:02:26 +02:00
										 |  |  |     void setQtVersionId(int id); | 
					
						
							| 
									
										
										
										
											2010-02-16 13:39:13 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-11-29 12:50:44 +01:00
										 |  |  |     Utils::Environment baseEnvironment() const; | 
					
						
							|  |  |  |     void setUserEnvironmentChanges(const QList<Utils::EnvironmentItem> &diff); | 
					
						
							|  |  |  |     QList<Utils::EnvironmentItem> userEnvironmentChanges() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-03-05 11:11:05 +01:00
										 |  |  |     // absolute path to current file (if being used)
 | 
					
						
							|  |  |  |     QString m_currentFileFilename; | 
					
						
							|  |  |  |     // absolute path to selected main script (if being used)
 | 
					
						
							|  |  |  |     QString m_mainScriptFilename; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-10-04 15:03:01 +02:00
										 |  |  |     int m_qtVersionId; | 
					
						
							| 
									
										
										
										
											2010-02-16 13:39:13 +01:00
										 |  |  |     QString m_scriptFile; | 
					
						
							|  |  |  |     QString m_qmlViewerArgs; | 
					
						
							| 
									
										
										
										
											2010-04-15 11:59:22 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-03-08 14:36:44 +01:00
										 |  |  |     Internal::QmlProjectTarget *m_projectTarget; | 
					
						
							| 
									
										
										
										
											2010-11-29 11:42:58 +01:00
										 |  |  |     QWeakPointer<Internal::QmlProjectRunConfigurationWidget> m_configurationWidget; | 
					
						
							| 
									
										
										
										
											2010-03-08 14:36:44 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-03-05 11:11:05 +01:00
										 |  |  |     bool m_usingCurrentFile; | 
					
						
							|  |  |  |     bool m_isEnabled; | 
					
						
							| 
									
										
										
										
											2010-11-29 12:50:44 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     QList<Utils::EnvironmentItem> m_userEnvironmentChanges; | 
					
						
							| 
									
										
										
										
											2010-02-16 13:39:13 +01:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } // namespace QmlProjectManager
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif // QMLPROJECTRUNCONFIGURATION_H
 |