2013-04-25 16:02:17 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2013-04-25 16:02:17 +02:00
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator.
|
|
|
|
|
**
|
|
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2013-04-25 16:02:17 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2013-04-25 16:02:17 +02:00
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
2016-01-15 14:57:40 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2013-04-25 16:02:17 +02:00
|
|
|
|
|
|
|
|
#include <projectexplorer/devicesupport/idevice.h>
|
2019-02-20 19:13:28 +01:00
|
|
|
#include <projectexplorer/devicesupport/idevicefactory.h>
|
|
|
|
|
|
2013-04-25 16:02:17 +02:00
|
|
|
#include <utils/fileutils.h>
|
|
|
|
|
|
2014-11-12 19:41:59 +01:00
|
|
|
#include <QDebug>
|
2013-04-25 16:02:17 +02:00
|
|
|
|
|
|
|
|
namespace Ios {
|
|
|
|
|
namespace Internal {
|
2019-02-21 14:36:14 +01:00
|
|
|
|
2013-04-25 16:02:17 +02:00
|
|
|
class IosConfigurations;
|
|
|
|
|
class IosSimulatorFactory;
|
|
|
|
|
|
2019-02-21 14:36:14 +01:00
|
|
|
class IosDeviceType
|
|
|
|
|
{
|
2014-11-12 19:41:59 +01:00
|
|
|
public:
|
|
|
|
|
enum Type {
|
|
|
|
|
IosDevice,
|
|
|
|
|
SimulatedDevice
|
|
|
|
|
};
|
|
|
|
|
IosDeviceType(Type type = IosDevice, const QString &identifier = QString(),
|
|
|
|
|
const QString &displayName = QString());
|
|
|
|
|
|
|
|
|
|
bool fromMap(const QVariantMap &map);
|
|
|
|
|
QVariantMap toMap() const;
|
|
|
|
|
|
|
|
|
|
bool operator ==(const IosDeviceType &o) const;
|
|
|
|
|
bool operator !=(const IosDeviceType &o) const { return !(*this == o); }
|
|
|
|
|
bool operator <(const IosDeviceType &o) const;
|
|
|
|
|
|
|
|
|
|
Type type;
|
|
|
|
|
QString identifier;
|
|
|
|
|
QString displayName;
|
|
|
|
|
};
|
2019-02-21 14:36:14 +01:00
|
|
|
|
2014-11-12 19:41:59 +01:00
|
|
|
QDebug operator <<(QDebug debug, const IosDeviceType &deviceType);
|
|
|
|
|
|
2020-01-21 16:17:59 +01:00
|
|
|
class IosSimulator final : public ProjectExplorer::IDevice
|
2013-04-25 16:02:17 +02:00
|
|
|
{
|
2020-01-21 16:17:59 +01:00
|
|
|
Q_DECLARE_TR_FUNCTIONS(Ios::Internal::IosSimulator)
|
|
|
|
|
|
2013-04-25 16:02:17 +02:00
|
|
|
public:
|
2018-11-12 19:55:59 +01:00
|
|
|
using ConstPtr = QSharedPointer<const IosSimulator>;
|
|
|
|
|
using Ptr = QSharedPointer<IosSimulator>;
|
2015-06-03 15:32:21 +02:00
|
|
|
ProjectExplorer::IDevice::DeviceInfo deviceInformation() const override;
|
2013-04-25 16:02:17 +02:00
|
|
|
|
2015-06-03 15:32:21 +02:00
|
|
|
ProjectExplorer::IDeviceWidget *createWidget() override;
|
|
|
|
|
ProjectExplorer::DeviceProcessSignalOperation::Ptr signalOperation() const override;
|
2016-04-19 16:43:30 +02:00
|
|
|
Utils::Port nextPort() const;
|
2015-06-03 15:32:21 +02:00
|
|
|
bool canAutoDetectPorts() const override;
|
2013-04-25 16:02:17 +02:00
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
friend class IosSimulatorFactory;
|
|
|
|
|
friend class IosConfigurations;
|
|
|
|
|
IosSimulator();
|
2020-06-26 13:59:38 +02:00
|
|
|
IosSimulator(Utils::Id id);
|
2019-05-07 12:44:45 +02:00
|
|
|
|
2013-04-25 16:02:17 +02:00
|
|
|
private:
|
2014-02-25 16:02:02 +01:00
|
|
|
mutable quint16 m_lastPort;
|
2013-04-25 16:02:17 +02:00
|
|
|
};
|
|
|
|
|
|
2020-01-21 16:17:59 +01:00
|
|
|
class IosSimulatorFactory final : public ProjectExplorer::IDeviceFactory
|
2019-02-20 19:13:28 +01:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
IosSimulatorFactory();
|
|
|
|
|
};
|
|
|
|
|
|
2013-04-25 16:02:17 +02:00
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Ios
|
|
|
|
|
|
2014-11-12 19:41:59 +01:00
|
|
|
Q_DECLARE_METATYPE(Ios::Internal::IosDeviceType)
|