2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2013-04-25 16:02:17 +02:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2013-04-25 16:02:17 +02:00
|
|
|
|
2016-04-19 16:43:30 +02:00
|
|
|
#include <utils/port.h>
|
|
|
|
|
|
2013-04-25 16:02:17 +02:00
|
|
|
#include <QObject>
|
|
|
|
|
#include <QMap>
|
|
|
|
|
#include <QString>
|
|
|
|
|
#include <QStringList>
|
|
|
|
|
|
|
|
|
|
namespace Ios {
|
2014-11-12 19:41:59 +01:00
|
|
|
namespace Internal {
|
|
|
|
|
class IosToolHandlerPrivate;
|
|
|
|
|
class IosDeviceType;
|
|
|
|
|
}
|
2013-04-25 16:02:17 +02:00
|
|
|
|
|
|
|
|
class IosToolHandler : public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2018-11-12 19:55:59 +01:00
|
|
|
using Dict = QMap<QString,QString>;
|
2013-04-25 16:02:17 +02:00
|
|
|
enum RunKind {
|
|
|
|
|
NormalRun,
|
|
|
|
|
DebugRun
|
|
|
|
|
};
|
|
|
|
|
enum OpStatus {
|
|
|
|
|
Success = 0,
|
|
|
|
|
Unknown = 1,
|
|
|
|
|
Failure = 2
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static QString iosDeviceToolPath();
|
2013-10-08 15:27:45 +02:00
|
|
|
|
2018-11-12 19:55:59 +01:00
|
|
|
explicit IosToolHandler(const Internal::IosDeviceType &type, QObject *parent = nullptr);
|
|
|
|
|
~IosToolHandler() override;
|
2013-04-25 16:02:17 +02:00
|
|
|
void requestTransferApp(const QString &bundlePath, const QString &deviceId, int timeout = 1000);
|
|
|
|
|
void requestRunApp(const QString &bundlePath, const QStringList &extraArgs, RunKind runType,
|
|
|
|
|
const QString &deviceId, int timeout = 1000);
|
|
|
|
|
void requestDeviceInfo(const QString &deviceId, int timeout = 1000);
|
2017-06-02 09:23:46 +02:00
|
|
|
bool isRunning() const;
|
2016-06-29 19:35:23 +03:00
|
|
|
void stop();
|
|
|
|
|
|
2013-04-25 16:02:17 +02:00
|
|
|
signals:
|
|
|
|
|
void isTransferringApp(Ios::IosToolHandler *handler, const QString &bundlePath,
|
|
|
|
|
const QString &deviceId, int progress, int maxProgress,
|
|
|
|
|
const QString &info);
|
|
|
|
|
void didTransferApp(Ios::IosToolHandler *handler, const QString &bundlePath,
|
|
|
|
|
const QString &deviceId, Ios::IosToolHandler::OpStatus status);
|
|
|
|
|
void didStartApp(Ios::IosToolHandler *handler, const QString &bundlePath,
|
|
|
|
|
const QString &deviceId, Ios::IosToolHandler::OpStatus status);
|
2014-02-25 22:48:19 +01:00
|
|
|
void gotServerPorts(Ios::IosToolHandler *handler, const QString &bundlePath,
|
2016-04-19 16:43:30 +02:00
|
|
|
const QString &deviceId, Utils::Port gdbPort, Utils::Port qmlPort);
|
2013-04-25 16:02:17 +02:00
|
|
|
void gotInferiorPid(Ios::IosToolHandler *handler, const QString &bundlePath,
|
2015-09-11 13:13:04 +02:00
|
|
|
const QString &deviceId, qint64 pid);
|
2013-04-25 16:02:17 +02:00
|
|
|
void deviceInfo(Ios::IosToolHandler *handler, const QString &deviceId,
|
|
|
|
|
const Ios::IosToolHandler::Dict &info);
|
|
|
|
|
void appOutput(Ios::IosToolHandler *handler, const QString &output);
|
|
|
|
|
void errorMsg(Ios::IosToolHandler *handler, const QString &msg);
|
|
|
|
|
void toolExited(Ios::IosToolHandler *handler, int code);
|
|
|
|
|
void finished(Ios::IosToolHandler *handler);
|
2016-09-26 12:40:09 +02:00
|
|
|
|
2013-04-25 16:02:17 +02:00
|
|
|
private:
|
|
|
|
|
friend class Ios::Internal::IosToolHandlerPrivate;
|
|
|
|
|
Ios::Internal::IosToolHandlerPrivate *d;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Ios
|