HostPseudoModelScript.java 11.8 KB
/*
 * Decompiled with CFR 0_118.
 */
package com.adobe.xfa;

import com.adobe.xfa.*;
import com.adobe.xfa.ut.ExFull;
import com.adobe.xfa.ut.ResId;

import java.util.ArrayList;
import java.util.StringTokenizer;

public class HostPseudoModelScript
extends PseudoModelScript {
    protected static final ScriptTable moScriptTable = new ScriptTable(PseudoModelScript.moScriptTable, "hostPseudoModel", new ScriptPropObj[]{new ScriptPropObj(HostPseudoModelScript.class, "appType", "getAppType", null, 6, 21, 9, 0), new ScriptPropObj(HostPseudoModelScript.class, "currentPage", "getCurrentPage", "setCurrentPage", 4, 21, 63, 0), new ScriptPropObj(HostPseudoModelScript.class, "language", "getLanguage", null, 6, 21, 9, 0), new ScriptPropObj(HostPseudoModelScript.class, "name", "getName", null, 6, 21, 63, 0), new ScriptPropObj(HostPseudoModelScript.class, "numPages", "getNumPages", null, 4, 21, 63, 0), new ScriptPropObj(HostPseudoModelScript.class, "platform", "getPlatform", null, 6, 21, 9, 0), new ScriptPropObj(HostPseudoModelScript.class, "title", "getTitle", "setTitle", 6, 21, 9, 0), new ScriptPropObj(HostPseudoModelScript.class, "variation", "getVariation", null, 6, 21, 9, 0), new ScriptPropObj(HostPseudoModelScript.class, "version", "getVersion", null, 6, 21, 9, 0), new ScriptPropObj(HostPseudoModelScript.class, "calculationsEnabled", "getCalculationsEnabled", "setCalculationsEnabled", 3, 21, 63, 0), new ScriptPropObj(HostPseudoModelScript.class, "validationsEnabled", "getValidationsEnabled", "setValidationsEnabled", 3, 21, 63, 0)}, new ScriptFuncObj[]{new ScriptFuncObj(HostPseudoModelScript.class, "beep", "beep", 1, new int[]{4}, 0, 21, 9, 0), new ScriptFuncObj(HostPseudoModelScript.class, "currentDateTime", "getCurrentDateTime", 6, new int[0], 0, 28, 9, 0), new ScriptFuncObj(HostPseudoModelScript.class, "documentInBatch", "getDocumentInBatch", 4, new int[0], 0, 25, 9, 0), new ScriptFuncObj(HostPseudoModelScript.class, "documentCountInBatch", "getDocumentCountInBatch", 4, new int[0], 0, 25, 9, 0), new ScriptFuncObj(HostPseudoModelScript.class, "exportData", "exportData", 1, new int[]{6, 3}, 0, 21, 9, 0), new ScriptFuncObj(HostPseudoModelScript.class, "gotoURL", "gotoURL", 1, new int[]{6, 3}, 1, 21, 63, 0), new ScriptFuncObj(HostPseudoModelScript.class, "importData", "importData", 1, new int[]{6}, 0, 21, 9, "importDataPermsCheck", 0), new ScriptFuncObj(HostPseudoModelScript.class, "messageBox", "messageBox", 4, new int[]{6, 6, 4, 4}, 1, 21, 63, 0), new ScriptFuncObj(HostPseudoModelScript.class, "pageDown", "pageDown", 1, new int[0], 0, 21, 63, 0), new ScriptFuncObj(HostPseudoModelScript.class, "pageUp", "pageUp", 1, new int[0], 0, 21, 63, 0), new ScriptFuncObj(HostPseudoModelScript.class, "print", "print", 1, new int[]{3, 6, 6, 3, 3, 3, 3, 3}, 8, 21, 9, 0), new ScriptFuncObj(HostPseudoModelScript.class, "response", "response", 0, new int[]{6, 6, 6, 3}, 1, 21, 9, 0), new ScriptFuncObj(HostPseudoModelScript.class, "setFocus", "setFocus", 1, new int[]{0}, 0, 21, 63, 0), new ScriptFuncObj(HostPseudoModelScript.class, "resetData", "resetData", 1, new int[]{6}, 0, 21, 63, "resetDataPermsCheck", 0), new ScriptFuncObj(HostPseudoModelScript.class, "openList", "openList", 1, new int[]{0}, 1, 21, 8, 0), new ScriptFuncObj(HostPseudoModelScript.class, "getFocus", "getFocus", 7, new int[0], 0, 26, 63, 0)});

    public static ScriptTable getScriptTable() {
        return moScriptTable;
    }

    public static void beep(Obj pObj, Arg oRetVal, Arg[] pArgs) {
        if (pArgs.length == 1) {
            ((HostPseudoModel)pObj).beep(pArgs[0].getInteger());
        } else {
            ((HostPseudoModel)pObj).beep(0);
        }
    }

    public static void exportData(Obj pObj, Arg oRetVal, Arg[] pArgs) {
        if (pArgs.length == 2) {
            ((HostPseudoModel)pObj).exportData(pArgs[0].getString(), pArgs[1].getAsBool(false));
        } else if (pArgs.length == 1) {
            ((HostPseudoModel)pObj).exportData(pArgs[0].getString(), true);
        } else {
            ((HostPseudoModel)pObj).exportData("", true);
        }
    }

    public static void getAppType(Obj pObj, Arg oRetVal) {
        oRetVal.setString(((HostPseudoModel)pObj).getAppType());
    }

    public static void getCalculationsEnabled(Obj pObj, Arg oRetVal) {
        oRetVal.setBool(((HostPseudoModel)pObj).getCalculationsEnabled());
    }

    public static void getCurrentDateTime(Obj pObj, Arg oRetVal, Arg[] pArgs) {
        oRetVal.setString(((HostPseudoModel)pObj).getCurrentDateTime());
    }

    public static void getCurrentPage(Obj pObj, Arg oRetVal) {
        oRetVal.setInteger(((HostPseudoModel)pObj).getCurrentPage());
    }

    public static void getDocumentInBatch(Obj pObj, Arg oRetVal, Arg[] pArgs) {
        oRetVal.setInteger(((HostPseudoModel)pObj).getDocumentInBatch());
    }

    public static void getDocumentCountInBatch(Obj pObj, Arg oRetVal, Arg[] pArgs) {
        oRetVal.setInteger(((HostPseudoModel)pObj).getDocumentCountInBatch());
    }

    public static void getFocus(Obj pObj, Arg oRetVal, Arg[] pArgs) {
        oRetVal.setObject(((HostPseudoModel)pObj).getFocus());
    }

    public static void getLanguage(Obj pObj, Arg oRetVal) {
        oRetVal.setString(((HostPseudoModel)pObj).getLanguage());
    }

    public static void getName(Obj pObj, Arg oRetVal) {
        oRetVal.setString(((HostPseudoModel)pObj).getName());
    }

    public static void getNumPages(Obj pObj, Arg oRetVal) {
        oRetVal.setInteger(((HostPseudoModel)pObj).getNumPages());
    }

    public static void getPlatform(Obj pObj, Arg oRetVal) {
        oRetVal.setString(((HostPseudoModel)pObj).getPlatform());
    }

    public static void getTitle(Obj pObj, Arg oRetVal) {
        oRetVal.setString(((HostPseudoModel)pObj).getTitle());
    }

    public static void getValidationsEnabled(Obj pObj, Arg oRetVal) {
        oRetVal.setBool(((HostPseudoModel)pObj).getValidationsEnabled());
    }

    public static void getVariation(Obj pObj, Arg oRetVal) {
        oRetVal.setString(((HostPseudoModel)pObj).getVariation());
    }

    public static void getVersion(Obj pObj, Arg oRetVal) {
        oRetVal.setString(((HostPseudoModel)pObj).getVersion());
    }

    public static void gotoURL(Obj pObj, Arg oRetVal, Arg[] pArgs) {
        if (pArgs.length == 2) {
            ((HostPseudoModel)pObj).gotoURL(pArgs[0].getString(), pArgs[1].getAsBool(false));
        } else {
            ((HostPseudoModel)pObj).gotoURL(pArgs[0].getString(), false);
        }
    }

    public static void importData(Obj pObj, Arg oRetVal, Arg[] pArgs) {
        if (pArgs.length == 1) {
            ((HostPseudoModel)pObj).importData(pArgs[0].getString());
        } else {
            ((HostPseudoModel)pObj).importData("");
        }
    }

    public static boolean importDataPermsCheck(Obj obj, Arg[] args) {
        return ((HostPseudoModel)obj).importDataPermsCheck();
    }

    public static void messageBox(Obj pObj, Arg oRetVal, Arg[] pArgs) {
        if (pArgs.length == 4) {
            oRetVal.setInteger(((HostPseudoModel)pObj).messageBox(pArgs[0].getString(), pArgs[1].getString(), pArgs[2].getInteger(), pArgs[3].getInteger()));
        } else if (pArgs.length == 3) {
            oRetVal.setInteger(((HostPseudoModel)pObj).messageBox(pArgs[0].getString(), pArgs[1].getString(), pArgs[2].getInteger(), 0));
        } else if (pArgs.length == 2) {
            oRetVal.setInteger(((HostPseudoModel)pObj).messageBox(pArgs[0].getString(), pArgs[1].getString(), 0, 0));
        } else {
            oRetVal.setInteger(((HostPseudoModel)pObj).messageBox(pArgs[0].getString(), "", 0, 0));
        }
    }

    public static void openList(Obj pObj, Arg oRetVal, Arg[] pArgs) {
        if (pArgs[0].getArgType() == 7) {
            Obj xfaobj = pArgs[0].getObject();
            if (!(xfaobj instanceof Node)) {
                throw new ExFull(ResId.ArgumentMismatchException);
            }
            Node xfanode = (Node)xfaobj;
            ((HostPseudoModel)pObj).openList(xfanode);
        } else {
            String sNode = pArgs[0].getString();
            ((HostPseudoModel)pObj).openList(sNode);
        }
    }

    public static void pageDown(Obj pObj, Arg oRetVal, Arg[] pArgs) {
        ((HostPseudoModel)pObj).pageDown();
    }

    public static void pageUp(Obj pObj, Arg oRetVal, Arg[] pArgs) {
        ((HostPseudoModel)pObj).pageUp();
    }

    public static void print(Obj pObj, Arg oRetVal, Arg[] pArgs) {
        ((HostPseudoModel)pObj).print(pArgs[0].getAsBool(false), pArgs[1].getInteger(), pArgs[2].getInteger(), pArgs[3].getAsBool(false), pArgs[4].getAsBool(false), pArgs[5].getAsBool(false), pArgs[6].getAsBool(false), pArgs[7].getAsBool(false));
    }

    public static void resetData(Obj pObj, Arg oRetVal, Arg[] pArgs) {
        ArrayList<String> oNodes = new ArrayList<String>();
        if (pArgs.length == 1) {
            String sNodes = pArgs[0].getString();
            StringTokenizer sToker = new StringTokenizer(sNodes, ",");
            while (sToker.hasMoreTokens()) {
                oNodes.add(sToker.nextToken());
            }
        }
        ((HostPseudoModel)pObj).resetData(oNodes);
    }

    public static boolean resetDataPermsCheck(Obj obj, Arg[] args) {
        if (obj instanceof PseudoModel) {
            ArrayList<String> oNodes = new ArrayList<String>();
            if (args.length == 1) {
                String sNodes = args[0].getString();
                StringTokenizer sToker = new StringTokenizer(sNodes, ",");
                while (sToker.hasMoreTokens()) {
                    oNodes.add(sToker.nextToken());
                }
            }
            return ((HostPseudoModel)obj).resetDataPermsCheck(oNodes);
        }
        return true;
    }

    public static void response(Obj pObj, Arg oRetVal, Arg[] pArgs) {
        String sRetVal = pArgs.length == 4 ? ((HostPseudoModel)pObj).response(pArgs[0].getString(), pArgs[1].getString(), pArgs[2].getString(), pArgs[3].getAsBool(false)) : (pArgs.length == 3 ? ((HostPseudoModel)pObj).response(pArgs[0].getString(), pArgs[1].getString(), pArgs[2].getString(), false) : (pArgs.length == 2 ? ((HostPseudoModel)pObj).response(pArgs[0].getString(), pArgs[1].getString(), "", false) : ((HostPseudoModel)pObj).response(pArgs[0].getString(), "", "", false)));
        if (sRetVal == null) {
            oRetVal.setNull();
        } else {
            oRetVal.setString(sRetVal);
        }
    }

    public static void setCurrentPage(Obj pObj, Arg propertyValue) {
        ((HostPseudoModel)pObj).setCurrentPage(propertyValue.getInteger());
    }

    public static void setFocus(Obj pObj, Arg oRetVal, Arg[] pArgs) {
        boolean isClearFocus = false;
        if (pArgs.length >= 1) {
            if (pArgs[0].getArgType() == 7) {
                Obj xfaobj = pArgs[0].getObject();
                if (!(xfaobj instanceof Node)) {
                    throw new ExFull(ResId.ArgumentMismatchException);
                }
                Node xfanode = (Node)xfaobj;
                ((HostPseudoModel)pObj).setFocus(xfanode);
            } else if (pArgs[0].getArgType() == 1) {
                isClearFocus = true;
            } else if (pArgs[0].getArgType() == 2) {
                isClearFocus = true;
            } else {
                String sNode = pArgs[0].getString();
                ((HostPseudoModel)pObj).setFocus(sNode);
            }
        } else {
            isClearFocus = true;
        }
        if (isClearFocus) {
            Node xfanode = null;
            ((HostPseudoModel)pObj).setFocus(xfanode);
        }
    }

    public static void setTitle(Obj pObj, Arg propertyValue) {
        ((HostPseudoModel)pObj).setTitle(propertyValue.getString());
    }

    public static void setValidationsEnabled(Obj pObj, Arg propertyValue) {
        ((HostPseudoModel)pObj).setValidationsEnabled(propertyValue.getAsBool(false));
    }

    public static void setCalculationsEnabled(Obj pObj, Arg propertyValue) {
        ((HostPseudoModel)pObj).setCalculationsEnabled(propertyValue.getAsBool(false));
    }
}