/*
 * Copyright (c) 1997-2024 IDRsolutions (https://www.idrsolutions.com)
 */
package org.jpedal.examples.viewer;

/**
 * An enum containing all the possible commands you can use with viewer.executeCommand()
 */
public enum ViewerCommands {
    /*
     * This list should be identical to Commands.java
     */
    ABOUT(1),
    BITMAP(2),
    IMAGES(3),
    TEXT(4),
    SAVE(5),
    PRINT(6),
    EXIT(7),
    AUTOSCROLL(8),
    DOCINFO(9),
    OPENFILE(10),
    BOOKMARK(11),
    FIND(12),
    SNAPSHOT(13),
    OPENURL(14),
    VISITWEBSITE(15),
    PREVIOUSDOCUMENT(16),
    NEXTDOCUMENT(17),
    PREVIOUSRESULT(18),
    NEXTRESULT(19),
    TIP(20),
    PREFERENCES(24),
    COPY(25),
    SELECTALL(26),
    DESELECTALL(27),
    UPDATEGUILAYOUT(28),
    MOUSEMODE(29),
    PANMODE(30),
    TEXTSELECT(31),
    SEPARATECOVER(32),
    EXTRACTTEXT(33),
    EXTRACTASIMAGE(34),
    ROTATELEFT(35),
    ROTATERIGHT(36),
    OPENINSYSTEMDEFAULT(37),
    XREF(38),
    OBJECTS(39),
    FIRSTPAGE(50),
    FBACKPAGE(51),
    BACKPAGE(52),
    FORWARDPAGE(53),
    FFORWARDPAGE(54),
    LASTPAGE(55),
    GOTO(56),
    SINGLE(57),
    CONTINUOUS(58),
    CONTINUOUS_FACING(59),
    FACING(60),
    PAGEFLOW(61),
    FULLSCREEN(62),
    ZOOMIN(63),
    ZOOMOUT(64),
    PORTFOLIO_DETAIL(65),
    PORTFOLIO_TILES(66),
    ROTATION(251),
    SCALING(252),
    CURRENTMENU(300),
    CONTENTMENU(304),
    PDFMENU(306),
    EXPORTMENU(307),
    WINDOWMENU(308),
    PAGELAYOUTMENU(309),
    EDITMENU(310),
    GOTOMENU(311),
    VIEWMENU(312),
    OPENMENU(316),
    FILEMENU(317),
    HELPFORUM(318),
    PORTFOLIOMENU(319),
    SAVEFORM(500),
    HIGHLIGHT(600),
    SCROLL(601),
    ADDVIEW(700),
    FORWARD(701),
    BACK(702),
    /* Part of the Value enum */
    //PAGECOUNT(703),
    //CURRENTPAGE(704),
    //GETOUTLINEPANEL(705),
    //GETTHUMBNAILPANEL(706),
    //GETPAGECOUNTER(707),
    PAGEGROUPING(708),
    SETPAGECOLOR(709),
    SETUNDRAWNPAGECOLOR(710),
    REPLACETEXTCOLOR(711),
    SETTEXTCOLOR(712),
    CHANGELINEART(713),
    SETDISPLAYBACKGROUND(714),
    SETREPLACEMENTCOLORTHRESHOLD(715),
    SETENHANCEFRACTIONALLINES(717),
    SETHIDELINEWEIGHTS(718),
    SETHIGHLIGHTFORMFIELDS(719),
    HELP(998),
    BUY(999),
    RESET(1_002),
    ACCELERATIONON(1_003),
    ACCELERATIONOFF(1_004),
    SHOWFORMNAMES(1_006),
    DELETEPROPERTIESONEXIT(1_007),
    ALWAYSSHOWMOUSE(1_008),
    HIDEVERSIONNUMBER(720),
    SHOWVERSIONNUMBER(721);

    final int commandID;

    ViewerCommands(final int commandID) {
        this.commandID = commandID;
    }

    public static ViewerCommands createFromID(final int id) {
        final ViewerCommands[] values = ViewerCommands.values();
        for (final ViewerCommands value : values) {
            if (value.commandID == id) {
                return value;
            }
        }
        return null;
    }
}