package epson.print.copy.Component.eremoteoperation;

import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

public class ERemoteCopyPhoto extends ERemoteCopy {

    public interface IRemoteCopyPhotoOptionsParameter extends ERemoteOperation.IRemoteOperationParameter {
        boolean default_as_fixed();

        ArrayList<ERemoteOperation.ERemoteParam> fixed_parameters();

        ERemoteOperation.ERemoteParam layout();

        ArrayList<ERemoteOperation.ERemoteParam> preferred_parameters();

        ERemoteOperation.ERemoteParam print_media_size();

        ERemoteOperation.ERemoteParam print_media_source();

        ERemoteOperation.ERemoteParam print_media_type();

        ERemoteOperation.ERemoteParam print_quality();

        ArrayList<ERemoteOperation.ERemoteParam> priority_order();

        ERemoteOperation.ERemoteParam x_apf();
    }

    public interface IRemoteCopyPhotoParameter extends ERemoteOperation.IRemoteOperationParameter {
        ERemoteOperation.ERemoteParam color_effects_type();

        ArrayList<String> copies();

        ERemoteOperation.ERemoteParam layout();

        ERemoteOperation.ERemoteParam print_media_size();

        ERemoteOperation.ERemoteParam print_media_source();

        ERemoteOperation.ERemoteParam print_media_type();

        ERemoteOperation.ERemoteParam print_quality();

        ERemoteOperation.ERemoteParam print_x_auto_pg();

        ERemoteOperation.ERemoteParam print_x_bleed();

        ArrayList<String> scan_area_height();

        ArrayList<String> scan_area_resolution();

        ArrayList<String> scan_area_width();

        ArrayList<String> scan_area_x();

        ArrayList<String> scan_area_y();

        int scan_count();

        ERemoteOperation.ERemoteParam x_apf();

        ERemoteOperation.ERemoteParam x_color_restoration();

        ArrayList<String> x_fit_gamma();

        ArrayList<String> x_fit_matrix();
    }

    public class ERemoteCopyPhotoOptionResult extends ERemoteCopy.ERemoteCopyOptionsResult {
        public ERemoteCopyPhotoOptionResult(JSONObject jSONObject) {
            super(jSONObject);
        }

        public ArrayList<ERemoteOperation.ERemoteParam> local_options(ERemoteOperation.ERemoteParam eRemoteParam) {
            ArrayList<ERemoteOperation.ERemoteParam> arrayList = new ArrayList<>();
            if (eRemoteParam == ERemoteOperation.ERemoteParam.color_effects_type) {
                arrayList.add(ERemoteOperation.ERemoteParam.color);
                arrayList.add(ERemoteOperation.ERemoteParam.monochrome_grayscale);
                return arrayList;
            } else if (eRemoteParam == ERemoteOperation.ERemoteParam.print_x_bleed) {
                arrayList.add(ERemoteOperation.ERemoteParam.standard);
                arrayList.add(ERemoteOperation.ERemoteParam.midium);
                arrayList.add(ERemoteOperation.ERemoteParam.minimum);
                return arrayList;
            } else if (eRemoteParam != ERemoteOperation.ERemoteParam.x_color_restoration) {
                return arrayList;
            } else {
                arrayList.add(ERemoteOperation.ERemoteParam.on);
                arrayList.add(ERemoteOperation.ERemoteParam.off);
                return arrayList;
            }
        }

        public ERemoteOperation.ERemoteParam local_default(ERemoteOperation.ERemoteParam eRemoteParam) {
            if (eRemoteParam == ERemoteOperation.ERemoteParam.color_effects_type) {
                return ERemoteOperation.ERemoteParam.color;
            }
            if (eRemoteParam == ERemoteOperation.ERemoteParam.print_x_bleed) {
                return ERemoteOperation.ERemoteParam.standard;
            }
            if (eRemoteParam == ERemoteOperation.ERemoteParam.x_color_restoration) {
                return ERemoteOperation.ERemoteParam.off;
            }
            return ERemoteOperation.ERemoteParam.x_null;
        }
    }

