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):
25 $Log: PrinterSetupWizardSheet.h,v $
26 Revision 1.4 2004/07/13 21:24:23 rpantos
27 Fix for <rdar://problem/3701120>.
29 Revision 1.3 2004/06/28 00:51:47 shersche
30 Move call to EnumPrinters out of browse callback into standalone function
32 Revision 1.2 2004/06/24 20:12:07 shersche
34 Submitted by: herscher
36 Revision 1.1 2004/06/18 04:36:57 rpantos
45 #include "firstpage.h"
46 #include "secondpage.h"
47 #include "thirdpage.h"
48 #include "fourthpage.h"
49 #include "UtilTypes.h"
54 using namespace PrinterSetupWizard
;
56 // CPrinterSetupWizardSheet
58 class CPrinterSetupWizardSheet
: public CPropertySheet
60 DECLARE_DYNAMIC(CPrinterSetupWizardSheet
)
64 struct WizardException
72 CPrinterSetupWizardSheet(UINT nIDCaption
, CWnd
* pParentWnd
= NULL
, UINT iSelectPage
= 0);
73 virtual ~CPrinterSetupWizardSheet();
76 InstallEventHandler(EventHandler
* handler
);
79 RemoveEventHandler(EventHandler
* handler
);
82 SetSelectedPrinter(Printer
* printer
);
88 LoadPrinterDriver(const CString
& filename
);
94 // handles socket events for DNSService operations
97 OnServiceEvent(WPARAM inWParam
, LPARAM inLParam
);
100 // handles end of process event
103 OnProcessEvent(WPARAM inWParam
, LPARAM inLParam
);
106 OnCommand(WPARAM wParam
, LPARAM lParam
);
112 OnSetCursor(CWnd
* pWnd
, UINT nHitTest
, UINT message
);
115 OnContextMenu(CWnd
* pWnd
, CPoint pos
);
121 DECLARE_MESSAGE_MAP()
122 CFirstPage m_pgFirst
;
123 CSecondPage m_pgSecond
;
124 CThirdPage m_pgThird
;
125 CFourthPage m_pgFourth
;
127 static void DNSSD_API
130 DNSServiceFlags inFlags
,
131 uint32_t inInterfaceIndex
,
132 DNSServiceErrorType inErrorCode
,
135 const char * inDomain
,
138 static void DNSSD_API
141 DNSServiceFlags inFlags
,
142 uint32_t inInterfaceIndex
,
143 DNSServiceErrorType inErrorCode
,
144 const char * inFullName
,
145 const char * inHostName
,
159 StartResolve(Printer
* printer
);
162 StopResolve(Printer
* printer
);
165 LookUp(const char * inName
);
168 InstallPrinter(Printer
* printer
);
170 static unsigned WINAPI
171 InstallPrinterThread( LPVOID inParam
);
174 typedef std::list
<Printer
*> PrinterList
;
175 typedef std::list
<EventHandler
*> EventHandlerList
;
176 typedef std::list
<DNSServiceRef
> ServiceRefList
;
177 typedef std::map
<CString
,CString
> PrinterNameMap
;
179 Printer
* m_selectedPrinter
;
181 PrinterNameMap m_printerNames
;
182 PrinterList m_printerList
;
183 EventHandlerList m_eventHandlerList
;
184 ServiceRefList m_serviceRefList
;
186 bool m_processFinished
;
192 DNSServiceRef m_pdlBrowser
;
197 CPrinterSetupWizardSheet::GetSelectedPrinter()
199 return m_selectedPrinter
;
204 CPrinterSetupWizardSheet::GetCursor()