package top.r3944realms.docchecktoolrefactored.core;

import org.intellij.lang.annotations.MagicConstant;

import java.io.File;

public interface AddressFileGenerator {
    /**
     * 页面级 JPG那种
     */
    int PAGE_TYPE = 1;
    /**
     * 文件级 PDF那种
     */
    int FILE_TYPE = 2;

    /**
    * 进度回调接口
    */

    interface ProgressCallback {
        default void onPhaseStarted(Phase phase) {}
        default void onPhaseProgress(Phase phase, int current, int total) {}
        default void onPhaseCompleted(Phase phase) {}
    }
    enum Phase {
        GENERATE_LOGICAL,
        GENERATE_PHYSICAL
    }
    void setProgressCallback(ProgressCallback callback);

    /**
     * 生成地址文件
     *
     * @param folderPath 文件夹路径
     * @param outputFile 输出文件
     * @param folderType 文件夹类型 ({@link AddressFileGenerator#PAGE_TYPE "页面级"} 或 {@link AddressFileGenerator#FILE_TYPE "文件级"})
     */
    void generateAddressFile(
            String folderPath,
            File outputFile,
            @MagicConstant(intValues = {PAGE_TYPE, FILE_TYPE}) int folderType
    );
}