    public ERemoteCopy.ERemoteCopyResult copy(IRemoteCopyPhotoParameter iRemoteCopyPhotoParameter) {
        ERemoteOperation.ERemoteRequestBuilder requestCopyPhoto = ERemoteOperation.ERemoteRequestBuilder.requestCopyPhoto(this.hostIP, ERemoteOperation.RequestParam.copy, getRequestConnectionTimeout());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.client_id, iRemoteCopyPhotoParameter.client_id());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.layout, iRemoteCopyPhotoParameter.layout());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.print_media_type, iRemoteCopyPhotoParameter.print_media_type());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.print_media_size, iRemoteCopyPhotoParameter.print_media_size());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.print_quality, iRemoteCopyPhotoParameter.print_quality());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.print_media_source, iRemoteCopyPhotoParameter.print_media_source());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.x_apf, iRemoteCopyPhotoParameter.x_apf());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.x_color_restoration, iRemoteCopyPhotoParameter.x_color_restoration());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.color_effects_type, iRemoteCopyPhotoParameter.color_effects_type());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.scan_count, iRemoteCopyPhotoParameter.scan_count());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.copies, (List<String>) iRemoteCopyPhotoParameter.copies());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.scan_area_x, (List<String>) iRemoteCopyPhotoParameter.scan_area_x());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.scan_area_y, (List<String>) iRemoteCopyPhotoParameter.scan_area_y());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.scan_area_width, (List<String>) iRemoteCopyPhotoParameter.scan_area_width());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.scan_area_height, (List<String>) iRemoteCopyPhotoParameter.scan_area_height());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.scan_area_resolution, (List<String>) iRemoteCopyPhotoParameter.scan_area_resolution());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.print_x_bleed, iRemoteCopyPhotoParameter.print_x_bleed());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.print_x_auto_pg, iRemoteCopyPhotoParameter.print_x_auto_pg());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.x_fit_gamma, (List<String>) iRemoteCopyPhotoParameter.x_fit_gamma());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.x_fit_matrix, (List<String>) iRemoteCopyPhotoParameter.x_fit_matrix());
        ERemoteCopy.ERemoteCopyResult eRemoteCopyResult = new ERemoteCopy.ERemoteCopyResult(requestCopyPhoto.getRemoteRequest().execute());
        eRemoteCopyResult.setRemoteRequestBuilder(requestCopyPhoto);
        return eRemoteCopyResult;
    }

    public ERemoteCopyPhotoOptionResult getOptions(IRemoteCopyPhotoOptionsParameter iRemoteCopyPhotoOptionsParameter) {
        ERemoteOperation.ERemoteRequestBuilder requestCopyPhoto = ERemoteOperation.ERemoteRequestBuilder.requestCopyPhoto(this.hostIP, ERemoteOperation.RequestParam.get_options, getRequestConnectionTimeout());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.client_id, iRemoteCopyPhotoOptionsParameter.client_id());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.layout, iRemoteCopyPhotoOptionsParameter.layout());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.print_media_type, iRemoteCopyPhotoOptionsParameter.print_media_type());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.print_media_size, iRemoteCopyPhotoOptionsParameter.print_media_size());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.print_quality, iRemoteCopyPhotoOptionsParameter.print_quality());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.print_media_source, iRemoteCopyPhotoOptionsParameter.print_media_source());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.x_apf, iRemoteCopyPhotoOptionsParameter.x_apf());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.fixed_parameters, iRemoteCopyPhotoOptionsParameter.fixed_parameters());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.preferred_parameters, iRemoteCopyPhotoOptionsParameter.preferred_parameters());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.priority_order, iRemoteCopyPhotoOptionsParameter.priority_order());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.default_as_fixed, iRemoteCopyPhotoOptionsParameter.default_as_fixed());
        ERemoteCopyPhotoOptionResult eRemoteCopyPhotoOptionResult = new ERemoteCopyPhotoOptionResult(requestCopyPhoto.getRemoteRequest().execute());
        eRemoteCopyPhotoOptionResult.setRemoteRequestBuilder(requestCopyPhoto);
        return eRemoteCopyPhotoOptionResult;
    }

    public ERemoteCopyPhotoOptionResult getSelectableOptions() {
        ArrayList arrayList = new ArrayList();
        arrayList.add(ERemoteOperation.ERemoteParam.layout);
        arrayList.add(ERemoteOperation.ERemoteParam.print_media_size);
        arrayList.add(ERemoteOperation.ERemoteParam.print_media_type);
        arrayList.add(ERemoteOperation.ERemoteParam.x_apf);
        arrayList.add(ERemoteOperation.ERemoteParam.print_quality);
        arrayList.add(ERemoteOperation.ERemoteParam.print_media_source);
        ERemoteOperation.ERemoteRequestBuilder requestCopyPhoto = ERemoteOperation.ERemoteRequestBuilder.requestCopyPhoto(this.hostIP, ERemoteOperation.RequestParam.get_options, getRequestConnectionTimeout());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.client_id, ERemoteOperation.ERemoteParam.x_null.string);
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.layout, ERemoteOperation.ERemoteParam.x_null);
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.print_media_type, ERemoteOperation.ERemoteParam.x_null);
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.print_media_size, ERemoteOperation.ERemoteParam.x_null);
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.print_quality, ERemoteOperation.ERemoteParam.x_null);
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.print_media_source, ERemoteOperation.ERemoteParam.x_null);
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.x_apf, ERemoteOperation.ERemoteParam.x_null);
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.fixed_parameters, (ArrayList<ERemoteOperation.ERemoteParam>) new ArrayList());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.preferred_parameters, (ArrayList<ERemoteOperation.ERemoteParam>) new ArrayList());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.priority_order, (ArrayList<ERemoteOperation.ERemoteParam>) arrayList);
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.default_as_fixed, false);
        ERemoteCopyPhotoOptionResult eRemoteCopyPhotoOptionResult = new ERemoteCopyPhotoOptionResult(requestCopyPhoto.getRemoteRequest().execute());
        eRemoteCopyPhotoOptionResult.setRemoteRequestBuilder(requestCopyPhoto);
        return eRemoteCopyPhotoOptionResult;
    }

    public ERemoteCopy.ERemoteCopyStatusResult getStatus(ERemoteCopy.IRemoteCopyStatusParameter iRemoteCopyStatusParameter) {
        ERemoteOperation.ERemoteRequestBuilder requestCopyPhoto = ERemoteOperation.ERemoteRequestBuilder.requestCopyPhoto(this.hostIP, ERemoteOperation.RequestParam.get_status, getRequestConnectionTimeout());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.client_id, iRemoteCopyStatusParameter.client_id());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.keys, iRemoteCopyStatusParameter.keys());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.job_token, iRemoteCopyStatusParameter.job_token());
        ERemoteCopy.ERemoteCopyStatusResult eRemoteCopyStatusResult = new ERemoteCopy.ERemoteCopyStatusResult(requestCopyPhoto.getRemoteRequest().execute());
        eRemoteCopyStatusResult.setRemoteRequestBuilder(requestCopyPhoto);
        return eRemoteCopyStatusResult;
    }

    public ERemoteOperation.ERemoteReasonResult cancel(ERemoteCopy.IRemoteCancelParameter iRemoteCancelParameter) {
        ERemoteOperation.ERemoteRequestBuilder requestCopyPhoto = ERemoteOperation.ERemoteRequestBuilder.requestCopyPhoto(this.hostIP, ERemoteOperation.RequestParam.cancel, getRequestConnectionTimeout());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.client_id, iRemoteCancelParameter.client_id());
        requestCopyPhoto.add(ERemoteOperation.ERemoteParam.job_token, iRemoteCancelParameter.job_token());
        ERemoteOperation.ERemoteReasonResult eRemoteReasonResult = new ERemoteOperation.ERemoteReasonResult(requestCopyPhoto.getRemoteRequest().execute());
        eRemoteReasonResult.setRemoteRequestBuilder(requestCopyPhoto);
        return eRemoteReasonResult;
    }
}
