1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Nokia Corporation (info@qt.nokia.com)
10 ** GNU Lesser General Public License Usage
12 ** This file may be used under the terms of the GNU Lesser General Public
13 ** License version 2.1 as published by the Free Software Foundation and
14 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
15 ** Please review the following information to ensure the GNU Lesser General
16 ** Public License version 2.1 requirements will be met:
17 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
19 ** In addition, as a special exception, Nokia gives you certain additional
20 ** rights. These rights are described in the Nokia Qt LGPL Exception
21 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
25 ** Alternatively, this file may be used in accordance with the terms and
26 ** conditions contained in a signed written agreement between you and Nokia.
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
31 **************************************************************************/
33 #ifndef S60DEVICERUNCONFIGURATION_H
34 #define S60DEVICERUNCONFIGURATION_H
36 #include <debugger/debuggerrunner.h>
37 #include <projectexplorer/runconfiguration.h>
39 #include <QtCore/QFutureInterface>
40 #include <QtCore/QScopedPointer>
41 #include <QtCore/QStringList>
48 namespace Qt4ProjectManager {
53 class Qt4SymbianTarget;
55 class S60DeviceRunConfigurationFactory;
57 class S60DeviceRunConfiguration : public ProjectExplorer::RunConfiguration
60 friend class S60DeviceRunConfigurationFactory;
63 S60DeviceRunConfiguration(Qt4ProjectManager::Qt4BaseTarget *parent, const QString &proFilePath);
64 virtual ~S60DeviceRunConfiguration();
66 Qt4SymbianTarget *qt4Target() const;
67 const QtVersion *qtVersion() const;
69 using ProjectExplorer::RunConfiguration::isEnabled;
70 bool isEnabled(ProjectExplorer::BuildConfiguration *configuration) const;
71 QWidget *createConfigurationWidget();
73 ProjectExplorer::OutputFormatter *createOutputFormatter() const;
75 QString commandLineArguments() const;
76 void setCommandLineArguments(const QString &args);
78 QString projectFilePath() const;
80 QString targetName() const;
81 QString localExecutableFileName() const;
82 quint32 executableUid() const;
85 QString symbianTarget() const;
87 QVariantMap toMap() const;
89 QString proFilePath() const;
91 void targetInformationChanged();
94 S60DeviceRunConfiguration(Qt4ProjectManager::Qt4BaseTarget *parent, S60DeviceRunConfiguration *source);
95 QString defaultDisplayName() const;
96 virtual bool fromMap(const QVariantMap &map);
98 void proFileInvalidated(Qt4ProjectManager::Internal::Qt4ProFileNode *pro);
99 void proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro, bool success);
103 void handleParserState(bool success);
105 QString m_proFilePath;
106 QString m_commandLineArguments;
110 class S60DeviceRunConfigurationFactory : public ProjectExplorer::IRunConfigurationFactory
115 explicit S60DeviceRunConfigurationFactory(QObject *parent = 0);
116 ~S60DeviceRunConfigurationFactory();
118 bool canCreate(ProjectExplorer::Target *parent, const QString &id) const;
119 ProjectExplorer::RunConfiguration *create(ProjectExplorer::Target *parent, const QString &id);
120 bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const;
121 ProjectExplorer::RunConfiguration *restore(ProjectExplorer::Target *parent, const QVariantMap &map);
122 bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) const;
123 ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source);
125 QStringList availableCreationIds(ProjectExplorer::Target *parent) const;
126 // used to translate the ids to names to display to the user
127 QString displayNameForId(const QString &id) const;
130 // S60DeviceDebugRunControl starts debugging
132 class S60DeviceDebugRunControl : public Debugger::DebuggerRunControl
134 Q_DISABLE_COPY(S60DeviceDebugRunControl)
137 explicit S60DeviceDebugRunControl(S60DeviceRunConfiguration *runConfiguration,
138 const Debugger::DebuggerStartParameters &sp,
139 const QPair<Debugger::DebuggerEngineType, Debugger::DebuggerEngineType> &masterSlaveEngineTypes);
140 virtual void start();
141 virtual bool promptToStop(bool *optionalPrompt = 0) const;
144 class S60DeviceDebugRunControlFactory : public ProjectExplorer::IRunControlFactory
147 explicit S60DeviceDebugRunControlFactory(QObject *parent = 0);
148 bool canRun(ProjectExplorer::RunConfiguration *runConfiguration, const QString &mode) const;
150 ProjectExplorer::RunControl* create(ProjectExplorer::RunConfiguration *runConfiguration, const QString &mode);
151 QString displayName() const;
152 ProjectExplorer::RunConfigWidget *createConfigurationWidget(ProjectExplorer::RunConfiguration * /*runConfiguration */);
155 } // namespace Internal
156 } // namespace Qt4ProjectManager
158 #endif // S60DEVICERUNCONFIGURATION_H