2 * Copyright (c) 2003-2004 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
25 Change History (most recent first):
27 $Log: ExplorerBarWindow.h,v $
28 Revision 1.3 2004/04/15 01:00:05 bradley
29 Removed support for automatically querying for A/AAAA records when resolving names. Platforms
30 without .local name resolving support will need to manually query for A/AAAA records as needed.
32 Revision 1.2 2004/04/08 09:43:43 bradley
33 Changed callback calling conventions to __stdcall so they can be used with C# delegates.
35 Revision 1.1 2004/01/30 03:01:56 bradley
36 Explorer Plugin to browse for Rendezvous-enabled Web and FTP servers from within Internet Explorer.
40 #ifndef __EXPLORER_BAR_WINDOW__
41 #define __EXPLORER_BAR_WINDOW__
49 //===========================================================================================================================
51 //===========================================================================================================================
53 // Forward Declarations
55 struct ServiceHandlerEntry
;
56 class ExplorerBarWindow
;
68 ServiceHandlerEntry
* handler
;
95 typedef CArray
< ServiceInfo
*, ServiceInfo
* > ServiceInfoArray
;
118 void GetData( void *outData
, size_t *outSize
)
122 *( (void **) outData
) = mData
;
130 OSStatus
SetData( const void *inData
, size_t inSize
)
135 newData
= (uint8_t *) malloc( inSize
);
136 require_action( newData
, exit
, err
= kNoMemoryErr
);
137 memcpy( newData
, inData
, inSize
);
160 ServiceHandlerEntry
* handler
;
163 // ServiceHandlerEntry
165 struct ServiceHandlerEntry
168 const char * urlScheme
;
170 ServiceInfoArray array
;
173 ExplorerBarWindow
* obj
;
176 ServiceHandlerEntry( void )
187 ~ServiceHandlerEntry( void )
191 DNSServiceRefDeallocate( ref
);
197 n
= (int) array
.GetSize();
198 for( i
= 0; i
< n
; ++i
)
205 typedef CArray
< ServiceHandlerEntry
*, ServiceHandlerEntry
* > ServiceHandlerArray
;
207 //===========================================================================================================================
209 //===========================================================================================================================
211 class ExplorerBar
; // Forward Declaration
213 class ExplorerBarWindow
: public CWnd
217 ExplorerBar
* mOwner
;
220 ServiceHandlerArray mServiceHandlers
;
221 DNSServiceRef mResolveServiceRef
;
225 ExplorerBarWindow( void );
226 virtual ~ExplorerBarWindow( void );
232 afx_msg
int OnCreate( LPCREATESTRUCT inCreateStruct
);
233 afx_msg
void OnDestroy( void );
234 afx_msg
void OnSize( UINT inType
, int inX
, int inY
);
235 afx_msg
void OnDoubleClick( NMHDR
*inNMHDR
, LRESULT
*outResult
);
239 static void CALLBACK_COMPAT
242 DNSServiceFlags inFlags
,
243 uint32_t inInterfaceIndex
,
244 DNSServiceErrorType inErrorCode
,
247 const char * inDomain
,
249 afx_msg LONG
OnServiceAdd( WPARAM inWParam
, LPARAM inLParam
);
250 afx_msg LONG
OnServiceRemove( WPARAM inWParam
, LPARAM inLParam
);
254 OSStatus
StartResolve( ServiceInfo
*inService
);
255 void StopResolve( void );
257 static void CALLBACK_COMPAT
260 DNSServiceFlags inFlags
,
261 uint32_t inInterfaceIndex
,
262 DNSServiceErrorType inErrorCode
,
263 const char * inFullName
,
264 const char * inHostName
,
269 afx_msg LONG
OnResolve( WPARAM inWParam
, LPARAM inLParam
);
275 ExplorerBar
* GetOwner( void ) const { return( mOwner
); }
276 void SetOwner( ExplorerBar
*inOwner
) { mOwner
= inOwner
; }
278 DECLARE_MESSAGE_MAP()
281 #endif // __EXPLORER_BAR_WINDOW__