]> git.saurik.com Git - apple/mdnsresponder.git/blob - Clients/PrinterSetupWizard/SecondPage.h
mDNSResponder-214.3.tar.gz
[apple/mdnsresponder.git] / Clients / PrinterSetupWizard / SecondPage.h
1 /* -*- Mode: C; tab-width: 4 -*-
2 *
3 * Copyright (c) 1997-2004 Apple Computer, Inc. All rights reserved.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16
17 Change History (most recent first):
18
19 $Log: SecondPage.h,v $
20 Revision 1.9 2006/08/14 23:24:09 cheshire
21 Re-licensed mDNSResponder daemon source code under Apache License, Version 2.0
22
23 Revision 1.8 2005/03/20 20:08:37 shersche
24 <rdar://problem/4055670> Second screen should not select a printer by default
25
26 Revision 1.7 2005/01/31 23:54:30 shersche
27 <rdar://problem/3947508> Start browsing when printer wizard starts. Move browsing logic from CSecondPage object to CPrinterSetupWizardSheet object.
28
29 Revision 1.6 2005/01/04 21:09:14 shersche
30 Fix problems in parsing text records. Fix problems in remove event handling. Ensure that the same service can't be resolved more than once.
31
32 Revision 1.5 2004/12/31 07:25:27 shersche
33 Tidy up printer management, and fix memory leaks when hitting 'Cancel'
34
35 Revision 1.4 2004/12/30 01:02:46 shersche
36 <rdar://problem/3734478> Add Printer information box that displays description and location information when printer name is selected
37 Bug #: 3734478
38
39 Revision 1.3 2004/12/29 18:53:38 shersche
40 <rdar://problem/3725106>
41 <rdar://problem/3737413> Added support for LPR and IPP protocols as well as support for obtaining multiple text records. Reorganized and simplified codebase.
42 Bug #: 3725106, 3737413
43
44 Revision 1.2 2004/09/13 21:23:42 shersche
45 <rdar://problem/3796483> Add moreComing argument to OnAddPrinter and OnRemovePrinter callbacks
46 Bug #: 3796483
47
48 Revision 1.1 2004/06/18 04:36:57 rpantos
49 First checked in
50
51
52 */
53
54 #pragma once
55
56 #include "PrinterSetupWizardSheet.h"
57 #include "CommonServices.h"
58 #include "UtilTypes.h"
59 #include "afxcmn.h"
60 #include "dns_sd.h"
61 #include "afxwin.h"
62 #include <map>
63
64 using namespace PrinterSetupWizard;
65
66 // CSecondPage dialog
67
68 class CSecondPage : public CPropertyPage
69 {
70 DECLARE_DYNAMIC(CSecondPage)
71
72 public:
73 CSecondPage();
74 virtual ~CSecondPage();
75
76 // Dialog Data
77 enum { IDD = IDD_SECOND_PAGE };
78
79 protected:
80
81 void InitBrowseList();
82 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
83 afx_msg BOOL OnSetCursor(CWnd * pWnd, UINT nHitTest, UINT message);
84 virtual BOOL OnSetActive();
85 virtual BOOL OnKillActive();
86
87 DECLARE_MESSAGE_MAP()
88
89 public:
90
91 HTREEITEM m_emptyListItem;
92 bool m_selectOkay;
93 CTreeCtrl m_browseList;
94 bool m_initialized;
95 bool m_waiting;
96
97 afx_msg void OnTvnSelchangedBrowseList(NMHDR *pNMHDR, LRESULT *pResult);
98 afx_msg void OnNmClickBrowseList(NMHDR * pNMHDR, LRESULT * pResult);
99 afx_msg void OnTvnKeyDownBrowseList(NMHDR * pNMHDR, LRESULT * pResult );
100
101 OSStatus
102 OnAddPrinter(
103 Printer * printer,
104 bool moreComing);
105
106 OSStatus
107 OnRemovePrinter(
108 Printer * printer,
109 bool moreComing);
110
111 void
112 OnResolveService( Service * service );
113
114 private:
115
116 void
117 LoadTextAndDisableWindow( CString & text );
118
119 void
120 SetPrinterInformationState( BOOL state );
121
122 std::string m_selectedName;
123
124
125 private:
126
127
128
129 CStatic m_printerInformation;
130
131 CStatic m_descriptionLabel;
132
133 CStatic m_descriptionField;
134
135 CStatic m_locationLabel;
136
137 CStatic m_locationField;
138
139
140 bool m_gotChoice;
141 };