2 * Copyright (c) 2003-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: ExplorerBarWindow.h,v $
26 Revision 1.6 2005/01/27 22:27:03 shersche
27 Add m_about member for "About Rendezvous" tree item
29 Revision 1.5 2004/07/26 05:47:31 shersche
30 use TXTRecord APIs, fix bug in locating service to be removed
32 Revision 1.4 2004/07/20 06:49:18 shersche
33 clean up socket handling code
35 Revision 1.3 2004/07/13 21:24:21 rpantos
36 Fix for <rdar://problem/3701120>.
38 Revision 1.2 2004/06/27 14:59:59 shersche
39 reference count service info to handle multi-homed hosts
41 Revision 1.1 2004/06/18 04:34:59 rpantos
42 Move to Clients from mDNSWindows
44 Revision 1.3 2004/04/15 01:00:05 bradley
45 Removed support for automatically querying for A/AAAA records when resolving names. Platforms
46 without .local name resolving support will need to manually query for A/AAAA records as needed.
48 Revision 1.2 2004/04/08 09:43:43 bradley
49 Changed callback calling conventions to __stdcall so they can be used with C# delegates.
51 Revision 1.1 2004/01/30 03:01:56 bradley
52 Explorer Plugin to browse for DNS-SD advertised Web and FTP servers from within Internet Explorer.
56 #ifndef __EXPLORER_BAR_WINDOW__
57 #define __EXPLORER_BAR_WINDOW__
66 //===========================================================================================================================
68 //===========================================================================================================================
70 // Forward Declarations
72 struct ServiceHandlerEntry
;
73 class ExplorerBarWindow
;
85 ServiceHandlerEntry
* handler
;
113 typedef CArray
< ServiceInfo
*, ServiceInfo
* > ServiceInfoArray
;
136 void GetData( void *outData
, uint16_t *outSize
)
140 *( (void **) outData
) = mData
;
148 OSStatus
SetData( const void *inData
, uint16_t inSize
)
153 newData
= (uint8_t *) malloc( inSize
);
154 require_action( newData
, exit
, err
= kNoMemoryErr
);
155 memcpy( newData
, inData
, inSize
);
178 ServiceHandlerEntry
* handler
;
181 // ServiceHandlerEntry
183 struct ServiceHandlerEntry
186 const char * urlScheme
;
188 ServiceInfoArray array
;
191 ExplorerBarWindow
* obj
;
194 ServiceHandlerEntry( void )
205 ~ServiceHandlerEntry( void )
210 n
= (int) array
.GetSize();
211 for( i
= 0; i
< n
; ++i
)
218 typedef CArray
< ServiceHandlerEntry
*, ServiceHandlerEntry
* > ServiceHandlerArray
;
220 //===========================================================================================================================
222 //===========================================================================================================================
224 class ExplorerBar
; // Forward Declaration
226 class ExplorerBarWindow
: public CWnd
230 ExplorerBar
* mOwner
;
233 ServiceHandlerArray mServiceHandlers
;
234 DNSServiceRef mResolveServiceRef
;
238 ExplorerBarWindow( void );
239 virtual ~ExplorerBarWindow( void );
245 afx_msg
int OnCreate( LPCREATESTRUCT inCreateStruct
);
246 afx_msg
void OnDestroy( void );
247 afx_msg
void OnSize( UINT inType
, int inX
, int inY
);
248 afx_msg
void OnDoubleClick( NMHDR
*inNMHDR
, LRESULT
*outResult
);
249 afx_msg LONG
OnServiceEvent( WPARAM inWParam
, LPARAM inLParam
);
253 static void DNSSD_API
256 DNSServiceFlags inFlags
,
257 uint32_t inInterfaceIndex
,
258 DNSServiceErrorType inErrorCode
,
261 const char * inDomain
,
263 LONG
OnServiceAdd( ServiceInfo
* service
);
264 LONG
OnServiceRemove( ServiceInfo
* service
);
268 OSStatus
StartResolve( ServiceInfo
*inService
);
269 void StopResolve( void );
272 void Stop( DNSServiceRef ref
);
275 static void DNSSD_API
278 DNSServiceFlags inFlags
,
279 uint32_t inInterfaceIndex
,
280 DNSServiceErrorType inErrorCode
,
281 const char * inFullName
,
282 const char * inHostName
,
287 LONG
OnResolve( ResolveInfo
* resolve
);
293 ExplorerBar
* GetOwner( void ) const { return( mOwner
); }
294 void SetOwner( ExplorerBar
*inOwner
) { mOwner
= inOwner
; }
296 DECLARE_MESSAGE_MAP()
299 typedef std::list
< DNSServiceRef
> ServiceRefList
;
302 ServiceRefList m_serviceRefs
;
303 CImageList m_imageList
;
306 #endif // __EXPLORER_BAR_WINDOW__