]>
git.saurik.com Git - apple/mdnsresponder.git/blob - Clients/PrinterSetupWizard/UtilTypes.h
11042ddf136151afa9ea855832e9d890bc164655
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.8 2005/01/06 08:18:26 shersche
27 Add protocol field to service, add EmptyQueues() function to service
29 Revision 1.7 2005/01/04 21:07:29 shersche
30 add description member to service object. this member corresponds to the 'ty' key in a printer text record
32 Revision 1.6 2004/12/30 01:24:02 shersche
33 <rdar://problem/3906182> Remove references to description key
36 Revision 1.5 2004/12/29 18:53:38 shersche
37 <rdar://problem/3725106>
38 <rdar://problem/3737413> Added support for LPR and IPP protocols as well as support for obtaining multiple text records. Reorganized and simplified codebase.
39 Bug #: 3725106, 3737413
41 Revision 1.4 2004/09/13 21:22:44 shersche
42 <rdar://problem/3796483> Add moreComing argument to OnAddPrinter and OnRemovePrinter callbacks
45 Revision 1.3 2004/06/26 23:27:12 shersche
46 support for installing multiple printers of the same name
48 Revision 1.2 2004/06/25 02:25:59 shersche
49 Remove item field from manufacturer and model structures
50 Submitted by: herscher
52 Revision 1.1 2004/06/18 04:36:58 rpantos
63 #include <DebugServices.h>
67 #define kDefaultPriority 50
68 #define kDefaultQTotal 1
70 namespace PrinterSetupWizard
78 typedef std :: list
< Queue
*> Queues
;
79 typedef std :: list
< Service
*> Services
;
80 typedef std :: list
< Model
*> Models
;
91 const std :: string
& type
98 // These are from the browse reply
105 // These keep track of the different services associated with this printer.
106 // the services are ordered according to preference.
111 // these are derived from the printer matching code
113 // if driverInstalled is false, then infFileName should
114 // have an absolute path to the printers inf file. this
115 // is used to install the printer from printui.dll
117 // if driverInstalled is true, then model is the name
118 // of the driver to use in AddPrinter
120 bool driverInstalled
;
122 CString manufacturer
;
150 // these are from the resolve
152 DNSServiceRef serviceRef
;
154 unsigned short portNumber
;
161 unsigned short qtotal
;
164 // There will usually one be one of these, however
165 // this will handle printers that have multiple
166 // queues. These are ordered according to preference.
198 bool driverInstalled
;
212 while ( services
. size () > 0 )
214 Service
* service
= services
. front ();
215 services
. pop_front ();
221 Printer :: LookupService
223 const std :: string
& type
226 Services :: iterator it
;
228 for ( it
= services
. begin (); it
!= services
. end (); it
++ )
230 Service
* service
= * it
;
232 if ( strcmp ( service
-> type
. c_str (), type
. c_str ()) == 0 )
244 qtotal ( kDefaultQTotal
)
251 check ( serviceRef
== NULL
);
257 Service :: EmptyQueues ()
259 while ( queues
. size () > 0 )
261 Queue
* q
= queues
. front ();
270 priority ( kDefaultPriority
)