| // Copyright 2020 The Chromium OS Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| syntax = "proto3"; |
| option optimize_for = LITE_RUNTIME; |
| |
| // This file defines messages used for interacting with the document scanner |
| // utility, lorgnette. |
| package lorgnette; |
| |
| // Describes possible types of sources that can be supported by a scanner. |
| enum SourceType { |
| SOURCE_UNSPECIFIED = 0; |
| SOURCE_PLATEN = 1; |
| SOURCE_ADF_SIMPLEX = 2; |
| SOURCE_ADF_DUPLEX = 3; |
| } |
| |
| // A source that can be scanned from for a scanner. |
| message DocumentSource { |
| // The type of this source. |
| SourceType type = 1; |
| |
| // The name for this source used by the scanner backend. |
| string name = 2; |
| } |
| |
| // The color modes that may be supported for a particular scanner. |
| enum ColorMode { |
| MODE_UNSPECIFIED = 0; |
| MODE_LINEART = 1; |
| MODE_GRAYSCALE = 2; |
| MODE_COLOR = 3; |
| } |
| |
| // An object representing one scanner. |
| message ScannerInfo { |
| // The name of the scanner, as reported by SANE. |
| string name = 1; |
| |
| // The manufacturer of the scanner. |
| string manufacturer = 2; |
| |
| // The particular model of scanner. |
| string model = 3; |
| |
| // The type of the scanner, e.g. "video camera", "flatbed scanner". |
| string type = 4; |
| } |
| |
| // Information returned from a ListScanners dbus request. |
| message ListScannersResponse { |
| repeated ScannerInfo scanners = 1; |
| } |
| |
| // Information returned from a GetScannerCapabilities dbus request. |
| message ScannerCapabilities { |
| // Discrete scanning resolutions. |
| repeated uint32 resolutions = 1; |
| |
| // Sources to scan a document from. |
| repeated DocumentSource sources = 2; |
| |
| // Color modes to use for a document. |
| repeated ColorMode color_modes = 3; |
| } |
| |
| // Settings for how lorgnette should perform a scan. |
| message ScanSettings { |
| // The resolution, in DPI, to use for the scan. |
| uint32 resolution = 1; |
| |
| // The source to scan the document from. |
| DocumentSource source = 2; |
| |
| // The color mode to use for the scan. |
| ColorMode color_mode = 3; |
| } |
| |
| // The status of a scan job. |
| enum ScanState { |
| // Unknown state. |
| SCAN_STATE_UNSPECIFIED = 0; |
| |
| // The scan job is currently running. |
| SCAN_STATE_IN_PROGRESS = 1; |
| |
| // The scan job has completed successfully. |
| SCAN_STATE_COMPLETED = 2; |
| |
| // The scan job failed. |
| SCAN_STATE_FAILED = 3; |
| } |
| |
| // Information passed to a StartScan D-Bus request. |
| // Used by lorgnette to initialize a new scan job. |
| message StartScanRequest { |
| // The name of the device to scan from. |
| string device_name = 1; |
| |
| // The settings to use for this scan. |
| ScanSettings settings = 2; |
| } |
| |
| // Information returned from a StartScan D-Bus request. |
| message StartScanResponse { |
| // The status of the scan. |
| ScanState state = 1; |
| |
| // The failure reason if state is SCAN_STATE_FAILED. |
| string failure_reason = 2; |
| |
| // A UUID identifying the scan job. |
| string scan_uuid = 3; |
| } |
| |
| // Information sent with ScanStatus D-Bus signal. |
| message ScanStatusChangedSignal { |
| // A UUID identifying the scan job. |
| string scan_uuid = 1; |
| |
| // The status of the scan. |
| ScanState state = 2; |
| |
| // The failure reason if state is SCAN_STATE_FAILED. |
| string failure_reason = 3; |
| |
| // Scan progress from 0 to 100%. |
| uint32 progress = 4; |
| } |