]> git.saurik.com Git - apple/mdnsresponder.git/blob - mDNSWindows/DNSServiceBrowser/Windows/Sources/ChooserDialog.h
mDNSResponder-212.1.tar.gz
[apple/mdnsresponder.git] / mDNSWindows / DNSServiceBrowser / Windows / Sources / ChooserDialog.h
1 /* -*- Mode: C; tab-width: 4 -*-
2 *
3 * Copyright (c) 2002-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: ChooserDialog.h,v $
20 Revision 1.3 2006/08/14 23:25:49 cheshire
21 Re-licensed mDNSResponder daemon source code under Apache License, Version 2.0
22
23 Revision 1.2 2004/07/13 21:24:26 rpantos
24 Fix for <rdar://problem/3701120>.
25
26 Revision 1.1 2004/06/18 04:04:36 rpantos
27 Move up one level
28
29 Revision 1.3 2004/01/30 02:56:32 bradley
30 Updated to support full Unicode display. Added support for all services on www.dns-sd.org.
31
32 Revision 1.2 2003/10/31 12:18:30 bradley
33 Added display of the resolved host name. Show separate TXT record entries on separate lines.
34
35 Revision 1.1 2003/08/21 02:06:47 bradley
36 Moved DNSServiceBrowser for non-Windows CE into Windows sub-folder.
37
38 Revision 1.4 2003/08/12 19:56:28 cheshire
39 Update to APSL 2.0
40
41 Revision 1.3 2003/07/02 21:20:06 cheshire
42 <rdar://problem/3313413> Update copyright notices, etc., in source code comments
43
44 Revision 1.2 2002/09/21 20:44:55 zarzycki
45 Added APSL info
46
47 Revision 1.1 2002/09/20 06:12:52 bradley
48 DNSServiceBrowser for Windows
49
50 */
51
52 #if !defined(AFX_CHOOSERDIALOG_H__AC258704_B307_4901_9F98_A0AC022FD8AC__INCLUDED_)
53 #define AFX_CHOOSERDIALOG_H__AC258704_B307_4901_9F98_A0AC022FD8AC__INCLUDED_
54
55 #if _MSC_VER > 1000
56 #pragma once
57 #endif // _MSC_VER > 1000
58
59 #include <string>
60 #include <vector>
61
62 #include "afxcmn.h"
63
64 #include "Resource.h"
65
66 #include "DNSServices.h"
67
68 //===========================================================================================================================
69 // Structures
70 //===========================================================================================================================
71
72 struct ServiceInstanceInfo
73 {
74 std::string name;
75 std::string type;
76 std::string domain;
77 std::string ip;
78 std::string text;
79 std::string ifIP;
80 std::string hostName;
81 };
82
83 struct ServiceTypeInfo
84 {
85 std::string serviceType;
86 std::string description;
87 std::string urlScheme;
88 };
89
90 //===========================================================================================================================
91 // ChooserDialog
92 //===========================================================================================================================
93
94 class ChooserDialog : public CDialog
95 {
96 public:
97
98 ChooserDialog(CWnd* pParent = NULL);
99 virtual ~ChooserDialog( void );
100
101 //{{AFX_DATA(ChooserDialog)
102 enum { IDD = IDD_CHOOSER_DIALOG };
103 CListCtrl mServiceList;
104 CListCtrl mDomainList;
105 CListCtrl mChooserList;
106 //}}AFX_DATA
107
108 // ClassWizard generated virtual function overrides
109 //{{AFX_VIRTUAL(ChooserDialog)
110 public:
111 virtual BOOL PreTranslateMessage(MSG* pMsg);
112 protected:
113 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
114 virtual void PostNcDestroy();
115 //}}AFX_VIRTUAL
116
117 protected:
118
119 typedef std::vector < ServiceInstanceInfo > ServiceInstanceVector;
120 typedef std::vector < ServiceTypeInfo > ServiceTypeVector;
121
122 HACCEL mMenuAcceleratorTable;
123 DNSBrowserRef mBrowser;
124 BOOL mIsServiceBrowsing;
125 ServiceInstanceVector mServiceInstances;
126 ServiceTypeVector mServiceTypes;
127
128 public:
129
130 void PopulateServicesList( void );
131 void UpdateInfoDisplay( void );
132
133 void StartBrowsing( const char *inType, const char *inDomain );
134 void StopBrowsing( void );
135
136 protected:
137
138 //{{AFX_MSG(ChooserDialog)
139 virtual BOOL OnInitDialog();
140 afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
141 afx_msg void OnDomainListChanged(NMHDR* pNMHDR, LRESULT* pResult);
142 afx_msg void OnServiceListChanged(NMHDR* pNMHDR, LRESULT* pResult);
143 afx_msg void OnChooserListChanged(NMHDR* pNMHDR, LRESULT* pResult);
144 afx_msg void OnChooserListDoubleClick(NMHDR* pNMHDR, LRESULT* pResult);
145 afx_msg void OnAbout();
146 afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
147 afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized);
148 afx_msg void OnFileClose();
149 virtual void OnCancel();
150 afx_msg void OnExit();
151 afx_msg void OnClose();
152 afx_msg void OnNcDestroy();
153 //}}AFX_MSG
154 afx_msg LONG OnDomainAdd( WPARAM inWParam, LPARAM inLParam );
155 afx_msg LONG OnDomainRemove( WPARAM inWParam, LPARAM inLParam );
156 afx_msg LONG OnServiceAdd( WPARAM inWParam, LPARAM inLParam );
157 afx_msg LONG OnServiceRemove( WPARAM inWParam, LPARAM inLParam );
158 afx_msg LONG OnResolve( WPARAM inWParam, LPARAM inLParam );
159 DECLARE_MESSAGE_MAP()
160 };
161
162 //{{AFX_INSERT_LOCATION}}
163 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
164
165 #endif // !defined(AFX_CHOOSERDIALOG_H__AC258704_B307_4901_9F98_A0AC022FD8AC__INCLUDED_)