
functions
files
intro
|
|
Printer library.
|
modules/Printerlib.ycp
|
|
Some utility functions for printer conf. tools.
|
|
|
|
Printer library exported functions. What else?!?
Imports
- Directory
- Mode
- Popup
- Report
- String
Includes
Global Variables
Global Functions
- DisplayUnavailableAIPopup ()
- GetCupsUsbDeviceInfo (string device)
- GetCupsUsbDevicesInfo ()
- GetHPAllInOneModels ()
- SetCupsUsbDevicesInfo (list<list<string> > di)
- getDefaultPaperSize ()
- getDeviceNiceName (string dev, boolean detected)
- getEpsonUsbModel (string device)
- getHplipDevices ()
- getHplipUri (string model)
- getPtalDevices ()
- getPtalUri (string model)
- getUriBaudrate (string uri)
- getUriDevice (string uri)
- getUriHost (string uri)
- getUriNiceName (string uri)
- getUriPort (string uri)
- getUriRemoteQueue (string uri)
- getUriType (string uri)
- getUriUsernamePassWorkgroup (string uri)
- getUriValue (string uri, string key)
- testDevice (string dev)
- testRemote (string hname, string rname, string type, integer port)
- testRemoteUP (string wg, string hname, string rname, string user, string pass, string type)
Local Variables
Local Functions
|
|
|
|
local paper_size -> symbol
|
|
System paper size, taken from system locales. 0 for a4 and 1 for
letter. -1 for unknown. Use function Printerlib::getDefaultPaperSize
for accessing this function.
|
local cups_usb_devices_info -> list<list<string> >
|
|
Info about USB devices got through CUPS backend
Contains lists of [, , ]
|
global proposal_valid -> boolean
|
|
set to true after function Read had been called.
|
global baseDataDir -> string
|
|
Base directory of printconf's data files
|
local hp_all_in_one -> list<string>
|
|
list of HP all-in-one models
|
local probed_bt_devices -> map<string,string>
|
|
List of probed bluetooth devices (in order to keep their names)
|
global SetCupsUsbDevicesInfo (list<list<string> > di) -> void
|
|
Set the USB devices info got through the CUPS backend
- Parameters:
|
di |
a list of found CUPS devices |
|
global GetCupsUsbDevicesInfo () -> list<list<string> >
|
|
Return the currently stored CUPS USB devices info
|
global GetCupsUsbDeviceInfo (string device) -> list<string>
|
|
Get info about device connected to USB port from CUPS backed
- Parameters:
|
device |
string USB device to examine |
- Return value:
|
|
a list containing CUPS device name, Printer model and
UNIX-like device |
|
global GetHPAllInOneModels () -> list<string>
|
|
Get the list of all HP all-in-one models
|
global DisplayUnavailableAIPopup () -> void
|
|
Inform user that function isn't available during preparatino of AI
via a popup
|
local wakeUpEpson (string device) -> void
|
|
Sends sequence to wake up Epson stylus usb printers.
- Parameters:
|
device |
Device to send sequence to. Should be /dev/usblp? (or /dev/usb/lp?) |
- See:
-
|
global getPtalDevices () -> list<list<string> >
|
|
Get list of all PTAL devices
- Return value:
|
global getHplipDevices () -> list<list<string> >
|
|
Get list of all HPLIP devices
- Return value:
|
global getPtalUri (string model) -> string
|
|
Get URI of ptal device
- Parameters:
|
model |
string device model identification |
- Return value:
|
|
ptal uri or nil if no ptal device found |
|
global getHplipUri (string model) -> string
|
|
Get URI of HPLIP device
- Parameters:
|
model |
string device model identification |
- Return value:
|
|
ptal uri or nil if no ptal device found |
|
global getEpsonUsbModel (string device) -> string
|
|
Calls escputil to find out exact model of Epson stylus printer.
- Parameters:
|
device |
USB Device to examine. |
- Return value:
|
|
Printer model. If unsuccessful, returns "Stylus". |
|
global testDevice (string dev) -> void
|
|
Test device by sending hello world to it. See test_device for details.
- Parameters:
|
dev |
device to test (/dev/lp0) |
|
global testRemoteUP (string wg, string hname, string rname, string user, string pass, string type) -> void
|
|
Test remote queue accessibility if username and password needed
- Parameters:
|
wg |
string workgroup for samba test |
|
hname |
string hostname of remote host |
|
rname |
string name of remote queue |
|
user |
string username to access remote queue |
|
pass |
string password to access remote queue |
|
type |
string "samba" or "novell" |
|
global testRemote (string hname, string rname, string type, integer port) -> void
|
|
Test of the connection. See test_remote_lpd for details.
- Parameters:
|
hname |
host name |
|
rname |
name of remote queue |
|
type |
queue type |
|
port |
TCP port |
|
global getUriType (string uri) -> string
|
|
Printer uri = type://device
where type is one of parallel, serial, usb, file, lpd, novell,
samba, ipp, socket, http
and device is depending on the type. For parallel, serial, usb, file
it is file name. For lpd it is server/queue.
For socket it is server, for ipp, http it is server/path_to_queue, for
samba, novell it is user:pass@server/queuename (user, pass is
optional).
- Parameters:
|
uri |
printer uri (file://tmp/pr.tmp, lpd://d11.suse.de) |
- Return value:
|
global getUriDevice (string uri) -> string
|
|
Get printer device from its uri.
- Parameters:
- Return value:
- See:
-
|
global getUriRemoteQueue (string uri) -> string
|
|
Get printer remote queue. Input to this function must be valid
because it just takes the part of uri after the last slash.
Should be used for: lpd, novell, samba, http/ipp.
- Parameters:
- Return value:
- See:
-
|
global getUriPort (string uri) -> integer
|
|
Get port number from URI.
- Parameters:
- Return value:
|
global getUriValue (string uri, string key) -> string
|
|
Get any parameter from uri. Suppose uri has form:
method://user:pass@address/path?key=value+key=value+key=value
- Parameters:
|
uri |
printer uri |
|
key |
key to extract |
- Return value:
|
global getUriBaudrate (string uri) -> integer
|
|
Get printer baud rate from uri. Applies to serial printers only.
Does not check if passed uri belongs to serial printer.
- Parameters:
- Return value:
- See:
-
|
global getUriHost (string uri) -> string
|
|
Get host name from uri. Applies to lpd, novell, samba, ipp/http,
socket
- Parameters:
- Return value:
- See:
-
|
global getUriUsernamePassWorkgroup (string uri) -> list
|
|
Get uri user name and password. Applies to samba, novell.
- Parameters:
- Return value:
|
|
[ username, password, workgroup ] |
- See:
-
|
global getUriNiceName (string uri) -> string
|
|
Get nice name for printer uri
- Parameters:
- Return value:
|
|
nice name of printer uri (device, network printer...) |
|
global getDeviceNiceName (string dev, boolean detected) -> string
|
|
Get nice name of some device.
- Parameters:
|
dev |
device |
|
detected |
boolean set to true if displaying detected dialog |
- Return value:
|
global getDefaultPaperSize () -> symbol
|
|
get paper size from system and returns `a4 for a4 or `letter for letter
- Return value:
|
|
`a4 for a4, `letter for letter |
|