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.1 2004/06/18 04:36:58 rpantos
34 #include "UtilTypes.h"
35 #include <CommonServices.h>
36 #include <DebugServices.h>
44 class CThirdPage
: public CPropertyPage
46 DECLARE_DYNAMIC(CThirdPage
)
50 virtual ~CThirdPage();
53 enum { IDD
= IDD_THIRD_PAGE
};
56 virtual void DoDataExchange(CDataExchange
* pDX
); // DDX/DDV support
57 virtual BOOL
OnSetActive();
63 typedef std::map
<CString
, Manufacturer
*> Manufacturers
;
66 // LoadPrintDriverDefsFromFile
68 // Parses INF file and populates manufacturers
70 OSStatus
LoadPrintDriverDefsFromFile(Manufacturers
& manufacturers
, const CString
& filename
, bool checkForDuplicateModels
);
73 // LoadPrintDriverDefs
75 // Loads extant print driver definitions
77 OSStatus
LoadPrintDriverDefs(Manufacturers
& manufacturers
);
82 // Load print driver defs into UI for browsing/selection
84 OSStatus
PopulateUI(Manufacturers
& manufacturers
);
89 // Tries to match printer based on manufacturer and model
91 OSStatus
MatchPrinter(Manufacturers
& manufacturers
, Printer
* printer
);
96 // Called first time page is activated.
97 OSStatus
OnInitPage();
100 // these functions will tweak the names so that everything is
103 CString
ConvertToManufacturerName( const CString
& name
);
104 CString
ConvertToModelName( const CString
& name
);
105 CString
NormalizeManufacturerName( const CString
& name
);
107 Manufacturer
* MatchManufacturer( Manufacturers
& manufacturer
, const CString
& name
);
108 Model
* MatchModel( Manufacturer
* manufacturer
, const CString
& name
);
109 void SelectMatch(Printer
* printer
, Manufacturer
* manufacturer
, Model
* model
);
110 void CopyPrinterSettings(Printer
* printer
, Manufacturer
* manufacturer
, Model
* model
);
112 Manufacturers m_manufacturers
;
114 CListCtrl m_manufacturerListCtrl
;
115 Manufacturer
* m_manufacturerSelected
;
117 CListCtrl m_modelListCtrl
;
118 Model
* m_modelSelected
;
124 afx_msg
void OnLvnItemchangedManufacturer(NMHDR
*pNMHDR
, LRESULT
*pResult
);
125 CStatic m_printerName
;
126 afx_msg
void OnLvnItemchangedPrinterModel(NMHDR
*pNMHDR
, LRESULT
*pResult
);
127 afx_msg
void OnBnClickedDefaultPrinter();
129 CButton m_defaultPrinterCtrl
;
131 CStatic m_printerSelectionText
;
132 afx_msg
void OnBnClickedHaveDisk();