xref: /aosp_15_r20/external/mdnsresponder/mDNSWindows/DNSServiceBrowser/Windows/Sources/ChooserDialog.h (revision 48a54d368dc4fa860885eef7b70b6c53499e7c25)
1*48a54d36SAndroid Build Coastguard Worker /* -*- Mode: C; tab-width: 4 -*-
2*48a54d36SAndroid Build Coastguard Worker  *
3*48a54d36SAndroid Build Coastguard Worker  * Copyright (c) 2002-2004 Apple Computer, Inc. All rights reserved.
4*48a54d36SAndroid Build Coastguard Worker  *
5*48a54d36SAndroid Build Coastguard Worker  * Licensed under the Apache License, Version 2.0 (the "License");
6*48a54d36SAndroid Build Coastguard Worker  * you may not use this file except in compliance with the License.
7*48a54d36SAndroid Build Coastguard Worker  * You may obtain a copy of the License at
8*48a54d36SAndroid Build Coastguard Worker  *
9*48a54d36SAndroid Build Coastguard Worker  *     http://www.apache.org/licenses/LICENSE-2.0
10*48a54d36SAndroid Build Coastguard Worker  *
11*48a54d36SAndroid Build Coastguard Worker  * Unless required by applicable law or agreed to in writing, software
12*48a54d36SAndroid Build Coastguard Worker  * distributed under the License is distributed on an "AS IS" BASIS,
13*48a54d36SAndroid Build Coastguard Worker  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14*48a54d36SAndroid Build Coastguard Worker  * See the License for the specific language governing permissions and
15*48a54d36SAndroid Build Coastguard Worker  * limitations under the License.
16*48a54d36SAndroid Build Coastguard Worker  */
17*48a54d36SAndroid Build Coastguard Worker 
18*48a54d36SAndroid Build Coastguard Worker #if !defined(AFX_CHOOSERDIALOG_H__AC258704_B307_4901_9F98_A0AC022FD8AC__INCLUDED_)
19*48a54d36SAndroid Build Coastguard Worker #define AFX_CHOOSERDIALOG_H__AC258704_B307_4901_9F98_A0AC022FD8AC__INCLUDED_
20*48a54d36SAndroid Build Coastguard Worker 
21*48a54d36SAndroid Build Coastguard Worker #if _MSC_VER > 1000
22*48a54d36SAndroid Build Coastguard Worker #pragma once
23*48a54d36SAndroid Build Coastguard Worker #endif // _MSC_VER > 1000
24*48a54d36SAndroid Build Coastguard Worker 
25*48a54d36SAndroid Build Coastguard Worker #include	<string>
26*48a54d36SAndroid Build Coastguard Worker #include	<vector>
27*48a54d36SAndroid Build Coastguard Worker 
28*48a54d36SAndroid Build Coastguard Worker #include	"afxcmn.h"
29*48a54d36SAndroid Build Coastguard Worker 
30*48a54d36SAndroid Build Coastguard Worker #include	"Resource.h"
31*48a54d36SAndroid Build Coastguard Worker 
32*48a54d36SAndroid Build Coastguard Worker #include	"DNSServices.h"
33*48a54d36SAndroid Build Coastguard Worker 
34*48a54d36SAndroid Build Coastguard Worker //===========================================================================================================================
35*48a54d36SAndroid Build Coastguard Worker //	Structures
36*48a54d36SAndroid Build Coastguard Worker //===========================================================================================================================
37*48a54d36SAndroid Build Coastguard Worker 
38*48a54d36SAndroid Build Coastguard Worker struct	ServiceInstanceInfo
39*48a54d36SAndroid Build Coastguard Worker {
40*48a54d36SAndroid Build Coastguard Worker 	std::string		name;
41*48a54d36SAndroid Build Coastguard Worker 	std::string		type;
42*48a54d36SAndroid Build Coastguard Worker 	std::string		domain;
43*48a54d36SAndroid Build Coastguard Worker 	std::string		ip;
44*48a54d36SAndroid Build Coastguard Worker 	std::string		text;
45*48a54d36SAndroid Build Coastguard Worker 	std::string		ifIP;
46*48a54d36SAndroid Build Coastguard Worker 	std::string		hostName;
47*48a54d36SAndroid Build Coastguard Worker };
48*48a54d36SAndroid Build Coastguard Worker 
49*48a54d36SAndroid Build Coastguard Worker struct	ServiceTypeInfo
50*48a54d36SAndroid Build Coastguard Worker {
51*48a54d36SAndroid Build Coastguard Worker 	std::string		serviceType;
52*48a54d36SAndroid Build Coastguard Worker 	std::string		description;
53*48a54d36SAndroid Build Coastguard Worker 	std::string		urlScheme;
54*48a54d36SAndroid Build Coastguard Worker };
55*48a54d36SAndroid Build Coastguard Worker 
56*48a54d36SAndroid Build Coastguard Worker //===========================================================================================================================
57*48a54d36SAndroid Build Coastguard Worker //	ChooserDialog
58*48a54d36SAndroid Build Coastguard Worker //===========================================================================================================================
59*48a54d36SAndroid Build Coastguard Worker 
60*48a54d36SAndroid Build Coastguard Worker class	ChooserDialog : public CDialog
61*48a54d36SAndroid Build Coastguard Worker {
62*48a54d36SAndroid Build Coastguard Worker 	public:
63*48a54d36SAndroid Build Coastguard Worker 
64*48a54d36SAndroid Build Coastguard Worker 		ChooserDialog(CWnd* pParent = NULL);
65*48a54d36SAndroid Build Coastguard Worker 		virtual	~ChooserDialog( void );
66*48a54d36SAndroid Build Coastguard Worker 
67*48a54d36SAndroid Build Coastguard Worker 		//{{AFX_DATA(ChooserDialog)
68*48a54d36SAndroid Build Coastguard Worker 		enum { IDD = IDD_CHOOSER_DIALOG };
69*48a54d36SAndroid Build Coastguard Worker 		CListCtrl mServiceList;
70*48a54d36SAndroid Build Coastguard Worker 		CListCtrl mDomainList;
71*48a54d36SAndroid Build Coastguard Worker 		CListCtrl mChooserList;
72*48a54d36SAndroid Build Coastguard Worker 		//}}AFX_DATA
73*48a54d36SAndroid Build Coastguard Worker 
74*48a54d36SAndroid Build Coastguard Worker 		// ClassWizard generated virtual function overrides
75*48a54d36SAndroid Build Coastguard Worker 		//{{AFX_VIRTUAL(ChooserDialog)
76*48a54d36SAndroid Build Coastguard Worker 		public:
77*48a54d36SAndroid Build Coastguard Worker 		virtual BOOL PreTranslateMessage(MSG* pMsg);
78*48a54d36SAndroid Build Coastguard Worker 		protected:
79*48a54d36SAndroid Build Coastguard Worker 		virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
80*48a54d36SAndroid Build Coastguard Worker 		virtual void PostNcDestroy();
81*48a54d36SAndroid Build Coastguard Worker 		//}}AFX_VIRTUAL
82*48a54d36SAndroid Build Coastguard Worker 
83*48a54d36SAndroid Build Coastguard Worker 	protected:
84*48a54d36SAndroid Build Coastguard Worker 
85*48a54d36SAndroid Build Coastguard Worker 		typedef std::vector < ServiceInstanceInfo >		ServiceInstanceVector;
86*48a54d36SAndroid Build Coastguard Worker 		typedef std::vector < ServiceTypeInfo >			ServiceTypeVector;
87*48a54d36SAndroid Build Coastguard Worker 
88*48a54d36SAndroid Build Coastguard Worker 		HACCEL						mMenuAcceleratorTable;
89*48a54d36SAndroid Build Coastguard Worker 		DNSBrowserRef				mBrowser;
90*48a54d36SAndroid Build Coastguard Worker 		BOOL						mIsServiceBrowsing;
91*48a54d36SAndroid Build Coastguard Worker 		ServiceInstanceVector		mServiceInstances;
92*48a54d36SAndroid Build Coastguard Worker 		ServiceTypeVector			mServiceTypes;
93*48a54d36SAndroid Build Coastguard Worker 
94*48a54d36SAndroid Build Coastguard Worker 	public:
95*48a54d36SAndroid Build Coastguard Worker 
96*48a54d36SAndroid Build Coastguard Worker 		void	PopulateServicesList( void );
97*48a54d36SAndroid Build Coastguard Worker 		void	UpdateInfoDisplay( void );
98*48a54d36SAndroid Build Coastguard Worker 
99*48a54d36SAndroid Build Coastguard Worker 		void	StartBrowsing( const char *inType, const char *inDomain );
100*48a54d36SAndroid Build Coastguard Worker 		void	StopBrowsing( void );
101*48a54d36SAndroid Build Coastguard Worker 
102*48a54d36SAndroid Build Coastguard Worker 	protected:
103*48a54d36SAndroid Build Coastguard Worker 
104*48a54d36SAndroid Build Coastguard Worker 		//{{AFX_MSG(ChooserDialog)
105*48a54d36SAndroid Build Coastguard Worker 		virtual BOOL OnInitDialog();
106*48a54d36SAndroid Build Coastguard Worker 		afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
107*48a54d36SAndroid Build Coastguard Worker 		afx_msg void OnDomainListChanged(NMHDR* pNMHDR, LRESULT* pResult);
108*48a54d36SAndroid Build Coastguard Worker 		afx_msg void OnServiceListChanged(NMHDR* pNMHDR, LRESULT* pResult);
109*48a54d36SAndroid Build Coastguard Worker 		afx_msg void OnChooserListChanged(NMHDR* pNMHDR, LRESULT* pResult);
110*48a54d36SAndroid Build Coastguard Worker 		afx_msg void OnChooserListDoubleClick(NMHDR* pNMHDR, LRESULT* pResult);
111*48a54d36SAndroid Build Coastguard Worker 		afx_msg void OnAbout();
112*48a54d36SAndroid Build Coastguard Worker 		afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
113*48a54d36SAndroid Build Coastguard Worker 		afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized);
114*48a54d36SAndroid Build Coastguard Worker 		afx_msg void OnFileClose();
115*48a54d36SAndroid Build Coastguard Worker 		virtual void OnCancel();
116*48a54d36SAndroid Build Coastguard Worker 		afx_msg void OnExit();
117*48a54d36SAndroid Build Coastguard Worker 		afx_msg void OnClose();
118*48a54d36SAndroid Build Coastguard Worker 		afx_msg void OnNcDestroy();
119*48a54d36SAndroid Build Coastguard Worker 		//}}AFX_MSG
120*48a54d36SAndroid Build Coastguard Worker 		afx_msg LONG OnDomainAdd( WPARAM inWParam, LPARAM inLParam );
121*48a54d36SAndroid Build Coastguard Worker 		afx_msg LONG OnDomainRemove( WPARAM inWParam, LPARAM inLParam );
122*48a54d36SAndroid Build Coastguard Worker 		afx_msg LONG OnServiceAdd( WPARAM inWParam, LPARAM inLParam );
123*48a54d36SAndroid Build Coastguard Worker 		afx_msg LONG OnServiceRemove( WPARAM inWParam, LPARAM inLParam );
124*48a54d36SAndroid Build Coastguard Worker 		afx_msg LONG OnResolve( WPARAM inWParam, LPARAM inLParam );
125*48a54d36SAndroid Build Coastguard Worker 		DECLARE_MESSAGE_MAP()
126*48a54d36SAndroid Build Coastguard Worker };
127*48a54d36SAndroid Build Coastguard Worker 
128*48a54d36SAndroid Build Coastguard Worker //{{AFX_INSERT_LOCATION}}
129*48a54d36SAndroid Build Coastguard Worker // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
130*48a54d36SAndroid Build Coastguard Worker 
131*48a54d36SAndroid Build Coastguard Worker #endif // !defined(AFX_CHOOSERDIALOG_H__AC258704_B307_4901_9F98_A0AC022FD8AC__INCLUDED_)
132