]> git.saurik.com Git - apple/mdnsresponder.git/blob - Clients/PrinterSetupWizard/ThirdPage.h
mDNSResponder-87.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.1 2004/06/18 04:36:58 rpantos
27 First checked in
28
29
30 */
31
32 #pragma once
33 #include "afxcmn.h"
34 #include "UtilTypes.h"
35 #include <CommonServices.h>
36 #include <DebugServices.h>
37 #include <dns_sd.h>
38 #include <map>
39 #include "afxwin.h"
40
41
42 // CThirdPage dialog
43
44 class CThirdPage : public CPropertyPage
45 {
46 DECLARE_DYNAMIC(CThirdPage)
47
48 public:
49 CThirdPage();
50 virtual ~CThirdPage();
51
52 // Dialog Data
53 enum { IDD = IDD_THIRD_PAGE };
54
55 protected:
56 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
57 virtual BOOL OnSetActive();
58
59 DECLARE_MESSAGE_MAP()
60
61 private:
62
63 typedef std::map<CString, Manufacturer*> Manufacturers;
64
65 //
66 // LoadPrintDriverDefsFromFile
67 //
68 // Parses INF file and populates manufacturers
69 //
70 OSStatus LoadPrintDriverDefsFromFile(Manufacturers & manufacturers, const CString & filename, bool checkForDuplicateModels );
71
72 //
73 // LoadPrintDriverDefs
74 //
75 // Loads extant print driver definitions
76 //
77 OSStatus LoadPrintDriverDefs(Manufacturers & manufacturers);
78
79 //
80 // PopulateUI
81 //
82 // Load print driver defs into UI for browsing/selection
83 //
84 OSStatus PopulateUI(Manufacturers & manufacturers);
85
86 //
87 // MatchPrinter
88 //
89 // Tries to match printer based on manufacturer and model
90 //
91 OSStatus MatchPrinter(Manufacturers & manufacturers, Printer * printer);
92
93 //
94 // OnInitPage
95 //
96 // Called first time page is activated.
97 OSStatus OnInitPage();
98
99 //
100 // these functions will tweak the names so that everything is
101 // consistent
102 //
103 CString ConvertToManufacturerName( const CString & name );
104 CString ConvertToModelName( const CString & name );
105 CString NormalizeManufacturerName( const CString & name );
106
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);
111
112 Manufacturers m_manufacturers;
113
114 CListCtrl m_manufacturerListCtrl;
115 Manufacturer * m_manufacturerSelected;
116
117 CListCtrl m_modelListCtrl;
118 Model * m_modelSelected;
119
120 bool m_initialized;
121
122 public:
123
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();
128 private:
129 CButton m_defaultPrinterCtrl;
130 public:
131 CStatic m_printerSelectionText;
132 afx_msg void OnBnClickedHaveDisk();
133 };