OSDN Git Service

Merge remote branch 'origin/2.0'
[qt-creator-jp/qt-creator-jp.git] / src / plugins / qt4projectmanager / qt-maemo / maemorunconfiguration.h
1 /**************************************************************************
2 **
3 ** This file is part of Qt Creator
4 **
5 ** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
6 **
7 ** Contact: Nokia Corporation (qt-info@nokia.com)
8 **
9 ** Commercial Usage
10 **
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.
15 **
16 ** GNU Lesser General Public License Usage
17 **
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.
24 **
25 ** If you are unsure which license is appropriate for your use, please
26 ** contact the sales department at http://qt.nokia.com/contact.
27 **
28 **************************************************************************/
29
30 #ifndef MAEMORUNCONFIGURATION_H
31 #define MAEMORUNCONFIGURATION_H
32
33 #include "maemoconstants.h"
34 #include "maemodeviceconfigurations.h"
35
36 #include <projectexplorer/runconfiguration.h>
37
38 #include <QtCore/QDateTime>
39 #include <QtCore/QStringList>
40
41 QT_FORWARD_DECLARE_CLASS(QWidget)
42
43 namespace Qt4ProjectManager {
44
45 class Qt4Project;
46
47 namespace Internal {
48
49 class MaemoManager;
50 class MaemoToolChain;
51 class Qt4BuildConfiguration;
52 class Qt4ProFileNode;
53 class Qt4Target;
54
55 class MaemoPackageCreationStep;
56 class MaemoRunConfigurationFactory;
57
58 class MaemoRunConfiguration : public ProjectExplorer::RunConfiguration
59 {
60     Q_OBJECT
61     friend class MaemoRunConfigurationFactory;
62
63 public:
64     MaemoRunConfiguration(Qt4Target *parent, const QString &proFilePath);
65     virtual ~MaemoRunConfiguration();
66
67     bool isEnabled(ProjectExplorer::BuildConfiguration *config) const;
68     QWidget *createConfigurationWidget();
69     Qt4Target *qt4Target() const;
70     Qt4BuildConfiguration *activeQt4BuildConfiguration() const;
71
72     bool currentlyNeedsDeployment(const QString &host) const;
73     void wasDeployed(const QString &host);
74
75     bool hasDebuggingHelpers() const;
76     bool debuggingHelpersNeedDeployment(const QString &host) const;
77     void debuggingHelpersDeployed(const QString &host);
78
79     const MaemoPackageCreationStep *packageStep() const;
80
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;
90
91 <<<<<<< HEAD
92 =======
93     const QString sshCmd() const;
94     const QString scpCmd() const;
95 >>>>>>> origin/2.0
96     const QString gdbCmd() const;
97     const QString dumperLib() const;
98
99     virtual QVariantMap toMap() const;
100
101 signals:
102     void deviceConfigurationsUpdated();
103     void deviceConfigurationChanged(ProjectExplorer::Target *target);
104     void targetInformationChanged() const;
105
106 protected:
107     MaemoRunConfiguration(Qt4Target *parent, MaemoRunConfiguration *source);
108     virtual bool fromMap(const QVariantMap &map);
109
110 private slots:
111     void proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro);
112     void updateDeviceConfigurations();
113
114 private:
115     void init();
116 <<<<<<< HEAD
117 =======
118     const QString cmd(const QString &cmdName) const;
119 >>>>>>> origin/2.0
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);
128
129     QString m_proFilePath;
130     mutable QString m_gdbPath;
131
132     MaemoDeviceConfig m_devConfig;
133     QStringList m_arguments;
134
135     // These map host names to deploy times.
136     QMap<QString, QDateTime> m_lastDeployed;
137     QMap<QString, QDateTime> m_debuggingHelpersLastDeployed;
138 };
139
140     } // namespace Internal
141 } // namespace Qt4ProjectManager
142
143 #endif // MAEMORUNCONFIGURATION_H