package com.epson.iprint.shared;

import android.content.Intent;
import android.os.Bundle;

public class ExtSharedParam {
    private String file_name = null;
    private String folder_name = null;
    private boolean isValid = false;
    private String package_name = null;
    private int pixel_main = 0;
    private int pixel_sub = 0;
    private int res_main = 0;
    private int res_sub = 0;
    private int scan_mode = 0;
    private int scan_type = 0;

    public void setParam(Bundle bundle) {
        scan_type = bundle.getInt("SCAN_TYPE");
        pixel_main = bundle.getInt("PIXEL_MAIN");
        pixel_sub = bundle.getInt("PIXEL_SUB");
        res_main = bundle.getInt("RES_MAIN");
        res_sub = bundle.getInt("RES_SUB");
        folder_name = bundle.getString("FOLDER_NAME");
        file_name = bundle.getString("FILE_NAME");
        scan_mode = bundle.getInt("SCAN_MODE");
        package_name = bundle.getString(EpsoniPrintSharedActivity.PARAM_KEY_CALLER_PACKAGE_NAME);
        isValid = true;
    }

    public void setParam(Intent intent) {
        Bundle extras = intent.getExtras();
        scan_type = extras.getInt("SCAN_TYPE");
        pixel_main = extras.getInt("PIXEL_MAIN");
        pixel_sub = extras.getInt("PIXEL_SUB");
        res_main = extras.getInt("RES_MAIN");
        res_sub = extras.getInt("RES_SUB");
        folder_name = extras.getString("FOLDER_NAME");
        file_name = extras.getString("FILE_NAME");
        scan_mode = extras.getInt("SCAN_MODE");
        package_name = extras.getString(EpsoniPrintSharedActivity.PARAM_KEY_CALLER_PACKAGE_NAME);
        isValid = true;
    }

    public boolean isAvailable() {
        return isValid;
    }

    public int getScan_type() {
        return scan_type;
    }

    public int getPixel_main() {
        return pixel_main;
    }

    public int getPixel_sub() {
        return pixel_sub;
    }

    public int getRes_main() {
        return res_main;
    }

    public int getRes_sub() {
        return res_sub;
    }

    public String getFolder_name() {
        return folder_name;
    }

    public String getFile_name() {
        return file_name;
    }

    public int getScan_mode() {
        return scan_mode;
    }

    public String getPackage_name() {
        return package_name;
    }
}
