2 * Copyright (c) 2002-2004 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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
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.
21 * @APPLE_LICENSE_HEADER_END@
23 Change History (most recent first):
25 $Log: ChooserDialog.h,v $
26 Revision 1.2 2004/07/13 21:24:26 rpantos
27 Fix for <rdar://problem/3701120>.
29 Revision 1.1 2004/06/18 04:04:36 rpantos
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.
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.
38 Revision 1.1 2003/08/21 02:06:47 bradley
39 Moved DNSServiceBrowser for non-Windows CE into Windows sub-folder.
41 Revision 1.4 2003/08/12 19:56:28 cheshire
44 Revision 1.3 2003/07/02 21:20:06 cheshire
45 <rdar://problem/3313413> Update copyright notices, etc., in source code comments
47 Revision 1.2 2002/09/21 20:44:55 zarzycki
50 Revision 1.1 2002/09/20 06:12:52 bradley
51 DNSServiceBrowser for Windows
55 #if !defined(AFX_CHOOSERDIALOG_H__AC258704_B307_4901_9F98_A0AC022FD8AC__INCLUDED_)
56 #define AFX_CHOOSERDIALOG_H__AC258704_B307_4901_9F98_A0AC022FD8AC__INCLUDED_
60 #endif // _MSC_VER > 1000
69 #include "DNSServices.h"
71 //===========================================================================================================================
73 //===========================================================================================================================
75 struct ServiceInstanceInfo
86 struct ServiceTypeInfo
88 std::string serviceType
;
89 std::string description
;
90 std::string urlScheme
;
93 //===========================================================================================================================
95 //===========================================================================================================================
97 class ChooserDialog
: public CDialog
101 ChooserDialog(CWnd
* pParent
= NULL
);
102 virtual ~ChooserDialog( void );
104 //{{AFX_DATA(ChooserDialog)
105 enum { IDD
= IDD_CHOOSER_DIALOG
};
106 CListCtrl mServiceList
;
107 CListCtrl mDomainList
;
108 CListCtrl mChooserList
;
111 // ClassWizard generated virtual function overrides
112 //{{AFX_VIRTUAL(ChooserDialog)
114 virtual BOOL
PreTranslateMessage(MSG
* pMsg
);
116 virtual void DoDataExchange(CDataExchange
* pDX
); // DDX/DDV support
117 virtual void PostNcDestroy();
122 typedef std::vector
< ServiceInstanceInfo
> ServiceInstanceVector
;
123 typedef std::vector
< ServiceTypeInfo
> ServiceTypeVector
;
125 HACCEL mMenuAcceleratorTable
;
126 DNSBrowserRef mBrowser
;
127 BOOL mIsServiceBrowsing
;
128 ServiceInstanceVector mServiceInstances
;
129 ServiceTypeVector mServiceTypes
;
133 void PopulateServicesList( void );
134 void UpdateInfoDisplay( void );
136 void StartBrowsing( const char *inType
, const char *inDomain
);
137 void StopBrowsing( void );
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();
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()
165 //{{AFX_INSERT_LOCATION}}
166 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
168 #endif // !defined(AFX_CHOOSERDIALOG_H__AC258704_B307_4901_9F98_A0AC022FD8AC__INCLUDED_)