// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#pragma once

#include "../projectexplorer_export.h"

#include "idevice.h"

#include <memory>

namespace ProjectExplorer {
class ProjectExplorerPlugin;
class DesktopDevicePrivate;

namespace Internal {
class DesktopDeviceFactory;

#ifdef WITH_TESTS
QObject *createDesktopDeviceTest();
#endif
}

class PROJECTEXPLORER_EXPORT DesktopDevice : public IDevice
{
public:
    ~DesktopDevice() override;

    IDevice::DeviceInfo deviceInformation() const override;

    IDeviceWidget *createWidget() override;
    bool canCreateProcessModel() const override;
    QtTaskTree::ExecutableItem signalOperationRecipe(
        const ProjectExplorer::SignalOperationData &data,
        const QtTaskTree::Storage<Utils::Result<>> &resultStorage) const final;
    QUrl toolControlChannel(const ControlChannelHint &) const override;

    Utils::Result<> handlesFile(const Utils::FilePath &filePath) const override;
    Utils::Result<Utils::Environment> systemEnvironmentWithError() const override;
    Utils::Result<Utils::Environment> sourcedEnvironment(
        const Utils::FilePath &script) const override;

    Utils::FilePath rootPath() const override;
    Utils::FilePath filePath(const QString &pathOnDevice) const override;

    void initDeviceToolAspects() override;

protected:
    DesktopDevice();

    friend class ProjectExplorerPlugin;
    friend class Internal::DesktopDeviceFactory;

    std::unique_ptr<DesktopDevicePrivate> d;
};

} // namespace ProjectExplorer
