1 /* -*- Mode: C; tab-width: 4 -*-
3 * Copyright (c) 2002-2004 Apple Computer, Inc. All rights reserved.
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 Change History (most recent first):
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
23 Revision 1.2 2004/07/13 21:24:26 rpantos
24 Fix for <rdar://problem/3701120>.
26 Revision 1.1 2004/06/18 04:04:36 rpantos
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.
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.
35 Revision 1.1 2003/08/21 02:06:47 bradley
36 Moved DNSServiceBrowser for non-Windows CE into Windows sub-folder.
38 Revision 1.4 2003/08/12 19:56:28 cheshire
41 Revision 1.3 2003/07/02 21:20:06 cheshire
42 <rdar://problem/3313413> Update copyright notices, etc., in source code comments
44 Revision 1.2 2002/09/21 20:44:55 zarzycki
47 Revision 1.1 2002/09/20 06:12:52 bradley
48 DNSServiceBrowser for Windows
52 #if !defined(AFX_CHOOSERDIALOG_H__AC258704_B307_4901_9F98_A0AC022FD8AC__INCLUDED_)
53 #define AFX_CHOOSERDIALOG_H__AC258704_B307_4901_9F98_A0AC022FD8AC__INCLUDED_
57 #endif // _MSC_VER > 1000
66 #include "DNSServices.h"
68 //===========================================================================================================================
70 //===========================================================================================================================
72 struct ServiceInstanceInfo
83 struct ServiceTypeInfo
85 std::string serviceType
;
86 std::string description
;
87 std::string urlScheme
;
90 //===========================================================================================================================
92 //===========================================================================================================================
94 class ChooserDialog
: public CDialog
98 ChooserDialog(CWnd
* pParent
= NULL
);
99 virtual ~ChooserDialog( void );
101 //{{AFX_DATA(ChooserDialog)
102 enum { IDD
= IDD_CHOOSER_DIALOG
};
103 CListCtrl mServiceList
;
104 CListCtrl mDomainList
;
105 CListCtrl mChooserList
;
108 // ClassWizard generated virtual function overrides
109 //{{AFX_VIRTUAL(ChooserDialog)
111 virtual BOOL
PreTranslateMessage(MSG
* pMsg
);
113 virtual void DoDataExchange(CDataExchange
* pDX
); // DDX/DDV support
114 virtual void PostNcDestroy();
119 typedef std::vector
< ServiceInstanceInfo
> ServiceInstanceVector
;
120 typedef std::vector
< ServiceTypeInfo
> ServiceTypeVector
;
122 HACCEL mMenuAcceleratorTable
;
123 DNSBrowserRef mBrowser
;
124 BOOL mIsServiceBrowsing
;
125 ServiceInstanceVector mServiceInstances
;
126 ServiceTypeVector mServiceTypes
;
130 void PopulateServicesList( void );
131 void UpdateInfoDisplay( void );
133 void StartBrowsing( const char *inType
, const char *inDomain
);
134 void StopBrowsing( void );
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();
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()
162 //{{AFX_INSERT_LOCATION}}
163 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
165 #endif // !defined(AFX_CHOOSERDIALOG_H__AC258704_B307_4901_9F98_A0AC022FD8AC__INCLUDED_)