package me.qwq.doghouse.flexmark.ext.plantuml;

import org.jetbrains.annotations.NotNull;

import com.vladsch.flexmark.util.data.DataHolder;
import com.vladsch.flexmark.util.data.MutableDataHolder;
import com.vladsch.flexmark.util.data.MutableDataSetter;

public class PlantUMLOptions implements MutableDataSetter {

    final public boolean renderBlockPlantUML;
    final public String blockPlantUMLClass;
    final public String plantUMLLanguage;
    final public boolean imgReferrerPolicySameOrigin;
    final public boolean darkMode;
    final public boolean bothModes;
    final public String darkModeClass;
    
    @Override
    public @NotNull MutableDataHolder setIn(@NotNull MutableDataHolder dataHolder) {
        dataHolder.set(PlantUMLExtension.RENDER_BLOCK_PLANTUML, renderBlockPlantUML);
        dataHolder.set(PlantUMLExtension.BLOCK_PLANTUML_CLASS, blockPlantUMLClass);
        dataHolder.set(PlantUMLExtension.PLANTUML_LANGUAGE, plantUMLLanguage);
        dataHolder.set(PlantUMLExtension.IMG_REFERRER_POLICY_SAME_ORIGIN, imgReferrerPolicySameOrigin);
        dataHolder.set(PlantUMLExtension.DARK_MODE, darkMode);
        dataHolder.set(PlantUMLExtension.BOTH_MODES, bothModes);
        dataHolder.set(PlantUMLExtension.DARK_MODE_CLASS, darkModeClass);
        return dataHolder;
    }
    
    public PlantUMLOptions(DataHolder options) {
        renderBlockPlantUML = PlantUMLExtension.RENDER_BLOCK_PLANTUML.get(options);
        blockPlantUMLClass = PlantUMLExtension.BLOCK_PLANTUML_CLASS.get(options);
        plantUMLLanguage = PlantUMLExtension.PLANTUML_LANGUAGE.get(options);
        imgReferrerPolicySameOrigin = PlantUMLExtension.IMG_REFERRER_POLICY_SAME_ORIGIN.get(options);
        darkMode = PlantUMLExtension.DARK_MODE.get(options);
        bothModes = PlantUMLExtension.BOTH_MODES.get(options);
        darkModeClass = PlantUMLExtension.DARK_MODE_CLASS.get(options);
    }

}
