]>
git.saurik.com Git - apple/mdnsresponder.git/blob - Clients/PrinterSetupWizard/UtilTypes.h
1 /* -*- Mode: C; tab-width: 4 -*-
3 * Copyright (c) 1997-2004 Apple Computer, Inc. All rights reserved.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
23 #include <DebugServices.h>
25 class CPrinterSetupWizardSheet
;
27 #define kDefaultPriority 50
28 #define kDefaultQTotal 1
30 namespace PrinterSetupWizard
38 typedef std::list
<Queue
*> Queues
;
39 typedef std::list
<Printer
*> Printers
;
40 typedef std::list
<Service
*> Services
;
41 typedef std::list
<Model
*> Models
;
52 const std::string
& type
55 CPrinterSetupWizardSheet
* window
;
59 // These are from the browse reply
66 // These keep track of the different services associated with this printer.
67 // the services are ordered according to preference.
72 // these are derived from the printer matching code
74 // if driverInstalled is false, then infFileName should
75 // have an absolute path to the printers inf file. this
76 // is used to install the printer from printui.dll
78 // if driverInstalled is true, then model is the name
79 // of the driver to use in AddPrinter
84 CString displayModelName
;
89 // This let's us know that this printer was discovered via OSX Printer Sharing.
90 // We use this knowledge to workaround a problem with OS X Printer sharing.
120 // these are from the resolve
122 DNSServiceRef serviceRef
;
124 unsigned short portNumber
;
126 unsigned short qtotal
;
129 // There will usually one be one of these, however
130 // this will handle printers that have multiple
131 // queues. These are ordered according to preference.
165 find( const CString
& name
);
171 bool driverInstalled
;
181 isCUPSPrinter( false )
188 while ( services
.size() > 0 )
190 Service
* service
= services
.front();
191 services
.pop_front();
197 Printer::LookupService
199 const std::string
& type
202 Services::iterator it
;
204 for ( it
= services
.begin(); it
!= services
.end(); it
++ )
206 Service
* service
= *it
;
208 if ( strcmp(service
->type
.c_str(), type
.c_str()) == 0 )
220 qtotal(kDefaultQTotal
)
227 check( serviceRef
== NULL
);
233 Service::SelectedQueue()
235 return queues
.front();
239 Service::EmptyQueues()
241 while ( queues
.size() > 0 )
243 Queue
* q
= queues
.front();
252 priority(kDefaultPriority
)
262 Manufacturer::find( const CString
& name
)
266 for ( it
= models
.begin(); it
!= models
.end(); it
++ )
270 if ( model
->name
== name
)