aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/android/androiddeviceinfo.h
blob: cca9bc9609c1d7ed0d6c3b9bc6be16a73f4e69c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#pragma once

#include <QDebug>
#include <QMetaType>
#include <QString>
#include <QStringList>

#include <projectexplorer/devicesupport/idevice.h>

namespace Android::Internal {

class AndroidDeviceInfo
{
public:
    bool isValid() const { return !serialNumber.isEmpty() || !avdName.isEmpty(); }

    QString serialNumber;
    QString avdName;
    QStringList cpuAbi;
    int sdk = -1;
    ProjectExplorer::IDevice::DeviceState state = ProjectExplorer::IDevice::DeviceDisconnected;
    ProjectExplorer::IDevice::MachineType type = ProjectExplorer::IDevice::Emulator;
    Utils::FilePath avdPath;

private:
    friend bool operator<(const AndroidDeviceInfo &lhs, const AndroidDeviceInfo &rhs);
    friend bool operator==(const AndroidDeviceInfo &lhs, const AndroidDeviceInfo &rhs) = default;
    friend bool operator!=(const AndroidDeviceInfo &lhs, const AndroidDeviceInfo &rhs) = default;
    friend QDebug &operator<<(QDebug &stream, const AndroidDeviceInfo &device);
};

using AndroidDeviceInfoList = QList<AndroidDeviceInfo>;

} // namespace Android::Internal

Q_DECLARE_METATYPE(Android::Internal::AndroidDeviceInfo)