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.7 2005/02/25 19:57:30 shersche
27 <rdar://problem/4023323> Remove FTP browsing from plugin
29 Revision 1.6 2005/01/27 22:27:03 shersche
30 Add m_about member for "About ..." tree item
32 Revision 1.5 2004/07/26 05:47:31 shersche
33 use TXTRecord APIs, fix bug in locating service to be removed
35 Revision 1.4 2004/07/20 06:49:18 shersche
36 clean up socket handling code
38 Revision 1.3 2004/07/13 21:24:21 rpantos
39 Fix for <rdar://problem/3701120>.
41 Revision 1.2 2004/06/27 14:59:59 shersche
42 reference count service info to handle multi-homed hosts
44 Revision 1.1 2004/06/18 04:34:59 rpantos
45 Move to Clients from mDNSWindows
47 Revision 1.3 2004/04/15 01:00:05 bradley
48 Removed support for automatically querying for A/AAAA records when resolving names. Platforms
49 without .local name resolving support will need to manually query for A/AAAA records as needed.
51 Revision 1.2 2004/04/08 09:43:43 bradley
52 Changed callback calling conventions to __stdcall so they can be used with C# delegates.
54 Revision 1.1 2004/01/30 03:01:56 bradley
55 Explorer Plugin to browse for DNS-SD advertised Web and FTP servers from within Internet Explorer.
59 #ifndef __EXPLORER_BAR_WINDOW__
60 #define __EXPLORER_BAR_WINDOW__
69 //===========================================================================================================================
71 //===========================================================================================================================
73 // Forward Declarations
75 struct ServiceHandlerEntry
;
76 class ExplorerBarWindow
;
88 ServiceHandlerEntry
* handler
;
116 typedef CArray
< ServiceInfo
*, ServiceInfo
* > ServiceInfoArray
;
139 void GetData( void *outData
, uint16_t *outSize
)
143 *( (void **) outData
) = mData
;
151 OSStatus
SetData( const void *inData
, uint16_t inSize
)
156 newData
= (uint8_t *) malloc( inSize
);
157 require_action( newData
, exit
, err
= kNoMemoryErr
);
158 memcpy( newData
, inData
, inSize
);
181 ServiceHandlerEntry
* handler
;
184 // ServiceHandlerEntry
186 struct ServiceHandlerEntry
189 const char * urlScheme
;
191 ServiceInfoArray array
;
192 ExplorerBarWindow
* obj
;
195 ServiceHandlerEntry( void )
204 ~ServiceHandlerEntry( void )
209 n
= (int) array
.GetSize();
210 for( i
= 0; i
< n
; ++i
)
217 typedef CArray
< ServiceHandlerEntry
*, ServiceHandlerEntry
* > ServiceHandlerArray
;
219 //===========================================================================================================================
221 //===========================================================================================================================
223 class ExplorerBar
; // Forward Declaration
225 class ExplorerBarWindow
: public CWnd
229 ExplorerBar
* mOwner
;
232 ServiceHandlerArray mServiceHandlers
;
233 DNSServiceRef mResolveServiceRef
;
237 ExplorerBarWindow( void );
238 virtual ~ExplorerBarWindow( void );
244 afx_msg
int OnCreate( LPCREATESTRUCT inCreateStruct
);
245 afx_msg
void OnDestroy( void );
246 afx_msg
void OnSize( UINT inType
, int inX
, int inY
);
247 afx_msg
void OnDoubleClick( NMHDR
*inNMHDR
, LRESULT
*outResult
);
248 afx_msg LONG
OnServiceEvent( WPARAM inWParam
, LPARAM inLParam
);
252 static void DNSSD_API
255 DNSServiceFlags inFlags
,
256 uint32_t inInterfaceIndex
,
257 DNSServiceErrorType inErrorCode
,
260 const char * inDomain
,
262 LONG
OnServiceAdd( ServiceInfo
* service
);
263 LONG
OnServiceRemove( ServiceInfo
* service
);
267 OSStatus
StartResolve( ServiceInfo
*inService
);
268 void StopResolve( void );
271 void Stop( DNSServiceRef ref
);
274 static void DNSSD_API
277 DNSServiceFlags inFlags
,
278 uint32_t inInterfaceIndex
,
279 DNSServiceErrorType inErrorCode
,
280 const char * inFullName
,
281 const char * inHostName
,
286 LONG
OnResolve( ResolveInfo
* resolve
);
292 ExplorerBar
* GetOwner( void ) const { return( mOwner
); }
293 void SetOwner( ExplorerBar
*inOwner
) { mOwner
= inOwner
; }
295 DECLARE_MESSAGE_MAP()
298 typedef std::list
< DNSServiceRef
> ServiceRefList
;
301 ServiceRefList m_serviceRefs
;
302 CImageList m_imageList
;
305 #endif // __EXPLORER_BAR_WINDOW__