package com.easyagents.document.core.entity;

/**
 * PPTX 解析请求。
 *
 * @author Codex
 * @since 2026-04-16
 */
public class PptxParseRequest extends ParseRequest {

    private Integer startSlideIndex = 0;
    private Integer endSlideIndex;
    private Double renderScale = 2.0d;
    private String imageFormat = "png";
    private Boolean includeSlideImageReference = true;

    /**
     * 将通用请求转换为 PPTX 请求。
     *
     * @param request 原始请求
     * @return PPTX 请求
     */
    public static PptxParseRequest from(ParseRequest request) {
        PptxParseRequest pptxParseRequest = new PptxParseRequest();
        if (request == null) {
            return pptxParseRequest;
        }
        request.copyCommonFieldsTo(pptxParseRequest);
        if (request instanceof PptxParseRequest) {
            PptxParseRequest source = (PptxParseRequest) request;
            pptxParseRequest.setStartSlideIndex(source.getStartSlideIndex());
            pptxParseRequest.setEndSlideIndex(source.getEndSlideIndex());
            pptxParseRequest.setRenderScale(source.getRenderScale());
            pptxParseRequest.setImageFormat(source.getImageFormat());
            pptxParseRequest.setIncludeSlideImageReference(source.getIncludeSlideImageReference());
        }
        return pptxParseRequest;
    }

    public Integer getStartSlideIndex() {
        return startSlideIndex;
    }

    public void setStartSlideIndex(Integer startSlideIndex) {
        this.startSlideIndex = startSlideIndex;
    }

    public Integer getEndSlideIndex() {
        return endSlideIndex;
    }

    public void setEndSlideIndex(Integer endSlideIndex) {
        this.endSlideIndex = endSlideIndex;
    }

    public Double getRenderScale() {
        return renderScale;
    }

    public void setRenderScale(Double renderScale) {
        this.renderScale = renderScale;
    }

    public String getImageFormat() {
        return imageFormat;
    }

    public void setImageFormat(String imageFormat) {
        this.imageFormat = imageFormat;
    }

    public Boolean getIncludeSlideImageReference() {
        return includeSlideImageReference;
    }

    public void setIncludeSlideImageReference(Boolean includeSlideImageReference) {
        this.includeSlideImageReference = includeSlideImageReference;
    }
}
