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 QEMURUNTIMEMANAGER_H
35 #define QEMURUNTIMEMANAGER_H
37 #include "maemoconstants.h"
38 #include "maemoqemuruntime.h"
40 #include <QtCore/QMap>
41 #include <QtCore/QObject>
42 #include <QtCore/QProcess>
44 #include <QtGui/QIcon>
46 QT_FORWARD_DECLARE_CLASS(QAction)
47 QT_FORWARD_DECLARE_CLASS(QFileSystemWatcher)
48 QT_FORWARD_DECLARE_CLASS(QStringList)
50 namespace ProjectExplorer {
51 class BuildConfiguration;
53 class RunConfiguration;
57 namespace Qt4ProjectManager {
60 class MaemoRunConfiguration;
63 class MaemoQemuManager : public QObject
68 static MaemoQemuManager& instance(QObject *parent = 0);
70 bool runtimeForQtVersion(int uniqueId, MaemoQemuRuntime *rt) const;
73 void qemuProcessStatus(QemuStatus, const QString &error = QString());
76 void qtVersionsChanged(const QList<int> &uniqueIds);
78 void projectAdded(ProjectExplorer::Project *project);
79 void projectRemoved(ProjectExplorer::Project *project);
80 void projectChanged(ProjectExplorer::Project *project);
82 void targetAdded(ProjectExplorer::Target *target);
83 void targetRemoved(ProjectExplorer::Target *target);
84 void targetChanged(ProjectExplorer::Target *target);
86 void runConfigurationAdded(ProjectExplorer::RunConfiguration *rc);
87 void runConfigurationRemoved(ProjectExplorer::RunConfiguration *rc);
88 void runConfigurationChanged(ProjectExplorer::RunConfiguration *rc);
90 void buildConfigurationAdded(ProjectExplorer::BuildConfiguration *bc);
91 void buildConfigurationRemoved(ProjectExplorer::BuildConfiguration *bc);
92 void buildConfigurationChanged(ProjectExplorer::BuildConfiguration *bc);
94 void environmentChanged(); // needed to check for qt version
95 void deviceConfigurationChanged(ProjectExplorer::Target *target);
98 void terminateRuntime();
100 void qemuProcessFinished();
101 void qemuProcessError(QProcess::ProcessError error);
102 void qemuStatusChanged(QemuStatus status, const QString &error);
105 void runtimeRootChanged(const QString &directory);
106 void runtimeFolderChanged(const QString &directory);
109 MaemoQemuManager(QObject *parent);
112 bool sessionHasMaemoTarget() const;
114 void updateStarterIcon(bool running);
115 void toggleStarterButton(ProjectExplorer::Target *target);
116 bool targetUsesMatchingRuntimeConfig(ProjectExplorer::Target *target,
117 QtVersion **qtVersion = 0);
119 void notify(const QList<int> uniqueIds);
120 void toggleDeviceConnections(MaemoRunConfiguration *mrc, bool connect);
123 QAction *m_qemuAction;
124 QProcess *m_qemuProcess;
127 bool m_userTerminated;
128 QIcon m_qemuStarterIcon;
129 QMap<int, MaemoQemuRuntime> m_runtimes;
130 static MaemoQemuManager *m_instance;
131 QFileSystemWatcher *m_runtimeRootWatcher;
132 QFileSystemWatcher *m_runtimeFolderWatcher;
135 } // namespace Internal
136 } // namespace Qt4ProjectManager
138 #endif // QEMURUNTIMEMANAGER_H