]>
git.saurik.com Git - apple/mdnsresponder.git/blob - Clients/PrinterSetupWizard/UtilTypes.h
2 * Copyright (c) 1997-2004 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
23 Change History (most recent first):
26 Revision 1.11 2005/03/05 02:27:46 shersche
27 <rdar://problem/4030388> Generic drivers don't do color
29 Revision 1.10 2005/02/08 21:45:06 shersche
30 <rdar://problem/3947490> Default to Generic PostScript or PCL if unable to match driver
32 Revision 1.9 2005/02/01 01:16:12 shersche
33 Change window owner from CSecondPage to CPrinterSetupWizardSheet
35 Revision 1.8 2005/01/06 08:18:26 shersche
36 Add protocol field to service, add EmptyQueues() function to service
38 Revision 1.7 2005/01/04 21:07:29 shersche
39 add description member to service object. this member corresponds to the 'ty' key in a printer text record
41 Revision 1.6 2004/12/30 01:24:02 shersche
42 <rdar://problem/3906182> Remove references to description key
45 Revision 1.5 2004/12/29 18:53:38 shersche
46 <rdar://problem/3725106>
47 <rdar://problem/3737413> Added support for LPR and IPP protocols as well as support for obtaining multiple text records. Reorganized and simplified codebase.
48 Bug #: 3725106, 3737413
50 Revision 1.4 2004/09/13 21:22:44 shersche
51 <rdar://problem/3796483> Add moreComing argument to OnAddPrinter and OnRemovePrinter callbacks
54 Revision 1.3 2004/06/26 23:27:12 shersche
55 support for installing multiple printers of the same name
57 Revision 1.2 2004/06/25 02:25:59 shersche
58 Remove item field from manufacturer and model structures
59 Submitted by: herscher
61 Revision 1.1 2004/06/18 04:36:58 rpantos
72 #include <DebugServices.h>
74 class CPrinterSetupWizardSheet
;
76 #define kDefaultPriority 50
77 #define kDefaultQTotal 1
79 namespace PrinterSetupWizard
87 typedef std :: list
< Queue
*> Queues
;
88 typedef std :: list
< Printer
*> Printers
;
89 typedef std :: list
< Service
*> Services
;
90 typedef std :: list
< Model
*> Models
;
101 const std :: string
& type
104 CPrinterSetupWizardSheet
* window
;
108 // These are from the browse reply
115 // These keep track of the different services associated with this printer.
116 // the services are ordered according to preference.
121 // these are derived from the printer matching code
123 // if driverInstalled is false, then infFileName should
124 // have an absolute path to the printers inf file. this
125 // is used to install the printer from printui.dll
127 // if driverInstalled is true, then model is the name
128 // of the driver to use in AddPrinter
130 bool driverInstalled
;
132 CString manufacturer
;
133 CString displayModelName
;
161 // these are from the resolve
163 DNSServiceRef serviceRef
;
165 unsigned short portNumber
;
173 unsigned short qtotal
;
176 // There will usually one be one of these, however
177 // this will handle printers that have multiple
178 // queues. These are ordered according to preference.
207 find ( const CString
& name
);
213 bool driverInstalled
;
228 while ( services
. size () > 0 )
230 Service
* service
= services
. front ();
231 services
. pop_front ();
237 Printer :: LookupService
239 const std :: string
& type
242 Services :: iterator it
;
244 for ( it
= services
. begin (); it
!= services
. end (); it
++ )
246 Service
* service
= * it
;
248 if ( strcmp ( service
-> type
. c_str (), type
. c_str ()) == 0 )
260 qtotal ( kDefaultQTotal
)
267 check ( serviceRef
== NULL
);
273 Service :: EmptyQueues ()
275 while ( queues
. size () > 0 )
277 Queue
* q
= queues
. front ();
286 priority ( kDefaultPriority
)
296 Manufacturer :: find ( const CString
& name
)
300 for ( it
= models
. begin (); it
!= models
. end (); it
++ )
304 if ( model
-> name
= name
)