local _AddonName, _EchoRaidTools = ...;


local module = _EchoRaidTools:GetModule("EditModeTools")
local specs

function module:GetSpecs()
    if specs then return specs end
    local ret = {}
    local classNum = 1
    local className, classFile = GetClassInfo(classNum)
    while className do
        for specNum = 1, 4 do
            local specID, specName, _, specIcon = GetSpecializationInfoForClassID(classNum, specNum)
            if not specID then break end
            table.insert(ret, {
                className = className,
                classFile = classFile,
                specID = specID,
                specName = specName,
                specIcon = specIcon,
            })
        end
        classNum = classNum + 1
        className, classFile = GetClassInfo(classNum)
    end
    specs = ret
    return specs
end

function module:GetEditModeProfiles()
    local profiles = {
        "Modern (Preset)",
        "Classic (Preset)",
    }
    local layoutInfo = C_EditMode.GetLayouts()
    local currentLayout = layoutInfo.activeLayout
    for i, layout in ipairs(layoutInfo.layouts) do
        table.insert(profiles,
            layout.layoutName
        )
    end
    return profiles, currentLayout
end
