Program Listing for File ZagalaSpecDocumentRow.h#

↰ Return to documentation for file (ZagalaSpecEditor/Public/Document/ZagalaSpecDocumentRow.h)

// Copyright (c) 2026, Zagala Game Solutions. All rights reserved.

#pragma once

#include "CoreMinimal.h"
#include "UObject/WeakObjectPtrTemplates.h"

struct ZAGALASPECEDITOR_API FZagalaSpecDocumentRowSegment
{
    FString Text;

    FName Style;
};

struct ZAGALASPECEDITOR_API FZagalaSpecDocumentRowOwnership
{
    TWeakObjectPtr<UObject> Owner;

    FName ArrayPropertyName;

    int32 Index = INDEX_NONE;

    bool HasArrayLocation() const
    {
        return Owner.IsValid() && !ArrayPropertyName.IsNone() && Index != INDEX_NONE;
    }
};

struct ZAGALASPECEDITOR_API FZagalaSpecDocumentRow
{
    FName RowType;

    TArray<FZagalaSpecDocumentRowSegment> Segments;

    int32 IndentLevel = 0;

    TWeakObjectPtr<UObject> DetailsObject;

    TWeakObjectPtr<UObject> SectionKey;

    FZagalaSpecDocumentRowOwnership Ownership;

    FZagalaSpecDocumentRow& AddSegment(const FString& Text, const FName Style);

    FString GetPlainText() const;
};

using FZagalaSpecDocumentRowPtr = TSharedPtr<FZagalaSpecDocumentRow>;