]> git.saurik.com Git - apple/mdnsresponder.git/blob - Clients/PrinterSetupWizard/ThirdPage.h
mDNSResponder-107.3.tar.gz
[apple/mdnsresponder.git] / Clients / PrinterSetupWizard / ThirdPage.h
1 /*
2 * Copyright (c) 1997-2004 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
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
11 * file.
12 *
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.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22
23 Change History (most recent first):
24
25 $Log: ThirdPage.h,v $
26 Revision 1.4 2005/02/08 21:45:06 shersche
27 <rdar://problem/3947490> Default to Generic PostScript or PCL if unable to match driver
28
29 Revision 1.3 2005/01/25 08:57:28 shersche
30 <rdar://problem/3911084> Add m_printerControl member for dynamic loading of icons from resource DLLs
31 Bug #: 3911084
32
33 Revision 1.2 2004/12/29 18:53:38 shersche
34 <rdar://problem/3725106>
35 <rdar://problem/3737413> Added support for LPR and IPP protocols as well as support for obtaining multiple text records. Reorganized and simplified codebase.
36 Bug #: 3725106, 3737413
37
38 Revision 1.1 2004/06/18 04:36:58 rpantos
39 First checked in
40
41
42 */
43
44 #pragma once
45 #include "afxcmn.h"
46 #include "UtilTypes.h"
47 #include <CommonServices.h>
48 #include <DebugServices.h>
49 #include <dns_sd.h>
50 #include <map>
51 #include "afxwin.h"
52
53
54 // CThirdPage dialog
55
56 class CThirdPage : public CPropertyPage
57 {
58 DECLARE_DYNAMIC(CThirdPage)
59
60 public:
61 CThirdPage();
62 virtual ~CThirdPage();
63
64 // Dialog Data
65 enum { IDD = IDD_THIRD_PAGE };
66
67 protected:
68 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
69 virtual BOOL OnSetActive();
70
71 DECLARE_MESSAGE_MAP()
72
73 private:
74
75 typedef std::map<CString, Manufacturer*> Manufacturers;
76
77 //
78 // LoadPrintDriverDefsFromFile
79 //
80 // Parses INF file and populates manufacturers
81 //
82 OSStatus LoadPrintDriverDefsFromFile(Manufacturers & manufacturers, const CString & filename, bool checkForDuplicateModels );
83
84 //
85 // LoadPrintDriverDefs
86 //
87 // Loads extant print driver definitions
88 //
89 OSStatus LoadPrintDriverDefs(Manufacturers & manufacturers);
90
91 //
92 // LoadGenericPrintDriversDefs
93 //
94 // Loads generic postscript and pcl print driver defs
95 //
96 OSStatus LoadGenericPrintDriverDefs( Manufacturers & manufacturers );
97
98 //
99 // PopulateUI
100 //
101 // Load print driver defs into UI for browsing/selection
102 //
103 OSStatus PopulateUI(Manufacturers & manufacturers);
104
105 //
106 // MatchPrinter
107 //
108 // Tries to match printer based on manufacturer and model
109 //
110 OSStatus MatchPrinter(Manufacturers & manufacturers, Printer * printer, Service * service);
111
112 //
113 // OnInitPage
114 //
115 // Called first time page is activated.
116 OSStatus OnInitPage();
117
118 //
119 // these functions will tweak the names so that everything is
120 // consistent
121 //
122 CString ConvertToManufacturerName( const CString & name );
123 CString ConvertToModelName( const CString & name );
124 CString NormalizeManufacturerName( const CString & name );
125
126 Manufacturer * MatchManufacturer( Manufacturers & manufacturer, const CString & name );
127 Model * MatchModel( Manufacturer * manufacturer, const CString & name );
128 BOOL MatchGeneric( Printer * printer, Service * service, Manufacturer ** manufacturer, Model ** model );
129 void SelectMatch(Printer * printer, Service * service, Manufacturers & manufacturers, Manufacturer * manufacturer, Model * model);
130 void CopyPrinterSettings(Printer * printer, Service * service, Manufacturer * manufacturer, Model * model);
131
132 Manufacturers m_manufacturers;
133
134 CListCtrl m_manufacturerListCtrl;
135 Manufacturer * m_manufacturerSelected;
136
137 CListCtrl m_modelListCtrl;
138 Model * m_modelSelected;
139
140 Model * m_genericPostscript;
141 Model * m_genericPCL;
142
143 bool m_initialized;
144
145 public:
146
147 afx_msg void OnLvnItemchangedManufacturer(NMHDR *pNMHDR, LRESULT *pResult);
148 CStatic m_printerName;
149 afx_msg void OnLvnItemchangedPrinterModel(NMHDR *pNMHDR, LRESULT *pResult);
150 afx_msg void OnBnClickedDefaultPrinter();
151 private:
152 CButton m_defaultPrinterCtrl;
153 public:
154 CStatic m_printerSelectionText;
155 CStatic * m_printerImage;
156 afx_msg void OnBnClickedHaveDisk();
157 };