1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Nokia Corporation (qt-info@nokia.com)
11 ** Licensees holding valid Qt Commercial licenses may use this file in
12 ** accordance with the Qt Commercial License Agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and Nokia.
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 ** If you are unsure which license is appropriate for your use, please
26 ** contact the sales department at http://qt.nokia.com/contact.
28 **************************************************************************/
30 #ifndef MAEMORUNCONFIGURATION_H
31 #define MAEMORUNCONFIGURATION_H
33 #include "maemoconstants.h"
34 #include "maemodeviceconfigurations.h"
36 #include <projectexplorer/runconfiguration.h>
38 #include <QtCore/QDateTime>
39 #include <QtCore/QStringList>
41 QT_FORWARD_DECLARE_CLASS(QWidget)
43 namespace Qt4ProjectManager {
51 class Qt4BuildConfiguration;
55 class MaemoPackageCreationStep;
56 class MaemoRunConfigurationFactory;
58 class MaemoRunConfiguration : public ProjectExplorer::RunConfiguration
61 friend class MaemoRunConfigurationFactory;
64 MaemoRunConfiguration(Qt4Target *parent, const QString &proFilePath);
65 virtual ~MaemoRunConfiguration();
67 bool isEnabled(ProjectExplorer::BuildConfiguration *config) const;
68 QWidget *createConfigurationWidget();
69 Qt4Target *qt4Target() const;
70 Qt4BuildConfiguration *activeQt4BuildConfiguration() const;
72 bool currentlyNeedsDeployment(const QString &host) const;
73 void wasDeployed(const QString &host);
75 bool hasDebuggingHelpers() const;
76 bool debuggingHelpersNeedDeployment(const QString &host) const;
77 void debuggingHelpersDeployed(const QString &host);
79 const MaemoPackageCreationStep *packageStep() const;
81 QString maddeRoot() const;
82 QString executable() const;
83 const QString sysRoot() const;
84 const QString targetRoot() const;
85 const QStringList arguments() const;
86 void setArguments(const QStringList &args);
87 void setDeviceConfig(const MaemoDeviceConfig &deviceConfig);
88 MaemoDeviceConfig deviceConfig() const;
89 QString runtimeGdbServerPort() const;
93 const QString sshCmd() const;
94 const QString scpCmd() const;
96 const QString gdbCmd() const;
97 const QString dumperLib() const;
99 virtual QVariantMap toMap() const;
102 void deviceConfigurationsUpdated();
103 void deviceConfigurationChanged(ProjectExplorer::Target *target);
104 void targetInformationChanged() const;
107 MaemoRunConfiguration(Qt4Target *parent, MaemoRunConfiguration *source);
108 virtual bool fromMap(const QVariantMap &map);
111 void proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro);
112 void updateDeviceConfigurations();
118 const QString cmd(const QString &cmdName) const;
120 const MaemoToolChain *toolchain() const;
121 bool fileNeedsDeployment(const QString &path, const QDateTime &lastDeployed) const;
122 void addDeployTimesToMap(const QString &key,
123 const QMap<QString, QDateTime> &deployTimes,
124 QVariantMap &map) const;
125 void getDeployTimesFromMap(const QString &key,
126 QMap<QString, QDateTime> &deployTimes,
127 const QVariantMap &map);
129 QString m_proFilePath;
130 mutable QString m_gdbPath;
132 MaemoDeviceConfig m_devConfig;
133 QStringList m_arguments;
135 // These map host names to deploy times.
136 QMap<QString, QDateTime> m_lastDeployed;
137 QMap<QString, QDateTime> m_debuggingHelpersLastDeployed;
140 } // namespace Internal
141 } // namespace Qt4ProjectManager
143 #endif // MAEMORUNCONFIGURATION_H