1 /* sane - Scanner Access Now Easy.
2    Copyright (C) 1997 Geoffrey T. Dairiki
3    This file is part of the SANE package.
4 
5    This program is free software; you can redistribute it and/or
6    modify it under the terms of the GNU General Public License as
7    published by the Free Software Foundation; either version 2 of the
8    License, or (at your option) any later version.
9 
10    This program is distributed in the hope that it will be useful, but
11    WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13    General Public License for more details.
14 
15    You should have received a copy of the GNU General Public License
16    along with this program.  If not, see <https://www.gnu.org/licenses/>.
17 
18    As a special exception, the authors of SANE give permission for
19    additional uses of the libraries contained in this release of SANE.
20 
21    The exception is that, if you link a SANE library with other files
22    to produce an executable, this does not by itself cause the
23    resulting executable to be covered by the GNU General Public
24    License.  Your use of that executable is in no way restricted on
25    account of linking the SANE library code into it.
26 
27    This exception does not, however, invalidate any other reasons why
28    the executable file might be covered by the GNU General Public
29    License.
30 
31    If you submit changes to SANE to the maintainers to be included in
32    a subsequent release, you agree by submitting the changes that
33    those changes may be distributed with this exception intact.
34 
35    If you write modifications of your own for SANE, it is your choice
36    whether to permit this exception to apply to your modifications.
37    If you do not wish that, delete this exception notice.
38 
39    This file is part of a SANE backend for HP Scanners supporting
40    HP Scanner Control Language (SCL).
41 */
42 
43 #ifndef HP_DEVICE_INCLUDED
44 #define HP_DEVICE_INCLUDED
45 #include "hp.h"
46 
47 enum hp_device_compat_e {
48     HP_COMPAT_PLUS 	= 1 << 0, /* HP ScanJet Plus */
49     HP_COMPAT_2C	= 1 << 1,
50     HP_COMPAT_2P	= 1 << 2,
51     HP_COMPAT_2CX	= 1 << 3,
52     HP_COMPAT_4C	= 1 << 4, /* also 3c, 6100C */
53     HP_COMPAT_3P	= 1 << 5,
54     HP_COMPAT_4P	= 1 << 6,
55     HP_COMPAT_5P	= 1 << 7, /* also 4100C, 5100C */
56     HP_COMPAT_5100C	= 1 << 8, /* redundant with 5p */
57     HP_COMPAT_PS	= 1 << 9, /* HP PhotoSmart Photo Scanner */
58     HP_COMPAT_OJ_1150C	= 1 << 10,
59     HP_COMPAT_OJ_1170C	= 1 << 11, /* also later OfficeJets */
60     HP_COMPAT_6200C	= 1 << 12,
61     HP_COMPAT_5200C	= 1 << 13,
62     HP_COMPAT_6300C	= 1 << 14
63 };
64 
65 struct hp_device_s
66 {
67     HpData	data;
68     HpOptSet	options;
69     SANE_Device	sanedev;
70     enum hp_device_compat_e compat;
71 };
72 
73 SANE_Status	sanei_hp_device_new (HpDevice * new, const char * devname);
74 
75 const SANE_Device * sanei_hp_device_sanedevice (HpDevice this);
76 
77 void            sanei_hp_device_simulate_clear (const char *devname);
78 SANE_Status     sanei_hp_device_simulate_set (const char *devname, HpScl scl,
79                                               int flag);
80 SANE_Status     sanei_hp_device_support_get (const char *devname, HpScl scl,
81                                              int *minval, int *maxval);
82 SANE_Status     sanei_hp_device_support_probe (HpScsi scsi);
83 SANE_Status     sanei_hp_device_probe_model (enum hp_device_compat_e *compat,
84                                              HpScsi scsi, int *model_num,
85                                              const char **model_name);
86 SANE_Status     sanei_hp_device_probe (enum hp_device_compat_e *compat,
87                                        HpScsi scsi);
88 hp_bool_t	sanei_hp_device_compat (HpDevice this,
89                                         enum hp_device_compat_e c);
90 
91 
92 #endif /*  HP_DEVICE_INCLUDED */
93