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-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
|