// SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
// SPDX-FileCopyrightText: 2024 Arjen Hiemstra <ahiemstra@heimr.nl>
//
// This file is automatically generated from CreateTestInstances.h.j2.
// To regenerate, run `tools/propertygenerator/generate_properties.py`.

#pragma once

#include <QtTest>

#include <properties/AlignmentPropertyGroup.h>
#include <properties/BackgroundPropertyGroup.h>
#include <properties/BorderPropertyGroup.h>
#include <properties/CornerPropertyGroup.h>
#include <properties/CornersPropertyGroup.h>
#include <properties/DisplayPropertyGroup.h>
#include <properties/IconPropertyGroup.h>
#include <properties/ImagePropertyGroup.h>
#include <properties/LayoutPropertyGroup.h>
#include <properties/LinePropertyGroup.h>
#include <properties/OffsetPropertyGroup.h>
#include <properties/OutlinePropertyGroup.h>
#include <properties/ShadowPropertyGroup.h>
#include <properties/SizePropertyGroup.h>
#include <properties/StylePropertyGroup.h>
#include <properties/TextPropertyGroup.h>

using namespace Qt::StringLiterals;

namespace Union
{
namespace Properties
{

QColor testQColorInstance()
{
    return Qt::magenta;
}

qreal testQrealInstance()
{
    return 10.0;
}

QFont testQFontInstance()
{
    return QFont{u"Noto Sans"_s, 12};
}

std::unique_ptr<StylePropertyGroup> testStylePropertyGroupInstance();
std::unique_ptr<SizePropertyGroup> testSizePropertyGroupInstance();
std::unique_ptr<AlignmentPropertyGroup> testAlignmentPropertyGroupInstance();
std::unique_ptr<ImagePropertyGroup> testImagePropertyGroupInstance();
std::unique_ptr<LinePropertyGroup> testLinePropertyGroupInstance();
std::unique_ptr<CornerPropertyGroup> testCornerPropertyGroupInstance();
std::unique_ptr<DisplayPropertyGroup> testDisplayPropertyGroupInstance();
std::unique_ptr<LayoutPropertyGroup> testLayoutPropertyGroupInstance();
std::unique_ptr<TextPropertyGroup> testTextPropertyGroupInstance();
std::unique_ptr<IconPropertyGroup> testIconPropertyGroupInstance();
std::unique_ptr<BackgroundPropertyGroup> testBackgroundPropertyGroupInstance();
std::unique_ptr<BorderPropertyGroup> testBorderPropertyGroupInstance();
std::unique_ptr<OutlinePropertyGroup> testOutlinePropertyGroupInstance();
std::unique_ptr<CornersPropertyGroup> testCornersPropertyGroupInstance();
std::unique_ptr<ShadowPropertyGroup> testShadowPropertyGroupInstance();
std::unique_ptr<OffsetPropertyGroup> testOffsetPropertyGroupInstance();

std::unique_ptr<StylePropertyGroup> testStylePropertyGroupInstance()
{
    auto instance = std::make_unique<StylePropertyGroup>();

    instance->setDisplay(testDisplayPropertyGroupInstance());
    instance->setLayout(testLayoutPropertyGroupInstance());
    instance->setText(testTextPropertyGroupInstance());
    instance->setIcon(testIconPropertyGroupInstance());
    instance->setBackground(testBackgroundPropertyGroupInstance());
    instance->setBorder(testBorderPropertyGroupInstance());
    instance->setOutline(testOutlinePropertyGroupInstance());
    instance->setCorners(testCornersPropertyGroupInstance());
    instance->setShadow(testShadowPropertyGroupInstance());

    return instance;
}

std::unique_ptr<SizePropertyGroup> testSizePropertyGroupInstance()
{
    auto instance = std::make_unique<SizePropertyGroup>();

    instance->setLeft(testQrealInstance());
    instance->setRight(testQrealInstance());
    instance->setTop(testQrealInstance());
    instance->setBottom(testQrealInstance());

    return instance;
}

std::unique_ptr<AlignmentPropertyGroup> testAlignmentPropertyGroupInstance()
{
    auto instance = std::make_unique<AlignmentPropertyGroup>();

    instance->setContainer(Union::Properties::AlignmentContainer{});
    instance->setHorizontal(Union::Properties::Alignment{});
    instance->setVertical(Union::Properties::Alignment{});
    instance->setOrder(int{});

    return instance;
}

std::unique_ptr<ImagePropertyGroup> testImagePropertyGroupInstance()
{
    auto instance = std::make_unique<ImagePropertyGroup>();

    instance->setSource(std::filesystem::path{});
    instance->setWidth(testQrealInstance());
    instance->setHeight(testQrealInstance());
    instance->setXOffset(testQrealInstance());
    instance->setYOffset(testQrealInstance());
    instance->setFlags(Union::Properties::ImageFlags{});
    instance->setMaskColor(Union::Color{});

    return instance;
}

std::unique_ptr<LinePropertyGroup> testLinePropertyGroupInstance()
{
    auto instance = std::make_unique<LinePropertyGroup>();

    instance->setSize(testQrealInstance());
    instance->setColor(Union::Color{});
    instance->setStyle(Union::Properties::LineStyle{});

    return instance;
}

std::unique_ptr<CornerPropertyGroup> testCornerPropertyGroupInstance()
{
    auto instance = std::make_unique<CornerPropertyGroup>();

    instance->setRadius(testQrealInstance());

    return instance;
}

std::unique_ptr<DisplayPropertyGroup> testDisplayPropertyGroupInstance()
{
    auto instance = std::make_unique<DisplayPropertyGroup>();

    instance->setVisible(bool{});
    instance->setOpacity(testQrealInstance());

    return instance;
}

std::unique_ptr<LayoutPropertyGroup> testLayoutPropertyGroupInstance()
{
    auto instance = std::make_unique<LayoutPropertyGroup>();

    instance->setAlignment(testAlignmentPropertyGroupInstance());
    instance->setWidth(testQrealInstance());
    instance->setHeight(testQrealInstance());
    instance->setSpacing(testQrealInstance());
    instance->setPadding(testSizePropertyGroupInstance());
    instance->setInset(testSizePropertyGroupInstance());
    instance->setMargins(testSizePropertyGroupInstance());

    return instance;
}

std::unique_ptr<TextPropertyGroup> testTextPropertyGroupInstance()
{
    auto instance = std::make_unique<TextPropertyGroup>();

    instance->setAlignment(testAlignmentPropertyGroupInstance());
    instance->setFont(testQFontInstance());
    instance->setColor(Union::Color{});
    instance->setWrapMode(Union::Properties::TextWrapMode{});
    instance->setElide(Union::Properties::TextElide{});

    return instance;
}

std::unique_ptr<IconPropertyGroup> testIconPropertyGroupInstance()
{
    auto instance = std::make_unique<IconPropertyGroup>();

    instance->setAlignment(testAlignmentPropertyGroupInstance());
    instance->setWidth(testQrealInstance());
    instance->setHeight(testQrealInstance());
    instance->setName(QString{});
    instance->setSource(QUrl{});
    instance->setColor(Union::Color{});

    return instance;
}

std::unique_ptr<BackgroundPropertyGroup> testBackgroundPropertyGroupInstance()
{
    auto instance = std::make_unique<BackgroundPropertyGroup>();

    instance->setColor(Union::Color{});
    instance->setImage(testImagePropertyGroupInstance());

    return instance;
}

std::unique_ptr<BorderPropertyGroup> testBorderPropertyGroupInstance()
{
    auto instance = std::make_unique<BorderPropertyGroup>();

    instance->setLeft(testLinePropertyGroupInstance());
    instance->setRight(testLinePropertyGroupInstance());
    instance->setTop(testLinePropertyGroupInstance());
    instance->setBottom(testLinePropertyGroupInstance());

    return instance;
}

std::unique_ptr<OutlinePropertyGroup> testOutlinePropertyGroupInstance()
{
    auto instance = std::make_unique<OutlinePropertyGroup>();

    instance->setLeft(testLinePropertyGroupInstance());
    instance->setRight(testLinePropertyGroupInstance());
    instance->setTop(testLinePropertyGroupInstance());
    instance->setBottom(testLinePropertyGroupInstance());

    return instance;
}

std::unique_ptr<CornersPropertyGroup> testCornersPropertyGroupInstance()
{
    auto instance = std::make_unique<CornersPropertyGroup>();

    instance->setTopLeft(testCornerPropertyGroupInstance());
    instance->setTopRight(testCornerPropertyGroupInstance());
    instance->setBottomLeft(testCornerPropertyGroupInstance());
    instance->setBottomRight(testCornerPropertyGroupInstance());

    return instance;
}

std::unique_ptr<ShadowPropertyGroup> testShadowPropertyGroupInstance()
{
    auto instance = std::make_unique<ShadowPropertyGroup>();

    instance->setOffset(testOffsetPropertyGroupInstance());
    instance->setColor(Union::Color{});
    instance->setSize(testQrealInstance());
    instance->setBlur(testQrealInstance());

    return instance;
}

std::unique_ptr<OffsetPropertyGroup> testOffsetPropertyGroupInstance()
{
    auto instance = std::make_unique<OffsetPropertyGroup>();

    instance->setHorizontal(testQrealInstance());
    instance->setVertical(testQrealInstance());

    return instance;
}
}
}