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.4 2005/02/08 21:45:06 shersche
27 <rdar://problem/3947490> Default to Generic PostScript or PCL if unable to match driver
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
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
38 Revision 1.1 2004/06/18 04:36:58 rpantos
46 #include "UtilTypes.h"
47 #include <CommonServices.h>
48 #include <DebugServices.h>
56 class CThirdPage
: public CPropertyPage
58 DECLARE_DYNAMIC(CThirdPage
)
62 virtual ~CThirdPage();
65 enum { IDD
= IDD_THIRD_PAGE
};
68 virtual void DoDataExchange(CDataExchange
* pDX
); // DDX/DDV support
69 virtual BOOL
OnSetActive();
75 typedef std::map
<CString
, Manufacturer
*> Manufacturers
;
78 // LoadPrintDriverDefsFromFile
80 // Parses INF file and populates manufacturers
82 OSStatus
LoadPrintDriverDefsFromFile(Manufacturers
& manufacturers
, const CString
& filename
, bool checkForDuplicateModels
);
85 // LoadPrintDriverDefs
87 // Loads extant print driver definitions
89 OSStatus
LoadPrintDriverDefs(Manufacturers
& manufacturers
);
92 // LoadGenericPrintDriversDefs
94 // Loads generic postscript and pcl print driver defs
96 OSStatus
LoadGenericPrintDriverDefs( Manufacturers
& manufacturers
);
101 // Load print driver defs into UI for browsing/selection
103 OSStatus
PopulateUI(Manufacturers
& manufacturers
);
108 // Tries to match printer based on manufacturer and model
110 OSStatus
MatchPrinter(Manufacturers
& manufacturers
, Printer
* printer
, Service
* service
);
115 // Called first time page is activated.
116 OSStatus
OnInitPage();
119 // these functions will tweak the names so that everything is
122 CString
ConvertToManufacturerName( const CString
& name
);
123 CString
ConvertToModelName( const CString
& name
);
124 CString
NormalizeManufacturerName( const CString
& name
);
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
);
132 Manufacturers m_manufacturers
;
134 CListCtrl m_manufacturerListCtrl
;
135 Manufacturer
* m_manufacturerSelected
;
137 CListCtrl m_modelListCtrl
;
138 Model
* m_modelSelected
;
140 Model
* m_genericPostscript
;
141 Model
* m_genericPCL
;
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();
152 CButton m_defaultPrinterCtrl
;
154 CStatic m_printerSelectionText
;
155 CStatic
* m_printerImage
;
156 afx_msg
void OnBnClickedHaveDisk();