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