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.
18 #if !defined(AFX_CHOOSERDIALOG_H__AC258704_B307_4901_9F98_A0AC022FD8AC__INCLUDED_)
19 #define AFX_CHOOSERDIALOG_H__AC258704_B307_4901_9F98_A0AC022FD8AC__INCLUDED_
23 #endif // _MSC_VER > 1000
32 #include "DNSServices.h"
34 //===========================================================================================================================
36 //===========================================================================================================================
38 struct ServiceInstanceInfo
49 struct ServiceTypeInfo
51 std::string serviceType
;
52 std::string description
;
53 std::string urlScheme
;
56 //===========================================================================================================================
58 //===========================================================================================================================
60 class ChooserDialog
: public CDialog
64 ChooserDialog(CWnd
* pParent
= NULL
);
65 virtual ~ChooserDialog( void );
67 //{{AFX_DATA(ChooserDialog)
68 enum { IDD
= IDD_CHOOSER_DIALOG
};
69 CListCtrl mServiceList
;
70 CListCtrl mDomainList
;
71 CListCtrl mChooserList
;
74 // ClassWizard generated virtual function overrides
75 //{{AFX_VIRTUAL(ChooserDialog)
77 virtual BOOL
PreTranslateMessage(MSG
* pMsg
);
79 virtual void DoDataExchange(CDataExchange
* pDX
); // DDX/DDV support
80 virtual void PostNcDestroy();
85 typedef std::vector
< ServiceInstanceInfo
> ServiceInstanceVector
;
86 typedef std::vector
< ServiceTypeInfo
> ServiceTypeVector
;
88 HACCEL mMenuAcceleratorTable
;
89 DNSBrowserRef mBrowser
;
90 BOOL mIsServiceBrowsing
;
91 ServiceInstanceVector mServiceInstances
;
92 ServiceTypeVector mServiceTypes
;
96 void PopulateServicesList( void );
97 void UpdateInfoDisplay( void );
99 void StartBrowsing( const char *inType
, const char *inDomain
);
100 void StopBrowsing( void );
104 //{{AFX_MSG(ChooserDialog)
105 virtual BOOL
OnInitDialog();
106 afx_msg
void OnSysCommand(UINT nID
, LPARAM lParam
);
107 afx_msg
void OnDomainListChanged(NMHDR
* pNMHDR
, LRESULT
* pResult
);
108 afx_msg
void OnServiceListChanged(NMHDR
* pNMHDR
, LRESULT
* pResult
);
109 afx_msg
void OnChooserListChanged(NMHDR
* pNMHDR
, LRESULT
* pResult
);
110 afx_msg
void OnChooserListDoubleClick(NMHDR
* pNMHDR
, LRESULT
* pResult
);
111 afx_msg
void OnAbout();
112 afx_msg
void OnInitMenuPopup(CMenu
* pPopupMenu
, UINT nIndex
, BOOL bSysMenu
);
113 afx_msg
void OnActivate(UINT nState
, CWnd
* pWndOther
, BOOL bMinimized
);
114 afx_msg
void OnFileClose();
115 virtual void OnCancel();
116 afx_msg
void OnExit();
117 afx_msg
void OnClose();
118 afx_msg
void OnNcDestroy();
120 afx_msg LONG
OnDomainAdd( WPARAM inWParam
, LPARAM inLParam
);
121 afx_msg LONG
OnDomainRemove( WPARAM inWParam
, LPARAM inLParam
);
122 afx_msg LONG
OnServiceAdd( WPARAM inWParam
, LPARAM inLParam
);
123 afx_msg LONG
OnServiceRemove( WPARAM inWParam
, LPARAM inLParam
);
124 afx_msg LONG
OnResolve( WPARAM inWParam
, LPARAM inLParam
);
125 DECLARE_MESSAGE_MAP()
128 //{{AFX_INSERT_LOCATION}}
129 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
131 #endif // !defined(AFX_CHOOSERDIALOG_H__AC258704_B307_4901_9F98_A0AC022FD8AC__INCLUDED_)