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