1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Nokia Corporation (qt-info@nokia.com)
11 ** This file contains pre-release code and may not be distributed.
12 ** You may use this file in accordance with the terms and conditions
13 ** contained in the Technology Preview License Agreement accompanying
16 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25 ** In addition, as a special exception, Nokia gives you certain additional
26 ** rights. These rights are described in the Nokia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29 ** If you have questions regarding the use of this file, please contact
30 ** Nokia at qt-info@nokia.com.
32 **************************************************************************/
34 #ifndef MAEMORUNCONFIGURATION_H
35 #define MAEMORUNCONFIGURATION_H
37 #include "maemoconstants.h"
38 #include "maemodeviceconfigurations.h"
39 #include "maemodeployable.h"
41 #include <utils/environment.h>
43 #include <projectexplorer/runconfiguration.h>
45 #include <QtCore/QDateTime>
46 #include <QtCore/QStringList>
48 QT_FORWARD_DECLARE_CLASS(QWidget)
50 namespace Qt4ProjectManager {
52 class Qt4BuildConfiguration;
59 class AbstractQt4MaemoTarget;
61 class MaemoDeviceConfigListModel;
62 class MaemoDeployStep;
64 class MaemoRemoteMountsModel;
65 class MaemoRunConfigurationFactory;
68 class MaemoRunConfiguration : public ProjectExplorer::RunConfiguration
71 friend class MaemoRunConfigurationFactory;
74 enum BaseEnvironmentBase {
75 CleanEnvironmentBase = 0,
76 SystemEnvironmentBase = 1
79 enum DebuggingType { DebugCppOnly, DebugQmlOnly, DebugCppAndQml };
81 MaemoRunConfiguration(Qt4BaseTarget *parent, const QString &proFilePath);
82 virtual ~MaemoRunConfiguration();
84 using ProjectExplorer::RunConfiguration::isEnabled;
85 bool isEnabled(ProjectExplorer::BuildConfiguration *config) const;
86 QWidget *createConfigurationWidget();
87 ProjectExplorer::OutputFormatter *createOutputFormatter() const;
88 AbstractQt4MaemoTarget *maemoTarget() const;
89 Qt4BuildConfiguration *activeQt4BuildConfiguration() const;
91 MaemoDeployStep *deployStep() const;
92 MaemoRemoteMountsModel *remoteMounts() const { return m_remoteMounts; }
94 const MaemoToolChain *toolchain() const;
95 QString localExecutableFilePath() const;
96 QString remoteExecutableFilePath() const;
97 const QString sysRoot() const;
98 const QString targetRoot() const;
99 const QString arguments() const;
100 void setArguments(const QString &args);
101 QSharedPointer<const MaemoDeviceConfig> deviceConfig() const;
102 MaemoPortList freePorts() const;
103 bool useRemoteGdb() const;
104 void setUseRemoteGdb(bool useRemoteGdb) { m_useRemoteGdb = useRemoteGdb; }
105 void updateFactoryState() { emit isEnabledChanged(true); }
106 DebuggingType debuggingType() const;
108 const QString gdbCmd() const;
109 const QString dumperLib() const;
110 QString localDirToMountForRemoteGdb() const;
111 QString remoteProjectSourcesMountPoint() const;
113 virtual QVariantMap toMap() const;
115 QString baseEnvironmentText() const;
116 BaseEnvironmentBase baseEnvironmentBase() const;
117 void setBaseEnvironmentBase(BaseEnvironmentBase env);
119 Utils::Environment environment() const;
120 Utils::Environment baseEnvironment() const;
122 QList<Utils::EnvironmentItem> userEnvironmentChanges() const;
123 void setUserEnvironmentChanges(const QList<Utils::EnvironmentItem> &diff);
125 Utils::Environment systemEnvironment() const;
126 void setSystemEnvironment(const Utils::Environment &environment);
128 int portsUsedByDebuggers() const;
130 QString proFilePath() const;
133 void deviceConfigurationChanged(ProjectExplorer::Target *target);
134 void targetInformationChanged() const;
136 void baseEnvironmentChanged();
137 void systemEnvironmentChanged();
138 void userEnvironmentChangesChanged(const QList<Utils::EnvironmentItem> &diff);
141 MaemoRunConfiguration(Qt4BaseTarget *parent, MaemoRunConfiguration *source);
142 virtual bool fromMap(const QVariantMap &map);
143 QString defaultDisplayName();
146 void proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro, bool success);
147 void proFileInvalidated(Qt4ProjectManager::Internal::Qt4ProFileNode *pro);
148 void updateDeviceConfigurations();
149 void handleDeployConfigChanged();
153 void handleParseState(bool success);
155 QString m_proFilePath;
156 mutable QString m_gdbPath;
157 MaemoRemoteMountsModel *m_remoteMounts;
161 BaseEnvironmentBase m_baseEnvironmentBase;
162 Utils::Environment m_systemEnvironment;
163 QList<Utils::EnvironmentItem> m_userEnvironmentChanges;
167 } // namespace Internal
168 } // namespace Qt4ProjectManager
170 #endif // MAEMORUNCONFIGURATION_H