/*
    SPDX-FileCopyrightText: 2025 Friedrich W. H. Kossebau <kossebau@kde.org>

    SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/

#include "bytearraydeflatestreamcompressorconfigeditorfactory.hpp"

// lib
#include "bytearraydeflatestreamcompressorconfigeditor.hpp"
#include "bytearraydeflatestreamcompressor.hpp"

namespace Kasten {

ByteArrayDeflateStreamCompressorConfigEditorFactory::ByteArrayDeflateStreamCompressorConfigEditorFactory() = default;

ByteArrayDeflateStreamCompressorConfigEditorFactory::~ByteArrayDeflateStreamCompressorConfigEditorFactory() = default;

std::unique_ptr<AbstractModelStreamEncoderConfigEditor> ByteArrayDeflateStreamCompressorConfigEditorFactory::tryCreateConfigEditor(AbstractModelStreamEncoder* encoder) const
{
    std::unique_ptr<AbstractModelStreamEncoderConfigEditor> result;
    auto* const srecStreamCompressor = qobject_cast<ByteArrayDeflateStreamCompressor*>(encoder);

    if (srecStreamCompressor) {
        result = std::make_unique<ByteArrayDeflateStreamCompressorConfigEditor>(srecStreamCompressor);
    }

    return result;
}

}
