OSDN Git Service

Update license.
[qt-creator-jp/qt-creator-jp.git] / src / plugins / qt4projectmanager / qt-s60 / s60devicerunconfiguration.h
1 /**************************************************************************
2 **
3 ** This file is part of Qt Creator
4 **
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
6 **
7 ** Contact: Nokia Corporation (info@qt.nokia.com)
8 **
9 **
10 ** GNU Lesser General Public License Usage
11 **
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.
18 **
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.
22 **
23 ** Other Usage
24 **
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.
27 **
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
30 **
31 **************************************************************************/
32
33 #ifndef S60DEVICERUNCONFIGURATION_H
34 #define S60DEVICERUNCONFIGURATION_H
35
36 #include <debugger/debuggerrunner.h>
37 #include <projectexplorer/runconfiguration.h>
38
39 #include <QtCore/QFutureInterface>
40 #include <QtCore/QScopedPointer>
41 #include <QtCore/QStringList>
42
43 QT_BEGIN_NAMESPACE
44 class QMessageBox;
45 class QWidget;
46 QT_END_NAMESPACE
47
48 namespace Qt4ProjectManager {
49 class QtVersion;
50 class Qt4BaseTarget;
51
52 namespace Internal {
53 class Qt4SymbianTarget;
54 class Qt4ProFileNode;
55 class S60DeviceRunConfigurationFactory;
56
57 class S60DeviceRunConfiguration : public ProjectExplorer::RunConfiguration
58 {
59     Q_OBJECT
60     friend class S60DeviceRunConfigurationFactory;
61
62 public:
63     S60DeviceRunConfiguration(Qt4ProjectManager::Qt4BaseTarget *parent, const QString &proFilePath);
64     virtual ~S60DeviceRunConfiguration();
65
66     Qt4SymbianTarget *qt4Target() const;
67     const QtVersion *qtVersion() const;
68
69     using ProjectExplorer::RunConfiguration::isEnabled;
70     bool isEnabled(ProjectExplorer::BuildConfiguration *configuration) const;
71     QWidget *createConfigurationWidget();
72
73     ProjectExplorer::OutputFormatter *createOutputFormatter() const;
74
75     QString commandLineArguments() const;
76     void setCommandLineArguments(const QString &args);
77
78     QString projectFilePath() const;
79
80     QString targetName() const;
81     QString localExecutableFileName() const;
82     quint32 executableUid() const;
83
84     bool isDebug() const;
85     QString symbianTarget() const;
86
87     QVariantMap toMap() const;
88
89     QString proFilePath() const;
90 signals:
91     void targetInformationChanged();
92
93 protected:
94     S60DeviceRunConfiguration(Qt4ProjectManager::Qt4BaseTarget *parent, S60DeviceRunConfiguration *source);
95     QString defaultDisplayName() const;
96     virtual bool fromMap(const QVariantMap &map);
97 private slots:
98     void proFileInvalidated(Qt4ProjectManager::Internal::Qt4ProFileNode *pro);
99     void proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro, bool success);
100
101 private:
102     void ctor();
103     void handleParserState(bool success);
104
105     QString m_proFilePath;
106     QString m_commandLineArguments;
107     bool m_validParse;
108 };
109
110 class S60DeviceRunConfigurationFactory : public ProjectExplorer::IRunConfigurationFactory
111 {
112     Q_OBJECT
113
114 public:
115     explicit S60DeviceRunConfigurationFactory(QObject *parent = 0);
116     ~S60DeviceRunConfigurationFactory();
117
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);
124
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;
128 };
129
130 // S60DeviceDebugRunControl starts debugging
131
132 class S60DeviceDebugRunControl : public Debugger::DebuggerRunControl
133 {
134     Q_DISABLE_COPY(S60DeviceDebugRunControl)
135     Q_OBJECT
136 public:
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;
142 };
143
144 class S60DeviceDebugRunControlFactory : public ProjectExplorer::IRunControlFactory
145 {
146 public:
147     explicit S60DeviceDebugRunControlFactory(QObject *parent = 0);
148     bool canRun(ProjectExplorer::RunConfiguration *runConfiguration, const QString &mode) const;
149
150     ProjectExplorer::RunControl* create(ProjectExplorer::RunConfiguration *runConfiguration, const QString &mode);
151     QString displayName() const;
152     ProjectExplorer::RunConfigWidget *createConfigurationWidget(ProjectExplorer::RunConfiguration * /*runConfiguration */);
153 };
154
155 } // namespace Internal
156 } // namespace Qt4ProjectManager
157
158 #endif // S60DEVICERUNCONFIGURATION_H