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