Scanner settings, input and output functions
List of Global Functions
Abort - Abort function
ActivateBackend - Activate the backend in /etc/sane.d/dll.conf according to the specified backend_name or if the specified backend_name is the empty string then set the backend_name according to a specified database_index.
AutoPackages - Return packages needed to be installed and removed during autoinstallation to insure module has all needed software installed.
DeactivateBackend - Deactivate the backend in /etc/sane.d/dll.conf according to the specified backend_name or if the specified backend_name is the empty string then set the backend_name according to a specified database_index.
DetermineNetworkScanningConfig - Determine the network scanning config by calling a bash script which calls "grep ... /etc/sane.d/net.conf" and "grep ... /etc/sane.d/saned.conf" and processes its output and stores the results as YCP map in a temporary file and then read the temporary file (SCR::Read) to get the YCP map. Additionally call SuSEFirewall functions to determine the firewall settings regarding remote access to the saned (service "sane-port" 6566/tcp,6566/udp).
Export - Dump the scanner settings to a single map. For use by autoinstallation.
Import - Get all scanner settings from the first parameter. For use by autoinstallation.
ModelItems - Create a list of items from the database entries which is used for the SelectionBox in the SelectModelDialog
Modified - Something was committed to the system?
OverviewContents - Create the content for WizardHW::SetContents
Read - Read all scanner settings: - Check installed packages - Read or create the scanner database - Determine active scanners - Determine active backends - Try to autodetect USB and SCSI scanners
RestartDetection - Restart the whole autodetection by calling all autodetection functions in the same order as during the initial Read(): DetermineActiveScanners results a new active_scanners map which is empty if nothing was detected or if DetermineActiveScanners fails. DetermineActiveBackends results a new active_backends list which is empty if nothing was detected or if DetermineActiveBackends fails. AutodetectScanners results a new autodetected_scanners map which is empty if nothing was detected or if AutodetectScanners fails. RestartDetection is called when the user restarts the detection in the OverviewDialog and if testing of an active scanner failed (see the TestBackend function). The result is that all information in the OverviewDialog is recreated.
SetupNetworkScanningConfig - Setup the network scanning config by calling a bash script which activates or deactivates the "net" backend and which writes into /etc/sane.d/net.conf, /etc/sane.d/saned.conf, and /etc/xinetd.d/sane-port and reloads or starts the xinetd dependig on whether it is running or not. Additionally call SuSEFirewall functions to commit changed firewall settings regarding remote access to the saned (service "sane-port" 6566/tcp,6566/udp).
TestBackend - Test the backend according to the specified backend_name.
Write - Write scanner settings: - Save the actual environment
List of Global Variables
active_backends - Active backends: Determined at runtime via Scanner::DetermineActiveBackends() which calls the bash script "/usr/lib/YaST2/bin/determine_active_scanner_backends YCP" which outputs on stdout a YCP list of backends [ "The name of the backend", ... "" ] where the last list entry is an empty string.
active_scanners - Active scanners: Determined at runtime via Scanner::DetermineActiveScanners() which calls the bash script "/usr/lib/YaST2/bin/determine_active_scanners YCP" which outputs on stdout a YCP list of @ref active_scanner_map where the last list entry is an emtpy map.
actual_environment - Environment values: It is a map of @ref environment_values
autodetected_scanners - Autodetected scanners: Determined at runtime via Scanner::AutodetectScanners() which calls the bash script "/usr/lib/YaST2/bin/autodetect_scanners YCP" which calls "sane-find-scanner" which may result for example the description strings in the example below. Only in case of USB an automated extraction of manufacturer is possible. If there are two '[...]' substrings then the first one is the manufacturer and the second one is the model (but there may be only one or none substring). The result is a YCP list of @ref autodetected_scanner_map where the last list entry is an emtpy map.
database - Scanner database: When package version of sane/hp-officeJet/iscan/iscan-free changes the database is created anew in Scanner::Read() which calls the bash script "/usr/lib/YaST2/bin/create_scanner_database YCP" which outputs on stdout a YCP list of @ref scanner_model_map where the last list entry is an emtpy map.
database_manufacturers - Manufacturer list: List of unique manufacturer names. Derived during startup from the scanner database (in the Read function stage "Read or create the scanner database").
firewall_config - Firewall network scanning configuration: Determined at runtime via Scanner::DetermineNetworkScanningConfig() which calls SuSEFirewall functions to fill the map @ref firewall_config except "ui_no_firewall_for_int" and "ui_deny_from_ext" which are the user settings in the dialog. The entries are such that "true" is the default, reasonable and intended setting.
modified - Something was committed to the system? True if system may have been modified.
network_scanning_config - Network scanning configuration: Determined at runtime via Scanner::DetermineNetworkScanningConfig() which calls the bash script "/usr/lib/YaST2/bin/determine_network_scanner_config YCP" which outputs on stdout a YCP map @ref network_scanner_config
selected_autodetected_scanners_index - Selected autodetected scanners index: The index in the autodetected scanners list (of autodetected scanner maps) for the model which was selected by the user in the OverviewDialog. Preset to -1 which indicates that no model is selected.
selected_model_database_index - Selected model database index: The index in the scanner database list (of model maps) for the model which was selected by the user in the SelectModelDialog. Preset to -1 which indicates that no model is selected.
write_only - Write only, used during autoinstallation. Don't run services and SuSEconfig, it's all done at one place.
Activate the backend in /etc/sane.d/dll.conf according to the specified backend_name or if the specified backend_name is the empty string then set the backend_name according to a specified database_index.
Function parameters
string backend_name
integer database_index
boolean user_confirmation
Return value
boolean - true on success
Return packages needed to be installed and removed during autoinstallation to insure module has all needed software installed.
Return value
map - with 2 lists.
Deactivate the backend in /etc/sane.d/dll.conf according to the specified backend_name or if the specified backend_name is the empty string then set the backend_name according to a specified database_index.
Function parameters
string backend_name
integer database_index
boolean user_confirmation
Return value
boolean - true on success
Determine the network scanning config by calling a bash script which calls "grep ... /etc/sane.d/net.conf" and "grep ... /etc/sane.d/saned.conf" and processes its output and stores the results as YCP map in a temporary file and then read the temporary file (SCR::Read) to get the YCP map. Additionally call SuSEFirewall functions to determine the firewall settings regarding remote access to the saned (service "sane-port" 6566/tcp,6566/udp).
Return value
boolean - true on success
Dump the scanner settings to a single map. For use by autoinstallation.
Return value
map - Dumped settings (later acceptable by Import ())
Get all scanner settings from the first parameter. For use by autoinstallation.
Function parameters
map settings
Return value
boolean - true on success
Create a list of items from the database entries which is used for the SelectionBox in the SelectModelDialog
Function parameters
string filter_string
Return value
list - of model strings (manufacturer, model, backend, comment)
Something was committed to the system?
Return value
boolean - true if system may have been modified
Create the content for WizardHW::SetContents
Return value
list< map< string, any > > - a list of maps with keys "id" : string = the identification of the device, "rich_descr" : string = RichText description of the device "table_descr" : list<string> = fields of the table
Read all scanner settings: - Check installed packages - Read or create the scanner database - Determine active scanners - Determine active backends - Try to autodetect USB and SCSI scanners
Return value
boolean - true on success
Restart the whole autodetection by calling all autodetection functions in the same order as during the initial Read(): DetermineActiveScanners results a new active_scanners map which is empty if nothing was detected or if DetermineActiveScanners fails. DetermineActiveBackends results a new active_backends list which is empty if nothing was detected or if DetermineActiveBackends fails. AutodetectScanners results a new autodetected_scanners map which is empty if nothing was detected or if AutodetectScanners fails. RestartDetection is called when the user restarts the detection in the OverviewDialog and if testing of an active scanner failed (see the TestBackend function). The result is that all information in the OverviewDialog is recreated.
Return value
boolean - true in any case (errors result only empty maps or list).
Setup the network scanning config by calling a bash script which activates or deactivates the "net" backend and which writes into /etc/sane.d/net.conf, /etc/sane.d/saned.conf, and /etc/xinetd.d/sane-port and reloads or starts the xinetd dependig on whether it is running or not. Additionally call SuSEFirewall functions to commit changed firewall settings regarding remote access to the saned (service "sane-port" 6566/tcp,6566/udp).
Return value
boolean - true on success
Test the backend according to the specified backend_name.
Function parameters
string backend_name
Return value
boolean - true on success
Active backends: Determined at runtime via Scanner::DetermineActiveBackends() which calls the bash script "/usr/lib/YaST2/bin/determine_active_scanner_backends YCP" which outputs on stdout a YCP list of backends [ "The name of the backend", ... "" ] where the last list entry is an empty string.
Active scanners: Determined at runtime via Scanner::DetermineActiveScanners() which calls the bash script "/usr/lib/YaST2/bin/determine_active_scanners YCP" which outputs on stdout a YCP list of @ref active_scanner_map where the last list entry is an emtpy map.
active_scanner_map $[ "backend":"The name of the backend (required)", "sane_device":"The SANE device (required)", "manufacturer":"The manufacturer name of the scanner (required)", "model":"The model name of the scanner (required)", ]
Environment values: It is a map of @ref environment_values
environment_values $[ "sane_version":"What 'rpm -q sane' returns (required)", "hplip_version":"What 'rpm -q hplip' returns (required)", "hp-officeJet_version":"What 'rpm -q hp-officeJet' returns (required)", "iscan_version":"What 'rpm -q iscan' returns (required)" "iscan-free_version":"What 'rpm -q iscan-free' returns (required)" ]
Autodetected scanners: Determined at runtime via Scanner::AutodetectScanners() which calls the bash script "/usr/lib/YaST2/bin/autodetect_scanners YCP" which calls "sane-find-scanner" which may result for example the description strings in the example below. Only in case of USB an automated extraction of manufacturer is possible. If there are two '[...]' substrings then the first one is the manufacturer and the second one is the model (but there may be only one or none substring). The result is a YCP list of @ref autodetected_scanner_map where the last list entry is an emtpy map.
autodetected_scanner_map $[ "connection":"Either USB or SCSI (required)", "device":"The device, e.g. '/dev/sg0' or 'libusb:001:002' (may be the empty string)" "manufacturer":"The manufacturer name of the scanner (may be the empty string)", "usb_vendor_id":"The vendor ID (e.g. 0x04b8) of a USB scanner (may be the empty string)", "model":"The model name of the scanner (may be the empty string)", "usb_product_id":"The product ID (e.g. 0x010b) of a USB scanner (may be the empty string)", "description":"The sane-find-scanner output description string (required)" ]
Scanner database: When package version of sane/hp-officeJet/iscan/iscan-free changes the database is created anew in Scanner::Read() which calls the bash script "/usr/lib/YaST2/bin/create_scanner_database YCP" which outputs on stdout a YCP list of @ref scanner_model_map where the last list entry is an emtpy map.
scanner_model_map $[ "package":"The package which provides the backend: sane/hplip/hp-officeJet/iscan/iscan-free (required)", "backend":"The name of the backend (required)", "manufacturer":"The manufacturer name of the scanner (required)", "model":"The model name of the scanner (required)", "firmware":"Whether or not firmware upload is required (value is 'required' or the empty string)", "interface":"None or one or more scanner interfaces (may be the empty string)", "usbid":"USBvendorID:USBproductID" e.g. "0x0a1b:0x2c3d" (may be the empty string)", "status":"The support status: basic/complete/good/minimal/unsupported/untested (required)", "comment":"An optional comment (may be the empty string)" ]
Manufacturer list: List of unique manufacturer names. Derived during startup from the scanner database (in the Read function stage "Read or create the scanner database").
Firewall network scanning configuration: Determined at runtime via Scanner::DetermineNetworkScanningConfig() which calls SuSEFirewall functions to fill the map @ref firewall_config except "ui_no_firewall_for_int" and "ui_deny_from_ext" which are the user settings in the dialog. The entries are such that "true" is the default, reasonable and intended setting.
firewall_config $[ "suse_firewall_used":"true if Suse Firewall and no other firewall is used", "firewall_active":"true if Suse Firewall is actually running", "no_firewall_for_int":"true if Suse Firewall does not potect the INT zone", "ui_no_firewall_for_int":"true if user has set in dialog no Suse Firewall protection for INT", "denied_from_ext":"true if saned access (sane-port 6566) is denied from EXT zone", "ui_deny_from_ext":"true if user has set in dialog to deny access from EXT" ]
Network scanning configuration: Determined at runtime via Scanner::DetermineNetworkScanningConfig() which calls the bash script "/usr/lib/YaST2/bin/determine_network_scanner_config YCP" which outputs on stdout a YCP map @ref network_scanner_config
network_scanner_config $[ "net_backend_hosts":"Comma seperated list of hosts in /etc/sane.d/net.conf", "saned_hosts":"Comma seperated list of hosts or subnets in /etc/sane.d/saned.conf" ]
Selected autodetected scanners index: The index in the autodetected scanners list (of autodetected scanner maps) for the model which was selected by the user in the OverviewDialog. Preset to -1 which indicates that no model is selected.
Selected model database index: The index in the scanner database list (of model maps) for the model which was selected by the user in the SelectModelDialog. Preset to -1 which indicates that no model is selected.