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 18 #pragma once 19 20 #include "PrinterSetupWizardSheet.h" 21 #include "CommonServices.h" 22 #include "UtilTypes.h" 23 #include "afxcmn.h" 24 #include "dns_sd.h" 25 #include "afxwin.h" 26 #include <map> 27 28 using namespace PrinterSetupWizard; 29 30 // CSecondPage dialog 31 32 class CSecondPage : public CPropertyPage 33 { 34 DECLARE_DYNAMIC(CSecondPage) 35 36 public: 37 CSecondPage(); 38 virtual ~CSecondPage(); 39 40 // Dialog Data 41 enum { IDD = IDD_SECOND_PAGE }; 42 43 protected: 44 45 void InitBrowseList(); 46 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 47 afx_msg BOOL OnSetCursor(CWnd * pWnd, UINT nHitTest, UINT message); 48 virtual BOOL OnSetActive(); 49 virtual BOOL OnKillActive(); 50 51 DECLARE_MESSAGE_MAP() 52 53 public: 54 55 HTREEITEM m_emptyListItem; 56 bool m_selectOkay; 57 CTreeCtrl m_browseList; 58 bool m_initialized; 59 bool m_waiting; 60 61 afx_msg void OnTvnSelchangedBrowseList(NMHDR *pNMHDR, LRESULT *pResult); 62 afx_msg void OnNmClickBrowseList(NMHDR * pNMHDR, LRESULT * pResult); 63 afx_msg void OnTvnKeyDownBrowseList(NMHDR * pNMHDR, LRESULT * pResult ); 64 65 OSStatus 66 OnAddPrinter( 67 Printer * printer, 68 bool moreComing); 69 70 OSStatus 71 OnRemovePrinter( 72 Printer * printer, 73 bool moreComing); 74 75 void 76 OnResolveService( Service * service ); 77 78 private: 79 80 void 81 LoadTextAndDisableWindow( CString & text ); 82 83 void 84 SetPrinterInformationState( BOOL state ); 85 86 std::string m_selectedName; 87 88 89 private: 90 91 92 93 CStatic m_printerInformation; 94 95 CStatic m_descriptionLabel; 96 97 CStatic m_descriptionField; 98 99 CStatic m_locationLabel; 100 101 CStatic m_locationField; 102 103 104 bool m_gotChoice; 105 }; 106