]> git.saurik.com Git - apple/mdnsresponder.git/blob - mDNSWindows/Applications/DNSServiceBrowser/Windows/Sources/ChooserDialog.h
mDNSResponder-66.3.tar.gz
[apple/mdnsresponder.git] / mDNSWindows / Applications / DNSServiceBrowser / Windows / Sources / ChooserDialog.h
1 /*
2 * Copyright (c) 2002-2004 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * file.
14 *
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24
25 Change History (most recent first):
26
27 $Log: ChooserDialog.h,v $
28 Revision 1.3 2004/01/30 02:56:32 bradley
29 Updated to support full Unicode display. Added support for all services on www.dns-sd.org.
30
31 Revision 1.2 2003/10/31 12:18:30 bradley
32 Added display of the resolved host name. Show separate TXT record entries on separate lines.
33
34 Revision 1.1 2003/08/21 02:06:47 bradley
35 Moved Rendezvous Browser for non-Windows CE into Windows sub-folder.
36
37 Revision 1.4 2003/08/12 19:56:28 cheshire
38 Update to APSL 2.0
39
40 Revision 1.3 2003/07/02 21:20:06 cheshire
41 <rdar://problem/3313413> Update copyright notices, etc., in source code comments
42
43 Revision 1.2 2002/09/21 20:44:55 zarzycki
44 Added APSL info
45
46 Revision 1.1 2002/09/20 06:12:52 bradley
47 Rendezvous Browser for Windows
48
49 */
50
51 #if !defined(AFX_CHOOSERDIALOG_H__AC258704_B307_4901_9F98_A0AC022FD8AC__INCLUDED_)
52 #define AFX_CHOOSERDIALOG_H__AC258704_B307_4901_9F98_A0AC022FD8AC__INCLUDED_
53
54 #if _MSC_VER > 1000
55 #pragma once
56 #endif // _MSC_VER > 1000
57
58 #include <string>
59 #include <vector>
60
61 #include "afxcmn.h"
62
63 #include "Resource.h"
64
65 #include "DNSServices.h"
66
67 //===========================================================================================================================
68 // Structures
69 //===========================================================================================================================
70
71 struct ServiceInstanceInfo
72 {
73 std::string name;
74 std::string type;
75 std::string domain;
76 std::string ip;
77 std::string text;
78 std::string ifIP;
79 std::string hostName;
80 };
81
82 struct ServiceTypeInfo
83 {
84 std::string serviceType;
85 std::string description;
86 std::string urlScheme;
87 };
88
89 //===========================================================================================================================
90 // ChooserDialog
91 //===========================================================================================================================
92
93 class ChooserDialog : public CDialog
94 {
95 public:
96
97 ChooserDialog(CWnd* pParent = NULL);
98 virtual ~ChooserDialog( void );
99
100 //{{AFX_DATA(ChooserDialog)
101 enum { IDD = IDD_CHOOSER_DIALOG };
102 CListCtrl mServiceList;
103 CListCtrl mDomainList;
104 CListCtrl mChooserList;
105 //}}AFX_DATA
106
107 // ClassWizard generated virtual function overrides
108 //{{AFX_VIRTUAL(ChooserDialog)
109 public:
110 virtual BOOL PreTranslateMessage(MSG* pMsg);
111 protected:
112 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
113 virtual void PostNcDestroy();
114 //}}AFX_VIRTUAL
115
116 protected:
117
118 typedef std::vector < ServiceInstanceInfo > ServiceInstanceVector;
119 typedef std::vector < ServiceTypeInfo > ServiceTypeVector;
120
121 HACCEL mMenuAcceleratorTable;
122 DNSBrowserRef mBrowser;
123 BOOL mIsServiceBrowsing;
124 ServiceInstanceVector mServiceInstances;
125 ServiceTypeVector mServiceTypes;
126
127 public:
128
129 void PopulateServicesList( void );
130 void UpdateInfoDisplay( void );
131
132 void StartBrowsing( const char *inType, const char *inDomain );
133 void StopBrowsing( void );
134
135 protected:
136
137 //{{AFX_MSG(ChooserDialog)
138 virtual BOOL OnInitDialog();
139 afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
140 afx_msg void OnDomainListChanged(NMHDR* pNMHDR, LRESULT* pResult);
141 afx_msg void OnServiceListChanged(NMHDR* pNMHDR, LRESULT* pResult);
142 afx_msg void OnChooserListChanged(NMHDR* pNMHDR, LRESULT* pResult);
143 afx_msg void OnChooserListDoubleClick(NMHDR* pNMHDR, LRESULT* pResult);
144 afx_msg void OnAbout();
145 afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
146 afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized);
147 afx_msg void OnFileClose();
148 virtual void OnCancel();
149 afx_msg void OnExit();
150 afx_msg void OnClose();
151 afx_msg void OnNcDestroy();
152 //}}AFX_MSG
153 afx_msg LONG OnDomainAdd( WPARAM inWParam, LPARAM inLParam );
154 afx_msg LONG OnDomainRemove( WPARAM inWParam, LPARAM inLParam );
155 afx_msg LONG OnServiceAdd( WPARAM inWParam, LPARAM inLParam );
156 afx_msg LONG OnServiceRemove( WPARAM inWParam, LPARAM inLParam );
157 afx_msg LONG OnResolve( WPARAM inWParam, LPARAM inLParam );
158 DECLARE_MESSAGE_MAP()
159 };
160
161 //{{AFX_INSERT_LOCATION}}
162 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
163
164 #endif // !defined(AFX_CHOOSERDIALOG_H__AC258704_B307_4901_9F98_A0AC022FD8AC__INCLUDED_)