# ruff: noqa: E501
"""
The general capabilities registry holds all the TWAIN general source capabilities (CAP_*).

GENERAL_CAP_REGISTRY was generated by using Google Gemini 3 Pro.
The twain ids and names have all been reviewed manually.
Doctrings and types have only been reviewed partially (should be the same as in the twain specifications 2.5).

TWAIN:
CAP_xxxx: Capabilities whose names begin with CAP are capabilities that could apply to any
general Source. Such capabilities include use of automatic document feeders, identification of
the creator of the data, etc.
"""

from .capability import Capability

GENERAL_CAP_REGISTRY: dict[int, Capability] = {
    0x1018: Capability(
        id=0x1018,
        name="alarms",
        twain_type="TW_UINT16",
        doc="""Description:
Turns specific audible alarms on and off.

Application:
Note that an application may opt to turn off all alarms by issuing a MSG_SET with no data. Therefore, an application should also be prepared to receive an empty array from a Source with an MSG_GET. (i.e., pTW_ARRAY->NumItems == 0)
The easiest way to test for allowed values is to try to set them all with MSG_SET. If not all are allowed, the Source will return TWRC_CHECKSTATUS with those values that it supports.""",
        version="1.8",
        allowed_values=[
            "TWAL_ALARM",
            "TWAL_FEEDERERROR",
            "TWAL_FEEDERWARNING",
            "TWAL_BARCODE",
            "TWAL_DOUBLEFEED",
            "TWAL_JAM",
            "TWAL_PATCHCODE",
            "TWAL_POWER",
            "TWAL_SKEW",
        ],
        containers=["TW_ARRAY"],
    ),
    0x1019: Capability(
        id=0x1019,
        name="alarm_volume",
        twain_type="TW_INT32",
        doc="""Description:
The volume of a device's audible alarm. Note that this control affects the volume of all alarms; no specific volume control for individual types of alarms is provided.

Application:
Take note of the range step, some Sources may only offer a step of 100, which turns the alarm on or off.""",
        version="1.8",
        allowed_values=(0, 100),  # Range
        containers=["TW_ONEVALUE", "TW_RANGE"],
    ),
    0x1000: Capability(
        id=0x1000,
        name="author",
        twain_type="TW_STR128",
        doc="""Description:
The name or other identifying information about the Author of the image. It may include a copyright string.""",
        version="1.0",
        allowed_values="Any string",
        containers=["TW_ONEVALUE"],
    ),
    0x1007: Capability(
        id=0x1007,
        name="auto_feed",
        twain_type="TW_BOOL",
        doc="""Description:
If TRUE, the Source will automatically feed the next page from the document feeder after the number of frames negotiated for capture from each page are acquired. CAP_FEEDERENABLED must be TRUE to use this capability.

Application:
Set the capability to TRUE to enable the Source's automatic feed process, or FALSE to disable it. After the completion of each transfer, check TW_PENDINGXFERS. Count to determine if the Source has more images to transfer. A -1 means there are more images to transfer but the exact number is not known.
CAP_FEEDERLOADED indicates whether the Source's feeder is loaded. (The automatic feed process continues whenever this capability is TRUE.)""",
        version="1.0",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x101A: Capability(
        id=0x101A,
        name="automatic_capture",
        twain_type="TW_INT32",
        doc="""Description:
The number of images to automatically capture. This does not refer to the number of images to be sent to the Application, use CAP_XFERCOUNT for that.""",
        version="1.8",
        allowed_values="0 or greater",
        containers=["TW_ONEVALUE", "TW_RANGE"],
    ),
    0x103B: Capability(
        id=0x103B,
        name="automatic_sense_medium",
        twain_type="TW_BOOL",
        doc="""Description:
Configures a Source to check for paper in the Automatic Document Feeder, and if it finds any, then automatically capture all of its images from the Feeder. If the Feeder is empty when acquisition starts, then all images are automatically captured from the Flatbed.

Application:
This capability offers a less complex method to let the Source automatically choose whether to acquire images from the Automatic Document Feeder or from the Flatbed.
Note: If this capability is not supported, Applications can simulate this behavior by examining CAP_FEEDERLOADED. If it is TRUE, set CAP_FEEDERENABLED to TRUE. If it is FALSE, set CAP_FEEDERENABLED to FALSE. And after that begin to acquire images.""",
        version="2.1",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1010: Capability(
        id=0x1010,
        name="auto_scan",
        twain_type="TW_BOOL",
        doc="""Description:
This capability is intended to boost the performance of a Source. The fundamental assumption behind AutoScan is that the device is able to capture the number of images indicated by the value of CAP_XFERCOUNT without waiting for the Application to request the image transfers. This is only possible if the device has internal buffers capable of caching the images it captures.
Some high volume devices are incapable of anything but CAP_AUTOSCAN being equal to TRUE. If the scanner supports both TRUE and FALSE it should set its MSG_RESET value to TRUE. Most of the applications on the market expect this behavior.

Application:
The application should check the TW_PENDINGXFERS. Count , and continue to scan until it becomes 0.
When AutoScan is set to TRUE, the Application should not rely on just the paper sensors (for example, CAP_FEEDERLOADED) to determine if there are images to be transferred. The latency between the Source and the Application makes it very likely that at the time the sensor reports FALSE, there may be more than one image waiting for the transfer inside of the device's buffers. Applications should use the TW_PENDINGXFERS. Count returned from DG_CONTROL / DAT_PENDINGXFERS / MSG_ENDXFER to determine whether or not there are more images to be transferred.""",
        version="1.6",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1032: Capability(
        id=0x1032,
        name="battery_minutes",
        twain_type="TW_INT32",
        doc="""Description:
The minutes of battery power remaining to the device.
This is a read only capability.""",
        version="1.8",
        allowed_values=[-2, -1, "0 and greater"],
        containers=["TW_ONEVALUE"],
    ),
    0x1033: Capability(
        id=0x1033,
        name="battery_percentage",
        twain_type="TW_INT16",
        doc="""Description:
When used with MSG_GET, return the percentage of battery power level on camera. If -1 is returned, it indicates that the battery is not present.
This is a read only capability.

Application:
Use this capability with MSG_GET to indicate to the user about the battery power status. It is recommended to use CAP_POWERSUPPLY to identify the power source first.""",
        version="1.8",
        allowed_values=[-2, -1, (0, 100)],
        containers=["TW_ONEVALUE"],
    ),
    0x1036: Capability(
        id=0x1036,
        name="camera_enabled",
        twain_type="TW_BOOL",
        doc="""Description:
This feature depends on “camera addressing”, which is the ability to address elements in the device responsible for the color space or location. TWAIN offers DAT_FILESYSTEM and CAP_CAMERASIDE to do this.
When set to TRUE the device will deliver images from the current camera. The Current Camera can be selected with either CAP_CAMERASIDE or DAT_FILESYSTEM. With CAP_CAMERASIDE it is possible to enable bottom (rear) only scanning, or have different settings for top and bottom. With DAT_FILESYSTEM it is possible to enter a Single Document Multiple Images (SDMI) mode in addition to enabling different settings for top and bottom.

Application:
CAP_CAMERASIDE is easier to use, but cannot be used for SDMI. To enable bottom only scanning, set CAP_CAMERASIDE to TWCS_BOTTOM and set CAP_CAMERAENABLED to TRUE, then set CAP_CAMERASIDE to TWCS_TOP and set CAP_CAMERAENABLED to FALSE.
With DAT_FILESYSTEM an application can traverse and control all cameras individually.
An application should not use both CAP_CAMERASIDE and DAT_FILESYSTEM to address a camera.
Avoid using ICAP_PIXELTYPE after setting CAP_CAMERAENABLED. ICAP_PIXELTYPE implicitly sets CAP_CAMERAENABLED to TRUE for both sides of the current pixel type, and sets all other cameras to false. This supports legacy behavior. An application can always reasonably expect that setting ICAP_PIXELTYPE to TWPT_RGB and then scanning (simples or duplex) will result in getting color images.
The application is not allowed to turn off CAP_CAMERAENABLED for all cameras.""",
        version="2.0",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1037: Capability(
        id=0x1037,
        name="camera_order",
        twain_type="TW_UINT16",
        doc="""Description:
This capability selects the order of output for Single Document Multiple Image (SDMI) mode based on an array of pixel types; it does not constrain the allowed pixel types.
For example, if the scanner is set up to deliver color and bitonal documents on the top (front) camera, then an array of {TWPT_RGB, TWPT_BW} will deliver first the color image, then the bitonal image, while an array of {TWPT_BW, TWPT_RGB} will deliver first the bitonal image, then the color image.

Application:
Some sources support independent ordering of color, grayscale and bitonal, while other sources may link color and grayscale together. This can be detected by setting CAP_CAMERAORDER to all of the available ICAP_PIXELTYPE values {ex: TWPT_RGB, TWPT_GRAY, TWPT_BW} followed by a MSG_GET to examine the result. In this example a source that supports full, independent control will return back exactly the same list it was set to, while a source that links pixel types together will return a reduced list, such as {TWPT_RGB, TWPT_BW}.""",
        version="2.0",
        allowed_values="All applicable ICAP_PIXELTYPE values",
        containers=["TW_ARRAY"],
    ),
    0x1021: Capability(
        id=0x1021,
        name="camera_preview_ui",
        twain_type="TW_BOOL",
        doc="""Description:
This capability queries the Source for UI support for preview mode. If TRUE, the Source supports preview UI.
This is a read only capability.

Application:
Use this capability to query the preview UI support by the Source. However, the application can choose to use the Source's UI or not even if the Source supports it.""",
        version="1.8",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1034: Capability(
        id=0x1034,
        name="camera_side",
        twain_type="TW_UINT16",
        doc="""Description:
TWAIN models a duplex scanner as conceptually having two 'cameras' - a 'top' camera that captures the front of each page, and a 'bottom' camera that captures the back. Some devices allow these two logical cameras to operate with different settings for certain capabilities.
CAP_CAMERASIDE provides a simple way to address the cameras individually: The value of CAP_CAMERASIDE determines whether subsequent capability negotiation is directed to one camera or the other, or to both.

Application:
The application sets which camera it wishes to address with CAP_CAMERASIDE. The application then sets any capability that allows independent values for the top and bottom.
There is no easy way to determine if a capability supports independent values for the top and bottom, though as a general rule the ICAP_ capabilities are more likely to allow this. An application can determine support by setting one side, then testing the other side to see if it has changed.
Mixing camera selection using DAT_FILESYSTEM and CAP_CAMERASIDE is not recommended, and may produce unexpected results.""",
        version="1.91",
        allowed_values=["TWCS_BOTH", "TWCS_TOP", "TWCS_BOTTOM"],
        containers=["TW_ENUMERATION", "TW_ONEVALUE"],
    ),
    0x1001: Capability(
        id=0x1001,
        name="caption",
        twain_type="TW_STR255",
        doc="""Description:
A general note about the acquired image.""",
        version="1.0",
        allowed_values="Any string",
        containers=["TW_ONEVALUE"],
    ),
    0x101D: Capability(
        id=0x101D,
        name="clear_buffers",
        twain_type="None",
        doc="Unknown",
        version="None",
        allowed_values="None",
        containers=[],
    ),
    0x1008: Capability(
        id=0x1008,
        name="clear_page",
        twain_type="TW_BOOL",
        doc="""Description:
If TRUE, the Source will eject the current page being acquired from and will leave the feeder acquire area empty.
If CAP_AUTOFEED is TRUE, a fresh page will be advanced.
CAP_FEEDERENABLED must equal TRUE to use this capability.
This capability must have been negotiated as an extended capability to be used in States 5 and 6.

Application:
Do a MSG_SET on this capability to advance the document in the feeder acquire area to the output area and abort all transfers pending on this page.
This capability is used in States 5 and 6 by applications controlling the Source's feeder (usually without the Source user interface).
This capability can also be used while CAP_AUTOFEED equals TRUE to abort all remaining transfers on this page and continue with the next page.""",
        version="1.0",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x8000: Capability(
        id=0x8000,
        name="custom_base",
        twain_type="None",
        doc="Unknown",
        version="None",
        allowed_values="None",
        containers=[],
    ),
    0x1015: Capability(
        id=0x1015,
        name="custom_ds_data",
        twain_type="TW_BOOL",
        doc="""Description:
Allows the application to query the data source to see if it supports the new operation triplets DG_CONTROL/ DAT_CUSTOMDSDATA / MSG_GET and DG_CONTROL/ DAT_CUSTOMDSDATA / MSG_SET.
If TRUE, the source will support the DG_CONTROL/ DAT_CUSTOMDSDATA/MSG_GET message.
This is a read only capability.""",
        version="1.7",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x103C: Capability(
        id=0x103C,
        name="custom_interface_guid",
        twain_type="TW_STR255",
        doc="""Description:
Uniquely identifies an interface for a Data Source, so that an Application can properly interpret its custom content.
This is a read only capability.

Application:
Use the value from this capability to interpret all of the numeric values referenced in the See Also section below.
Consider the following example, which results in three GUID's, one for Vendor ABC and two for Vendor XYZ:
• Vendor ABC's Scanner models Fred and Wilma have a custom capability called CAP_MYFEATURE with a numeric value of 0x8001.
• Vendor XYZ's Scanner model Barney has a custom capability CAP_OURFEATURE with a numeric value of 0x8001, but their Scanner Model Betty has a different custom capability CAP_BETTERFEATURE with a numeric value of 0x8001.
The challenge for the Application is to know what 0x8001 means. Historically, this has been determined from the Source's TW_IDENTITY structure. But this is hard to maintain, and requires the Application to constantly update its recognition code, even in the case of Vendor ABC whose interface stays the same from one model to the next.
Using CAP_CUSTOMINTERFACEGUID the Application can immediately identity Vendor ABC's unique interface, without having to check its TW_IDENTITY structure.""",
        version="2.1",
        allowed_values="A string in GUID format { XXXXXXXX- XXXX- XXXX- XXXX- XXXXXXXXXXXX}",
        containers=["TW_ONEVALUE"],
    ),
    0x1022: Capability(
        id=0x1022,
        name="device_event",
        twain_type="TW_UINT16",
        doc="""Description:
MSG_SET selects which events the Application wants the Source to report. MSG_GET and MSG_GETCURRENT gets the current setting. MSG_RESET resets the capability to the empty array (no events set).

Application:
Set all values and process the TWRC_CHECKSTATUS (if returned) to identify those items supported by the Source. MSG_GET and MSG_GETCURRENT to get a list of currently enabled items.""",
        version="1.8",
        allowed_values=[
            "TWDE_CHECKAUTOMATICCAPTURE",
            "TWDE_CHECKBATTERY",
            "TWDE_CHECKDEVICEONLINE",
            "TWDE_CHECKFLASH",
            "TWDE_CHECKPOWERSUPPLY",
            "TWDE_CHECKRESOLUTION",
            "TWDE_DEVICEADDED",
            "TWDE_DEVICEOFFLINE",
            "TWDE_DEVICEREADY",
            "TWDE_DEVICEREMOVED",
            "TWDE_IMAGECAPTURED",
            "TWDE_IMAGEDELETED",
            "TWDE_PAPERDOUBLEFEED",
            "TWDE_PAPERJAM",
            "TWDE_LAMPFAILURE",
            "TWDE_POWERSAVE",
            "TWDE_POWERSAVENOTIFY",
            "TWDE_CUSTOMEVENTS",
        ],
        containers=["TW_ARRAY", "TW_ONEVALUE"],
    ),
    0x100F: Capability(
        id=0x100F,
        name="device_online",
        twain_type="TW_BOOL",
        doc="""Description:
If TRUE, the physical hardware (e.g., scanner, digital camera, image database, etc.) that represents the image source is attached, powered on, and communicating.
This is a read only capability.

Application:
This capability can be issued at any time to determine the availability of the image source hardware.""",
        version="1.6",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x101F: Capability(
        id=0x101F,
        name="device_time_date",
        twain_type="TW_STR32",
        doc="""Description:
The date and time of the device's clock.
Managed in the form “YYYY/MM/DD HH:mm:SS:sss” where YYYY is the year, MM is the numerical month, DD is the numerical day, HH is the hour, mm is the minute, SS is the second, and sss is the millisecond.""",
        version="1.8",
        allowed_values="Any date",
        containers=["TW_ONEVALUE"],
    ),
    0x103F: Capability(
        id=0x103F,
        name="double_feed_detection",
        twain_type="TW_UINT16",
        doc="""Description:
Enables or disables double feed detection.""",
        version="2.2",
        allowed_values=["TWDF_ULTRASONIC", "TWDF_BYLENGTH", "TWDF_INFRARED"],
        containers=["TW_ARRAY", "TW_ONEVALUE"],
    ),
    0x1040: Capability(
        id=0x1040,
        name="double_feed_detection_length",
        twain_type="TW_FIX32",
        doc="""Description:
When CAP_DOUBLEFEEDDETECTION includes TWDF_BYLENGTH, it allows an Application to set the minimum length for detecting double feed documents. A value of zero always means “off”.""",
        version="2.2",
        allowed_values="0 to 32767 in ICAP_UNITS",
        containers=["TW_RANGE", "TW_ONEVALUE"],
    ),
    0x1041: Capability(
        id=0x1041,
        name="double_feed_detection_response",
        twain_type="TW_UINT16",
        doc="""Description:
When CAP_DOUBLEFEEDDETECTION is set to anything but Disabled, it allows an Application to set how the source will respond to detecting a double feed.
• TWDP_STOP - when a multi-feed is detected the driver must end the scanner session, returning TWCC_PAPERDOUBLEFEED for the an DAT_IMAGE*XFER call that applied to the bad image.
• TWDP_STOPANDWAIT - the driver/device will manage the multi-feed; the application is not notified; after the problem is fixed by the operator, image capture is continued as if no multifeed occurred.
• TWDP_SOUND - the driver/device will generate an audible alert when a multi-feed is detected
• TWDP_DONOTIMPRINT - the device will not print on multi-fed documents. All combinations are valid, excluding TWDP_STOP and TWDP_STOPANDWAIT as only one of those can appear at a time. If the driver is asked for both, it may pick one and return TWRC_CHECKSTATUS.

Application:
The Application cannot ask for TWDP_STOP and TWDP_STOPANDWAIT at the same time.
After it receives TWCC_PAPERDOUBLEFEED, the Application can use DAT_PENDINGXFERS / MSG_GET to see if it can resume the current session or if it must start a new one. If TWDP_STOPANDWAIT is in the list, then Application should not expect any errors to be returned if double-feed occurs.""",
        version="2.2",
        allowed_values=["TWDP_STOP", "TWDP_STOPANDWAIT", "TWDP_SOUND", "TWDP_DONOTIMPRINT"],
        containers=["TW_ARRAY", "TW_ONEVALUE"],
    ),
    0x1042: Capability(
        id=0x1042,
        name="double_feed_detection_sensitivity",
        twain_type="TW_UINT16",
        doc="""Description:
When CAP_DOUBLEFEEDDETECTION includes TWDF_ULTRASONIC, allows an Application to set how sensitive the double feed detection is.""",
        version="2.2",
        allowed_values=["TWUS_LOW", "TWUS_MEDIUM", "TWUS_HIGH"],
        containers=["TW_ENUMERATION", "TW_ONEVALUE"],
    ),
    0x1012: Capability(
        id=0x1012,
        name="duplex",
        twain_type="TW_UINT16",
        doc="""Description:
This indicates whether the scanner supports duplex. If so, it further indicates whether one-path or two-path duplex is supported.
This is a read only capability.

Application:
Application can send MSG_GET to find out whether the scanner supports duplex.""",
        version="1.7",
        allowed_values=["TWDX_NONE", "TWDX_1PASSDUPLEX", "TWDX_2PASSDUPLEX"],
        containers=["TW_ONEVALUE"],
    ),
    0x1013: Capability(
        id=0x1013,
        name="duplex_enabled",
        twain_type="TW_BOOL",
        doc="""Description:
The user can set the duplex option to be TRUE or FALSE. If TRUE, the scanner scans both sides of a paper; otherwise, the scanner will scan only one side of the image.

Application:
The Application should send MSG_GET or MSG_GETCURRENT to determine if the duplex option is enabled or not.""",
        version="1.7",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1014: Capability(
        id=0x1014,
        name="enabled_sui_only",
        twain_type="TW_BOOL",
        doc="""Description:
Allows an application to query a source to see if it implements the new user interface settings dialog. If a source reports that it has the capability CAP_ENABLEDSUIONLY, then it must implement the operation triplet DG_CONTROL/ DAT_USERINTERFACE/ MSG_ENABLEDSUIONLY to display the source user interface without acquiring an image.
If TRUE, the source will support the DG_CONTROL/ DAT_USERINTERFACE / MSG_ENABLEDSUIONLY message.
This is a read only capability.""",
        version="1.7",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1016: Capability(
        id=0x1016,
        name="endorser",
        twain_type="TW_UINT32",
        doc="""Description:
Allows the application to specify the scanner's starting endorser / imprinter number.
When available, use CAP_PRINTERINDEX, instead. See the Legacy Issues section on CAP_ENDORSER vs CAP_PRINTER for more information.""",
        version="1.7",
        allowed_values="Any value",
        containers=["TW_ONEVALUE", "TW_RANGE"],
    ),
    0x1006: Capability(
        id=0x1006,
        name="extended_caps",
        twain_type="TW_UINT16",
        doc="""Description:
Allows the application and Source to negotiate capabilities to be used in States 5, 6 and 7.

Application:
MSG_GET and MSG_GETCURRENT return an array of the capabilities the Source supports in States 5, 6 and 7. If either the Source or the application is older than TWAIN 2.3, use MSG_GET to get the list of allowed capabilities, and MSG_GETCURRENT to check the capabilities currently set.
MSG_SET is only needed with Sources older than TWAIN 2.3, to set the capabilities the application wants to negotiate in States 5, 6 and 7.
Stated another way, beginning with TWAIN 2.3 CAP_EXTENDEDCAPS works more like CAP_SUPPORTEDCAPS; it should be treated as a read only array, but data sources must still permit MSG_SET and MSG_RESET operations for legacy applications.""",
        version="1.0",
        allowed_values="Any CAP_xxxx",
        containers=["TW_ARRAY", "TW_ONEVALUE"],
    ),
    0x102D: Capability(
        id=0x102D,
        name="feeder_alignment",
        twain_type="TW_UINT16",
        doc="""Description:
Helps the Application determine any special actions it may need to take when negotiating frames with the Source.
• TWFA_NONE: The alignment is free-floating. Applications should assume that the origin for frames is on the left.
• TWFA_LEFT: The alignment is to the left.
• TWFA_CENTER: The alignment is centered. This means that the paper will be fed in the middle of the ICAP_PHYSICALWIDTH of the device. If this is set, then the Application should calculate any frames with a left offset.
• TWFA_RIGHT: The alignment is to the right. If this is set, then the Application should calculate any frames with a left offset.

Application:
The Application can use this to determine if it must center the framing information sent to the Source. With some Sources it might be possible for the Application to select whether the paper is center fed or not.""",
        version="1.8",
        allowed_values=["TWFA_NONE", "TWFA_LEFT", "TWFA_CENTER", "TWFA_RIGHT"],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1002: Capability(
        id=0x1002,
        name="feeder_enabled",
        twain_type="TW_BOOL",
        doc="""Description:
If TRUE, Source must acquire data from the document feeder acquire area and other feeder capabilities can be used. If FALSE, Source must acquire data from the non-feeder acquire area and no other feeder capabilities can be used.

Application:
The application should MSG_SET this capability to TRUE before attempting to use any other feeder capabilities. This sets the current acquire area to the feeder area (it may not be a different physical area on some Sources).
The application can MSG_SET this capability to FALSE to use the Source's non-feeder acquisition area and disallow the further use of feeder capabilities.""",
        version="1.0",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1003: Capability(
        id=0x1003,
        name="feeder_loaded",
        twain_type="TW_BOOL",
        doc="""Description:
Reflect whether there are documents loaded in the Source's feeder.
This is a read only capability.

Application:
Used by application to inquire whether there are documents loaded in the Source's feeder.""",
        version="1.0",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x102E: Capability(
        id=0x102E,
        name="feeder_order",
        twain_type="TW_UINT16",
        doc="""Description:
TWFO_FIRSTPAGEFIRST if the feeder starts with the top of the first page.
TWFO_LASTPAGEFIRST is the feeder starts with the top of the last page.

Application:
An Application can use this to determine if it should reorganize the stream of images received from a Source.""",
        version="1.8",
        allowed_values=["TWFO_FIRSTPAGEFIRST", "TWFO_LASTPAGEFIRST"],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x103A: Capability(
        id=0x103A,
        name="feeder_pocket",
        twain_type="TW_UINT16",
        doc="""Description:
Report what pockets are available to receive paper as it exits from the device..""",
        version="2.0",
        allowed_values="TWFP_POCKET1 - TWFP_POCKET16, TWFP_POCKETERROR",
        containers=["TW_ARRAY", "TW_ONEVALUE"],
    ),
    0x1039: Capability(
        id=0x1039,
        name="feeder_prep",
        twain_type="TW_BOOL",
        doc="""Description:
Improve the movement of paper through a scanner ADF.""",
        version="2.0",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1009: Capability(
        id=0x1009,
        name="feed_page",
        twain_type="TW_BOOL",
        doc="""Description:
If TRUE, the Source will eject the current page and advance the next page in the document feeder into the feeder acquire area.
If CAP_AUTOFEED is TRUE, the same action just described will occur and CAP_AUTOFEED will remain active.
CAP_FEEDERENABLED must equal TRUE to use this capability.
This capability must have been negotiated as an extended capability to be used in States 5 and 6.

Application:
Do a MSG_SET to TRUE on this capability to advance the next document in the feeder to the feeder acquire area.
This capability is used in States 5 and 6 by applications controlling the Source's feeder (usually without the Source's user interface).
This capability can also be used while CAP_AUTOFEED equals TRUE to abort all remaining transfers on this page and continue with the next page.""",
        version="1.0",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1051: Capability(
        id=0x1051,
        name="ia_field_a_level",
        twain_type="TW_UINT16",
        doc="""Description:
Sets the image address level for each of the specified fields. Image addressing uniquely tags every image in a batch, helping with workflows. When combined with printing it allows an image to be matched to its original physical sheet of paper. Incremental counting typically takes place on the lowest level for every scanned sheet. This can be overridden to increment a different counter level, either through manual intervention on the scanner, or using Patch Code Detection, which is described in this document.

Application:
Set CAP_IMAGEADDRESSENABLED to TRUE before accessing these fields. Refer to the section on Capability Ordering to correctly negotiate these settings. An application must set all the supported Image Addressing capabilities to guarantee a correct result.""",
        version="2.5",
        allowed_values=["TWIA_UNUSED", "TWIA_FIXED", "TWIA_LEVEL1", "TWIA_LEVEL2", "TWIA_LEVEL3", "TWIA_LEVEL4"],
        containers=["TW_ENUMERATION", "TW_ONEVALUE"],
    ),
    0x1052: Capability(
        id=0x1052,
        name="ia_field_b_level",
        twain_type="TW_UINT16",
        doc="""(See CAP_IAFIELDA_LEVEL for Description and Application)""",
        version="2.5",
        allowed_values=["TWIA_UNUSED", "TWIA_FIXED", "TWIA_LEVEL1", "TWIA_LEVEL2", "TWIA_LEVEL3", "TWIA_LEVEL4"],
        containers=["TW_ENUMERATION", "TW_ONEVALUE"],
    ),
    0x1053: Capability(
        id=0x1053,
        name="ia_field_c_level",
        twain_type="TW_UINT16",
        doc="""(See CAP_IAFIELDA_LEVEL for Description and Application)""",
        version="2.5",
        allowed_values=["TWIA_UNUSED", "TWIA_FIXED", "TWIA_LEVEL1", "TWIA_LEVEL2", "TWIA_LEVEL3", "TWIA_LEVEL4"],
        containers=["TW_ENUMERATION", "TW_ONEVALUE"],
    ),
    0x1054: Capability(
        id=0x1054,
        name="ia_field_d_level",
        twain_type="TW_UINT16",
        doc="""(See CAP_IAFIELDA_LEVEL for Description and Application)""",
        version="2.5",
        allowed_values=["TWIA_UNUSED", "TWIA_FIXED", "TWIA_LEVEL1", "TWIA_LEVEL2", "TWIA_LEVEL3", "TWIA_LEVEL4"],
        containers=["TW_ENUMERATION", "TW_ONEVALUE"],
    ),
    0x1055: Capability(
        id=0x1055,
        name="ia_field_e_level",
        twain_type="TW_UINT16",
        doc="""(See CAP_IAFIELDA_LEVEL for Description and Application)""",
        version="2.5",
        allowed_values=["TWIA_UNUSED", "TWIA_FIXED", "TWIA_LEVEL1", "TWIA_LEVEL2", "TWIA_LEVEL3", "TWIA_LEVEL4"],
        containers=["TW_ENUMERATION", "TW_ONEVALUE"],
    ),
    0x1060: Capability(
        id=0x1060,
        name="ia_field_a_last_page",
        twain_type="TW_STR32",
        doc="""Description:
Reports the image address assigned to the last sheet of paper before scanning ends.

Application:
Call this capability in state 4 or 5 to determine the image address assigned to the last sheet of paper in a scanning session. Ignore the value if the corresponding CAP_IAFIELD*_LEVEL is set to TWIA_UNUSED.""",
        version="2.5",
        allowed_values="Any string (e.g. '1')",
        containers=["TW_ENUMERATION", "TW_ONEVALUE"],
    ),
    0x1061: Capability(
        id=0x1061,
        name="ia_field_b_last_page",
        twain_type="TW_STR32",
        doc="""(See CAP_IAFIELDA_LASTPAGE)""",
        version="2.5",
        allowed_values="Any string",
        containers=["TW_ENUMERATION", "TW_ONEVALUE"],
    ),
    0x1062: Capability(
        id=0x1062,
        name="ia_field_c_last_page",
        twain_type="TW_STR32",
        doc="""(See CAP_IAFIELDA_LASTPAGE)""",
        version="2.5",
        allowed_values="Any string",
        containers=["TW_ENUMERATION", "TW_ONEVALUE"],
    ),
    0x1063: Capability(
        id=0x1063,
        name="ia_field_d_last_page",
        twain_type="TW_STR32",
        doc="""(See CAP_IAFIELDA_LASTPAGE)""",
        version="2.5",
        allowed_values="Any string",
        containers=["TW_ENUMERATION", "TW_ONEVALUE"],
    ),
    0x1064: Capability(
        id=0x1064,
        name="ia_field_e_last_page",
        twain_type="TW_STR32",
        doc="""(See CAP_IAFIELDA_LASTPAGE)""",
        version="2.5",
        allowed_values="Any string",
        containers=["TW_ENUMERATION", "TW_ONEVALUE"],
    ),
    0x1056: Capability(
        id=0x1056,
        name="ia_field_a_print_format",
        twain_type="TW_STR32",
        doc="""Description:
Selects the number of supported digits (or characters for TWIA_FIXED), and the style of printing.

Application:
Set CAP_IMAGEADDRESSENABLED to TRUE before accessing these fields. Refer to the section on Capability Ordering to correctly negotiate these settings. An application must set all the supported Image Addressing capabilities to guarantee a correct result.
Set the field to a string of one or more zeros (0) for zero padding. Set the field to a string of one or more score signs (#) for no padding.""",
        version="2.5",
        allowed_values="Format string",
        containers=["TW_ONEVALUE"],
    ),
    0x1057: Capability(
        id=0x1057,
        name="ia_field_b_print_format",
        twain_type="TW_STR32",
        doc="""(See CAP_IAFIELDA_PRINTFORMAT)""",
        version="2.5",
        allowed_values="Format string",
        containers=["TW_ONEVALUE"],
    ),
    0x1058: Capability(
        id=0x1058,
        name="ia_field_c_print_format",
        twain_type="TW_STR32",
        doc="""(See CAP_IAFIELDA_PRINTFORMAT)""",
        version="2.5",
        allowed_values="Format string",
        containers=["TW_ONEVALUE"],
    ),
    0x1059: Capability(
        id=0x1059,
        name="ia_field_d_print_format",
        twain_type="TW_STR32",
        doc="""(See CAP_IAFIELDA_PRINTFORMAT)""",
        version="2.5",
        allowed_values="Format string",
        containers=["TW_ONEVALUE"],
    ),
    0x105A: Capability(
        id=0x105A,
        name="ia_field_e_print_format",
        twain_type="TW_STR32",
        doc="""(See CAP_IAFIELDA_PRINTFORMAT)""",
        version="2.5",
        allowed_values="Format string",
        containers=["TW_ONEVALUE"],
    ),
    0x105B: Capability(
        id=0x105B,
        name="ia_field_a_value",
        twain_type="TW_STR32",
        doc="""Description:
Specifies the image address that will be assigned to the first sheet of paper captured by the scanner when scanning is started.

Application:
Set CAP_IMAGEADDRESSENABLED to TRUE before accessing these fields. Refer to the section on Capability Ordering to correctly negotiate these settings. An application must set all the supported Image Addressing capabilities to guarantee a correct result.
If CAP_IAFIELD*_LEVEL is TWIA_UNUSED, the value is ignored. If CAP_IAFIELD*_LEVEL is TWIA_FIXED, then set the value to a text string. For any other value of CAP_IAFIELD*_LEVEL set CAP_IAFIELD*_VALUE to the numeric value that will be assigned to the first sheet of paper captured by the scanner when scanner is started.""",
        version="2.5",
        allowed_values="Any string",
        containers=["TW_ONEVALUE"],
    ),
    0x105C: Capability(
        id=0x105C,
        name="ia_field_b_value",
        twain_type="TW_STR32",
        doc="""(See CAP_IAFIELDA_VALUE)""",
        version="2.5",
        allowed_values="Any string",
        containers=["TW_ONEVALUE"],
    ),
    0x105D: Capability(
        id=0x105D,
        name="ia_field_c_value",
        twain_type="TW_STR32",
        doc="""(See CAP_IAFIELDA_VALUE)""",
        version="2.5",
        allowed_values="Any string",
        containers=["TW_ONEVALUE"],
    ),
    0x105E: Capability(
        id=0x105E,
        name="ia_field_d_value",
        twain_type="TW_STR32",
        doc="""(See CAP_IAFIELDA_VALUE)""",
        version="2.5",
        allowed_values="Any string",
        containers=["TW_ONEVALUE"],
    ),
    0x105F: Capability(
        id=0x105F,
        name="ia_field_e_value",
        twain_type="TW_STR32",
        doc="""(See CAP_IAFIELDA_VALUE)""",
        version="2.5",
        allowed_values="Any string",
        containers=["TW_ONEVALUE"],
    ),
    0x1050: Capability(
        id=0x1050,
        name="image_address_enabled",
        twain_type="TW_BOOL",
        doc="""Description:
Turns image addressing on and off.""",
        version="2.5",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x100B: Capability(
        id=0x100B,
        name="indicators",
        twain_type="TW_BOOL",
        doc="""Description:
If TRUE, the Source displays a progress indicator during acquisition and transfer, regardless of whether the Source's user interface is active. If FALSE, the progress indicator is suppressed if the Source's user interface is inactive.
The Source displays device-specific instructions and error messages if either the user interface or progress indicator is turned on. In this case it returns TWCC_OPERATIONERROR to alert the application that it handled the error, and communicated the problem to the user.
If both the user interface and progress indicator are turned off, then the Source never displays any message to the user, even if TWCC_OPERATIONERROR is returned. Messages to the user are under the sole control of the Application.

Application:
If the application plans to enable the Source with TW_USERINTERFACE. ShowUI = FALSE, it can also suppress the Source's progress indicator by using this capability.""",
        version="1.1",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1044: Capability(
        id=0x1044,
        name="indicators_mode",
        twain_type="TW_UINT16",
        doc="""Description:
Specify what messages can be displayed if ICAP_INDICATORS is TRUE.""",
        version="2.2",
        allowed_values=["TWCI_INFO", "TWCI_WARNING", "TWCI_ERROR", "TWCI_WARMUP"],
        containers=["TW_ARRAY", "TW_ONEVALUE"],
    ),
    0x1017: Capability(
        id=0x1017,
        name="job_control",
        twain_type="TW_UINT16",
        doc="""Description:
Allows multiple jobs in batch mode. The application can decide how the job can be processed, according to the flags listed below.
TWJC_NONE: No job control.
TWJC_JSIC: Detect and include job separator and continue scanning.
TWJC_JSIS: Detect and include job separator and stop scanning.
TWJC_JSXC: Detect and exclude job separator and continue scanning.
TWJC_JSXS: Detect and exclude job separator and stop scanning.
If the application selects options other than none, it should check the EOJ field for one of the TWEJ_xxx patch codes of the PENDINGXFERS data.
To distinguish between jobs, a job separator sheet containing patch code can be inserted. If the application knows the how to save different jobs, the TWJC_JSIC or TWJC_JSXC can be used. When this job separator is detected, the application will give a separate name for each job. If the application does not know how to save different jobs, it can use TWJC_JSIS or TWJC_JSXS to stop scanning and ask the user for different job name.""",
        version="1.7",
        allowed_values=["TWJC_NONE", "TWJC_JSIC", "TWJC_JSIS", "TWJC_JSXC", "TWJC_JSXS"],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x102C: Capability(
        id=0x102C,
        name="language",
        twain_type="TW_UINT16",
        doc="""Description:
Allows Application and Source to identify which languages they have in common for the exchange of string data, and to select the language of the internal UI.
Note: Since the TWLG_xxxx codes include language and country data, there is no separate capability for selecting the country.

Application:
In multi-lingual environments, it is the responsibility of the Application to recall the last selected language for a given User.""",
        version="1.8",
        allowed_values=[
            "TWLG_USERLOCALE",
            "TWLG_DAN",
            "TWLG_DUT",
            "TWLG_ENG",
            "TWLG_USA",
            "TWLG_FRENCH",
            "TWLG_GERMAN",
            "TWLG_SPANISH",
            "TWLG_JAPANESE",
            "...(see spec for full list)",
        ],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x101E: Capability(
        id=0x101E,
        name="max_batch_buffers",
        twain_type="TW_UINT32",
        doc="""Description:
Describes the number of pages that the scanner can buffer when CAP_AUTOSCAN is enabled.

Application:
MSG_GET returns the supported values
MSG_SET sets the current number pages to be buffered (if the Source allows this to be set)""",
        version="1.8",
        allowed_values="1 to 2^32 - 1",
        containers=["TW_ONEVALUE", "TW_ENUMERATION", "TW_RANGE"],
    ),
    0x1038: Capability(
        id=0x1038,
        name="micr_enabled",
        twain_type="TW_BOOL",
        doc="""Description:
Get this capability to determine if the Source supports check scanning. If set to TRUE check scanning is enabled, if set to FALSE check scanning is disabled.""",
        version="2.0",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1023: Capability(
        id=0x1023,
        name="page_multiple_acquire",
        twain_type="None",
        doc="""Unknown""",
        version="1.8",
        allowed_values=[],
        containers=[],
    ),
    0x102F: Capability(
        id=0x102F,
        name="paper_binding",
        twain_type="None",
        doc="""Unknown""",
        version="1.8",
        allowed_values=[],
        containers=[],
    ),
    0x100D: Capability(
        id=0x100D,
        name="paper_detectable",
        twain_type="TW_BOOL",
        doc="""Description:
This capability determines whether the device has a paper sensor that can detect documents on the ADF or Flatbed.
This is a read only capability.

Application:
If the source returns FALSE, the application should not rely on values such as CAP_FEEDERLOADED, and continue as if the paper is loaded.""",
        version="1.6",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1043: Capability(
        id=0x1043,
        name="paper_handling",
        twain_type="TW_UINT16",
        doc="""Description:
Use this capability to control paper handling. This capability may affect scanning speed.

Application:
Use it to improve paper handling.
The Source may not support all combinations of values it returns in MSG_GET, so check the current value if the Source returns TWRC_CHECKSTATUS.""",
        version="2.2",
        allowed_values=["TWPH_NORMAL", "TWPH_FRAGILE", "TWPH_THICK", "TWPH_TRIFOLD", "TWPH_PHOTOGRAPH"],
        containers=["TW_ARRAY", "TW_ONEVALUE"],
    ),
    0x1031: Capability(
        id=0x1031,
        name="passthru",
        twain_type="None",
        doc="""Unknown""",
        version="1.8",
        allowed_values=[],
        containers=[],
    ),
    # 0x1034: Capability(
    #     id=0x1034,                                                    # noqa: ERA001
    #     name="power_downtime",                                        # noqa: ERA001
    #     tw_type="None",                                               # noqa: ERA001
    #     doc="""Depricated, id has been reused by CAP_CAMERASIDE""",   # noqa: ERA001
    #     version="1.8",                                                # noqa: ERA001
    #     allowed_values=[],                                            # noqa: ERA001
    #     containers=[],                                                # noqa: ERA001
    # ),
    0x1046: Capability(
        id=0x1046,
        name="power_save_time",
        twain_type="TW_INT32",
        doc="""Description:
When used with MSG_SET, set the camera power down timer in seconds. When used with MSG_GET, return the current setting of the power down time.

Application:
Use this capability with MSG_SET to set the user selected camera power down time, when no activity is detected by the camera. The default value of -1 means no power down, power is always on.""",
        version="1.8",
        allowed_values=">= -1",
        containers=["TW_ONEVALUE", "TW_RANGE"],
    ),
    0x1020: Capability(
        id=0x1020,
        name="power_supply",
        twain_type="TW_UINT16",
        doc="""Description:
MSG_GET reports the kinds of power available to the device. MSG_GETCURRENT reports the current power supply in use.
This is a read only capability.""",
        version="1.8",
        allowed_values=["TWPS_EXTERNAL", "TWPS_BATTERY"],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1026: Capability(
        id=0x1026,
        name="printer",
        twain_type="TW_UINT16",
        doc="""Description:
MSG_GET returns the current list of available printer devices, along with the one currently being used for negotiation. MSG_SET selects the current device for negotiation, and optionally constrains the list. MSG_RESET restores all the available devices (useful after MSG_SET has been used to constrain the list).
Top/Bottom refer to duplex devices, and indicate if the printer is writing on the top or the bottom of the sheet of paper. Simplex devices use the top settings.
Before/After indicates whether printing occurs before or after the sheet of paper has been scanned.

Application:
Use this capability to determine which printers are available for negotiation, and to select a specific printer prior to negotiation.""",
        version="1.8",
        allowed_values=[
            "TWPR_IMPRINTERTOPBEFORE",
            "TWPR_IMPRINTERTOPAFTER",
            "TWPR_IMPRINTERBOTTOMBEFORE",
            "TWPR_IMPRINTERBOTTOMAFTER",
            "TWPR_ENDORSERTOPBEFORE",
            "TWPR_ENDORSERTOPAFTER",
            "TWPR_ENDORSERBOTTOMBEFORE",
            "TWPR_ENDORSERBOTTOMAFTER",
        ],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1027: Capability(
        id=0x1027,
        name="printer_enabled",
        twain_type="TW_BOOL",
        doc="""Description:
Turns the current CAP_PRINTER device on or off.""",
        version="1.8",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1047: Capability(
        id=0x1047,
        name="printer_char_rotation",
        twain_type="TW_UINT32",
        doc="""Description:
Specify the angle of rotation of individual characters within the string to be printed by the current printer.
A value of 0 specifies that if you hold a document with the feed edge on the left and the printed text facing you, characters are upright. A non-zero value specifies character rotation clockwise from that orientation, in degrees.
Note: This does not control the rotation or angle of the printed string. TWAIN does not offer that capability. Individual characters are rotated in-place.
Many scanners will support only a single value for this capability, or a few multiples of 90

Application:
Specify the printer's font orientation for string or strings that will be printed on the page during the next acquisition.""",
        version="2.3",
        allowed_values="0 to 359",
        containers=["TW_ONEVALUE", "TW_ENUMERATION", "TW_RANGE"],
    ),
    0x1048: Capability(
        id=0x1048,
        name="printer_font_style",
        twain_type="TW_UINT16",
        doc="""Description:
Designates the printer font styles to be used during the next acquisition.

Application:
Specify the printer's font style for all of the string data that will be printed on the page during the next acquisition.""",
        version="2.3",
        allowed_values=["TWPF_NORMAL", "TWPF_ITALIC", "TWPF_BOLD", "TWPF_SMALLSIZE", "TWPF_LARGESIZE"],
        containers=["TW_ARRAY", "TW_ONEVALUE"],
    ),
    0x1028: Capability(
        id=0x1028,
        name="printer_index",
        twain_type="TW_UINT32",
        doc="""Description:
The counter value of the current CAP_PRINTER device.
TWAIN assumes that every printer has an associated integer counter whose current value can be printed on each scanned page and automatically incremented.
Other CAP_PRINTER* capabilities control whether the counter is printed, how it is formatted, and when and how the counter is incremented.""",
        version="1.8",
        allowed_values="Any value",
        containers=["TW_ONEVALUE", "TW_RANGE"],
    ),
    0x1049: Capability(
        id=0x1049,
        name="printer_index_lead_char",
        twain_type="TW_STR32",
        doc="""Description:
User can set the character to be used for filling the leading digits before the counter value if the counter digits are fewer than CAP_PRINTERINDEXNUMDIGITS.
Examples:
If the lead character is a zero: 00001
If the lead character is a blank: 1

Application:
Send a string containing a single character to the source.""",
        version="2.3",
        allowed_values="Any value",
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x104A: Capability(
        id=0x104A,
        name="printer_index_max_value",
        twain_type="TW_UINT32",
        doc="""Description:
The User can set the maximum value of the counter of the current CAP_PRINTER device. After the counter reaches this value, it will automatically reset to the value specified by CAP_PRINTERINDEX.

Application:
Set this value to specify the counter's maximum value for the current CAP_PRINTER device. Set it to 0 for the device's maximum limit.""",
        version="2.3",
        allowed_values="Any value",
        containers=["TW_ONEVALUE", "TW_ENUMERATION", "TW_RANGE"],
    ),
    0x104B: Capability(
        id=0x104B,
        name="printer_index_num_digits",
        twain_type="TW_UINT32",
        doc="""Description:
Right justify the counter of the current CAP_PRINTER device. The fill character is set by CAP_PRINTERLEADCHAR.

Application:
Set it to 0 to make it left justified. Allowing the counter to exceed the number of available digits results in undefined behavior.""",
        version="2.3",
        allowed_values="Positive values",
        containers=["TW_ONEVALUE", "TW_ENUMERATION", "TW_RANGE"],
    ),
    0x104C: Capability(
        id=0x104C,
        name="printer_index_step",
        twain_type="TW_UINT32",
        doc="""Description:
Set the counter increment for the current CAP_PRINTER device to any positive value. Base value of the counter is specified by CAP_PRINTERINDEX. Counter will increment with CAP_PRINTERINDEXSTEP every time when event specified in CAP_PRINTERINDEXTRIGGER occurs.""",
        version="2.3",
        allowed_values="Any positive value",
        containers=["TW_ONEVALUE", "TW_ENUMERATION", "TW_RANGE"],
    ),
    0x104D: Capability(
        id=0x104D,
        name="printer_index_trigger",
        twain_type="TW_UINT16",
        doc="""Description:
Specify the events which cause the printer's counter to increment its value. If no trigger is specified (the array is empty) then the counter never increments.
TWCT_PAGE should be used alone. The other values can be mixed in any combination.""",
        version="2.3",
        allowed_values=[
            "TWCT_PAGE",
            "TWCT_PATCH1",
            "TWCT_PATCH2",
            "TWCT_PATCH3",
            "TWCT_PATCH4",
            "TWCT_PATCHT",
            "TWCT_PATCH6",
        ],
        containers=["TW_ARRAY", "TW_ONEVALUE"],
    ),
    0x1029: Capability(
        id=0x1029,
        name="printer_mode",
        twain_type="TW_UINT16",
        doc="""Description:
Based on the value of this capability, printed text will consist of:
• TWPM_SINGLESTRING a single line consisting of the value of CAP_PRINTERSTRING.
• TWPM_MULTISTRING all the strings in the value of CAP_PRINTERSTRING, printed one per line, in order.
• TWPM_COMPOUNDSTRING the value of CAP_PRINTERSTRING followed by the printer's current counter value, followed by the value of CAP_PRINTERSUFFIX.
• TWPM_IMAGEADDRESSSTRING the value of CAP_PRINTERSTRING followed by the printer's current image address (active TWEI_IAFIELD*_VALUE fields), followed by the value of CAP_PRINTERSUFFIX.

Application:
Negotiate this capability to specify the mode of printing to use when the current CAP_PRINTER device is enabled.""",
        version="1.8",
        allowed_values=["TWPM_SINGLESTRING", "TWPM_MULTISTRING", "TWPM_COMPOUNDSTRING", "TWPM_IMAGEADDRESSSTRING"],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x102A: Capability(
        id=0x102A,
        name="printer_string",
        twain_type="TW_STR255",
        doc="""Description:
Specifies the string(s) that are to be used in the string component when the current CAP_PRINTER device is enabled.

Application:
Negotiate this capability to specify the string or strings to be used for printing (depending on printer mode). Use enumeration to print multiple lines of text, one line per string in the enumerated list. Be sure to check the status codes if attempting multiple lines, since not all devices support this feature.""",
        version="1.8",
        allowed_values="Any string",
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x104E: Capability(
        id=0x104E,
        name="printer_string_preview",
        twain_type="TW_STR255",
        doc="""Description:
Return the text that would be printed next, by the imprinter designated by CAP_PRINTER, based on current printer/endorser settings.
The complete text is an N-element TW_ARRAY with each element containing the text of the corresponding line.
This is a read only capability.""",
        version="2.3",
        allowed_values="Any string",
        containers=["TW_ARRAY", "TW_ONEVALUE"],
    ),
    0x102B: Capability(
        id=0x102B,
        name="printer_suffix",
        twain_type="TW_STR255",
        doc="""Description:
Specifies the string that shall be used as the current CAP_PRINTER device's suffix.

Application:
Negotiate this capability to specify the string that is used as the suffix for printing if TWPM_COMPOUNDSTRING is used.""",
        version="1.8",
        allowed_values="Any string",
        containers=["TW_ONEVALUE"],
    ),
    0x1045: Capability(
        id=0x1045,
        name="printer_vertical_offset",
        twain_type="TW_FIX32",
        doc="""Description:
Specifies a Y-Offset in ICAP_UNITS units for the current CAP_PRINTER device.""",
        version="2.2",
        allowed_values="Any value",
        containers=["TW_ONEVALUE", "TW_RANGE"],
    ),
    0x1030: Capability(
        id=0x1030,
        name="reacquire_allowed",
        twain_type="TW_BOOL",
        doc="""Description:
Indicates whether the physical hardware (e.g. scanner, digital camera) is capable of acquiring multiple images of the same page without changes to the physical registration of that page.
This is a read only capability.

Application:
Use this capability to enable or disable modes of operation where multiple image acquisitions of the page are required. Examples: preview mode, automated image analysis mode.""",
        version="1.8",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x100A: Capability(
        id=0x100A,
        name="rewind_page",
        twain_type="TW_BOOL",
        doc="""Description:
If TRUE, the Source will return the current page to the input side of the document feeder and feed the last page from the output side of the feeder back into the acquisition area.
If CAP_AUTOFEED is TRUE, automatic feeding will continue after all negotiated frames from this page are acquired.
CAP_FEEDERENABLED must equal TRUE to use this capability.
This capability must have been negotiated as an extended capability to be used in States 5 and 6.

Application:
This capability is used in States 5 and 6 by applications controlling the Source's feeder (usually without the Source's user interface).
If CAP_AUTOFEED is TRUE, the normal automatic feeding will continue after all frames of this page are acquired.""",
        version="1.0",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1035: Capability(
        id=0x1035,
        name="segmented",
        twain_type="TW_UINT16",
        doc="""Description:
Describes the segmentation setting for captured images. Image segmentation occurs when either the device, the Source or the Application breaks up an image into a stream of image components (text, pictures, graphics) that must be assembled by the application to reconstruct the original document. Applications must use the DAT_EXTIMAGEINFO / TWEI_SEGMENTNUMBER field to identify pieces of an image that are associated with each other through segmentation.
Manual segmentation is an advanced way of setting the Source to transfer image components with different parameters from the same page. Not all Sources support this feature.

Application:
Applications should be able to GET/ SET whether segmentation will be applied to captured images.
If the Application sets Manual segmentation, it can specify different settings for every frame in ICAP_FRAMES. In this mode ICAP_FRAMES states before ICAP_COLORMANAGMENTENABLED in capability ordering. The Application can set the current frame by setting ICAP_FRAMES using the TW_ENUMERATION container and changing CurrentIndex only. The number of Frames and their parameters must be kept unchanged during this process, otherwise a Source will set all capabilities the same for all frames.""",
        version="1.91",
        allowed_values=["TWSG_AUTO", "TWSG_NONE", "TWSG_MANUAL"],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x1024: Capability(
        id=0x1024,
        name="serial_number",
        twain_type="TW_STR255",
        doc="""Description:
A string containing the serial number of the currently selected device in the Source. Multiple devices may all report the same serial number.
This is a read only capability.

Application:
The value is device specific, Applications should not attempt to parse the information.""",
        version="1.8",
        allowed_values="Any value",
        containers=["TW_ONEVALUE"],
    ),
    0x104F: Capability(
        id=0x104F,
        name="sheet_count",
        twain_type="TW_UINT32",
        doc="""Description:
Capture the specified number of sheets of paper. A single sheet of paper may result in zero or more images, depending on various settings in the driver (i.e. CAP_DUPLEXENABLED, ICAP_AUTODISCARDBLANKPAGES, etc.) This is a read only capability.

Application:
An application must set CAP_XFERMECH to -1 before using this capability.
A CAP_SHEETCOUNT value of 0 requests that all of the available sheets are captured.
A value of 1 or greater requests that only that number of sheets are captured.
Use DAT_EXTIMAGEINFO to determine which sheet and which side of a sheet an image came from""",
        version="2.4",
        allowed_values="0 to 2^32 - 1",
        containers=["TW_ONEVALUE", "TW_RANGE"],
    ),
    0x1005: Capability(
        id=0x1005,
        name="supported_caps",
        twain_type="TW_UINT16",
        doc="""Description:
Returns a list of all the capabilities for which the Source will answer inquiries. Does not indicate which capabilities the Source will allow to be set by the application. Some capabilities can only be set if certain setup work has been done so the Source cannot globally answer which capabilities are “set-able.”
This is a read only capability.""",
        version="1.0",
        allowed_values="Any “get-able” capability",
        containers=["TW_ARRAY", "TW_ONEVALUE"],
    ),
    0x100C: Capability(
        id=0x100C,
        name="supported_caps_ext",
        twain_type="None",
        doc="""Unknown""",
        version="Unknown",
        allowed_values=[],
        containers=[],
    ),
    0x103D: Capability(
        id=0x103D,
        name="supported_caps_segment_unique",
        twain_type="TW_UINT16",
        doc="""Description:
For Sources that allow unique values to be set for things like the top and bottom or for each segment on a page.
Returns a list of all the capabilities for which the Source allows to have unique values.
This is a read only capability.""",
        version="2.2",
        allowed_values="Any “get-able” capability",
        containers=["TW_ARRAY", "TW_ONEVALUE"],
    ),
    0x103E: Capability(
        id=0x103E,
        name="supported_dats",
        twain_type="TW_UINT32",
        doc="""Description:
Returns a list of all the Data Argument Types (DAT_xxx) for which the Source will answer inquiries. This list does not indicate which DATs the Source will allow to be set by the application. Some DATs can only be set if certain setup work has been done so the Source cannot globally answer which DATs are “set-able.”
HIWORD of the value is DG of DAT. LOWORD of the value is the DAT itself.
This is a read only capability.

Application:
MSG_GET a quick way to determine if a DAT is supported by the Source.""",
        version="2.2",
        allowed_values="All standard and custom DAT_xxx understood by the Source",
        containers=["TW_ARRAY", "TW_ONEVALUE"],
    ),
    0x101B: Capability(
        id=0x101B,
        name="time_before_first_capture",
        twain_type="TW_INT32",
        doc="""Description:
For automatic capture, this value selects the number of milliseconds before the first picture is to be taken, or the first image is to be scanned.""",
        version="1.8",
        allowed_values="0 or greater",
        containers=["TW_ONEVALUE", "TW_RANGE"],
    ),
    0x101C: Capability(
        id=0x101C,
        name="time_between_captures",
        twain_type="TW_INT32",
        doc="""Description:
For automatic capture, this value selects the milliseconds to wait between pictures taken, or images scanned.""",
        version="1.8",
        allowed_values="0 or greater",
        containers=["TW_ONEVALUE", "TW_RANGE"],
    ),
    0x1004: Capability(
        id=0x1004,
        name="time_date",
        twain_type="TW_STR32",
        doc="""Description:
The date and time the image was acquired.
Note: CAP_TIMEDATE does not return the exact time the image was acquired; rather, it returns the closest available approximation of the time the physical phenomena represented by the image was recorded. If the application needs the exact time of acquisition, the application should generate that value itself during the image acquisition procedure.
Stored in the form “YYYY/MM/DD HH:mm:SS.sss” where YYYY is the year, MM is the numerical month, DD is the numerical day, HH is the hour, mm is the minute, SS is the second, and sss is the millisecond.
This capability must be negotiated during State 7 before the call to the DG_CONTROL / DAT_PENDINGXFERS / MSG_ENDXFER triplet. It must also be listed in the CAP_EXTENDEDCAPS capability by the data source.
This is a read only capability.

Source:
The time and date when the image was originally acquired (when the Source entered State 7).
Be sure to leave the space between the ending of the date and beginning of the time fields. Pad the unused characters after the string with zeros.""",
        version="1.0",
        allowed_values="Any date",
        containers=["TW_ONEVALUE"],
    ),
    0x1011: Capability(
        id=0x1011,
        name="thumbnails_enabled",
        twain_type="TW_BOOL",
        doc="""Description:
Allows an application to request the delivery of thumbnail representations for the set of images that are to be delivered.
Setting CAP_THUMBNAILSENABLED to TRUE turns on thumbnail mode. Images transferred thereafter will be sent at thumbnail size (exact thumbnail size is determined by the Data Source).
Setting this capability to FALSE turns thumbnail mode off and returns full size images.

Application:
A successful set of this capability to TRUE will cause the Source to deliver image thumbnails during normal data transfer operations. This mode remains in effect until this capability is set back to FALSE.

Source:
A successful set of this capability to TRUE should enable the delivery of thumbnail images during normal data transfer. Setting this capability to FALSE will disable thumbnail delivery.
If not supported, return TWRC_FAILURE/ TWCC_CAPUNSUPPORTED.""",
        version="1.7",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x100E: Capability(
        id=0x100E,
        name="ui_controllable",
        twain_type="TW_BOOL",
        doc="""Description:
If TRUE, indicates that this Source supports acquisition with the UI disabled; i.e., TW_USERINTERFACE's ShowUI field can be set to FALSE. If FALSE, indicates that this Source can only support acquisition with the UI enabled.
This is a read only capability.

Source:
This capability was introduced in TWAIN 1.6. All Sources compliant with TWAIN 1.6 and above must support this capability. Sources that are not TWAIN 1.6-compliant may return TWRC_FAILURE / TWCC_BADCAP if they do not support this capability.
All Sources compliant with TWAIN 1.9 and above must support the ability to scan without the UI (TW_USERINTERFACE. ShowUI = 0 and CAP_INDICATORS = FALSE) , therefore they must report a value of TRUE for this capability.

Application:
A return value of TWRC_FAILURE / TWCC_CAPUNSUPPORTED indicates that the Source in use is not TWAIN 1.6-compliant. Therefore, the Source may ignore TW_USERINTERFACE's ShowUI field when MSG_ENABLEDS is issued. See the description of DG_CONTROL / DAT_USERINTERFACE / MSG_ENABLEDS for more details.""",
        version="1.6",
        allowed_values=[True, False],
        containers=["TW_ONEVALUE", "TW_ENUMERATION"],
    ),
    0x0001: Capability(
        id=0x0001,
        name="xfer_count",
        twain_type="TW_INT16",
        doc="""Description:
The application is willing to accept this number of images.

Application:
Set this capability to the number of images you are willing to transfer per session. Common values are:
1 Application wishes to transfer only one image this session
-1 Application is willing to transfer multiple images

Source:
If the application limits the number of images it is willing to receive, the Source should not make more transfers available than the specified number.
If the application sets the value to 0, then the Source sets its value to -1 and returns back TWRC_FAILURE / TWCC_CHECKSTATUS.""",
        version="1.0",
        allowed_values=[-1, "1 to 32767"],
        containers=["TW_ONEVALUE", "TW_RANGE"],
    ),
}
