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.3 2005/01/25 08:57:28 shersche
27 <rdar://problem/3911084> Add m_printerControl member for dynamic loading of icons from resource DLLs
30 Revision 1.2 2004/12/29 18:53:38 shersche
31 <rdar://problem/3725106>
32 <rdar://problem/3737413> Added support for LPR and IPP protocols as well as support for obtaining multiple text records. Reorganized and simplified codebase.
33 Bug #: 3725106, 3737413
35 Revision 1.1 2004/06/18 04:36:58 rpantos
43 #include "UtilTypes.h"
44 #include <CommonServices.h>
45 #include <DebugServices.h>
53 class CThirdPage
: public CPropertyPage
55 DECLARE_DYNAMIC(CThirdPage
)
59 virtual ~CThirdPage();
62 enum { IDD
= IDD_THIRD_PAGE
};
65 virtual void DoDataExchange(CDataExchange
* pDX
); // DDX/DDV support
66 virtual BOOL
OnSetActive();
72 typedef std::map
<CString
, Manufacturer
*> Manufacturers
;
75 // LoadPrintDriverDefsFromFile
77 // Parses INF file and populates manufacturers
79 OSStatus
LoadPrintDriverDefsFromFile(Manufacturers
& manufacturers
, const CString
& filename
, bool checkForDuplicateModels
);
82 // LoadPrintDriverDefs
84 // Loads extant print driver definitions
86 OSStatus
LoadPrintDriverDefs(Manufacturers
& manufacturers
);
91 // Load print driver defs into UI for browsing/selection
93 OSStatus
PopulateUI(Manufacturers
& manufacturers
);
98 // Tries to match printer based on manufacturer and model
100 OSStatus
MatchPrinter(Manufacturers
& manufacturers
, Printer
* printer
, Service
* service
);
105 // Called first time page is activated.
106 OSStatus
OnInitPage();
109 // these functions will tweak the names so that everything is
112 CString
ConvertToManufacturerName( const CString
& name
);
113 CString
ConvertToModelName( const CString
& name
);
114 CString
NormalizeManufacturerName( const CString
& name
);
116 Manufacturer
* MatchManufacturer( Manufacturers
& manufacturer
, const CString
& name
);
117 Model
* MatchModel( Manufacturer
* manufacturer
, const CString
& name
);
118 void SelectMatch(Printer
* printer
, Service
* service
, Manufacturer
* manufacturer
, Model
* model
);
119 void CopyPrinterSettings(Printer
* printer
, Service
* service
, Manufacturer
* manufacturer
, Model
* model
);
121 Manufacturers m_manufacturers
;
123 CListCtrl m_manufacturerListCtrl
;
124 Manufacturer
* m_manufacturerSelected
;
126 CListCtrl m_modelListCtrl
;
127 Model
* m_modelSelected
;
133 afx_msg
void OnLvnItemchangedManufacturer(NMHDR
*pNMHDR
, LRESULT
*pResult
);
134 CStatic m_printerName
;
135 afx_msg
void OnLvnItemchangedPrinterModel(NMHDR
*pNMHDR
, LRESULT
*pResult
);
136 afx_msg
void OnBnClickedDefaultPrinter();
138 CButton m_defaultPrinterCtrl
;
140 CStatic m_printerSelectionText
;
141 CStatic
* m_printerImage
;
142 afx_msg
void OnBnClickedHaveDisk();