Declare a protocol for GNUstep specific delegate methods in NSNetServices.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32426 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Niels Grewe 2011-03-01 10:52:21 +00:00
parent 7cf4d2bb21
commit 821962705e
3 changed files with 51 additions and 8 deletions

View file

@ -1,3 +1,9 @@
2011-03-01 Niels Grewe <niels.grewe@halbordnung.de>
* Source/GSNetServices.h
* Headers/Additions/GNUstepBase/NSNetServices+GNUstepBase.h:
Declare a protocol for GNUstep specific delegate methods in
NSNetServices.
2011-02-28 Richard Frith-Macdonald <rfm@gnu.org> 2011-02-28 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSAutoreleasePool.m: * Source/NSAutoreleasePool.m:

View file

@ -3,24 +3,24 @@
Written by: Niels Grewe <niels.grewe@halbordnung.de> Written by: Niels Grewe <niels.grewe@halbordnung.de>
Date: March 2010 Date: March 2010
This file is part of the GNUstep Base Library. This file is part of the GNUstep Base Library.
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version. version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details. Library General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA. Boston, MA 02111 USA.
*/ */
#import <Foundation/NSNetServices.h> #import <Foundation/NSNetServices.h>
#import <GNUstepBase/GSConfig.h> #import <GNUstepBase/GSConfig.h>
@ -78,4 +78,38 @@
*/ */
- (NSString*) fullServiceName; - (NSString*) fullServiceName;
@end @end
@protocol GSNetServiceDelegate <NSNetServiceDelegate>
#ifdef __clang__
@optional
#else
@end
@interface NSObject (GSNetServiceDelegateMethods)
#endif // __clang__
/**
* Notifies the delegate that the addresses for the <var>service</var> have
* changed.
*/
- (void)netService: (NSNetService*)service
didUpdateAddresses: (NSArray*)addresses;
/**
* Notifies the delegate that the record of the <var>type</var> given
* has changed.
*/
- (void)netService: (NSNetService*)service
didUpdateRecordData: (id)newData
forRecordType: (NSString*)type;
/**
* Notifies the delegate that there was a problem when trying to monitor a
* resource record of <var>type</var> for updates.
*/
- (void)netService: (NSNetService*)service
didNotMonitor: (NSDictionary*)errorDict
forRecordType: (NSString*)type;
@end
#endif // GS_USE_AVAHI #endif // GS_USE_AVAHI

View file

@ -3,29 +3,30 @@
Written by: Niels Grewe <niels.grewe@halbordnung.de> Written by: Niels Grewe <niels.grewe@halbordnung.de>
Date: March 2010 Date: March 2010
This file is part of the GNUstep Base Library. This file is part of the GNUstep Base Library.
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version. version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details. Library General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA. Boston, MA 02111 USA.
*/ */
#import "common.h" #import "common.h"
#define EXPOSE_NSNetService_IVARS 1 #define EXPOSE_NSNetService_IVARS 1
#define EXPOSE_NSNetServiceBrowser_IVARS 1 #define EXPOSE_NSNetServiceBrowser_IVARS 1
#import "Foundation/NSNetServices.h" #import "Foundation/NSNetServices.h"
#import "GNUstepBase/NSNetServices+GNUstepBase.h"
// Subclasses using mDNSResponder: // Subclasses using mDNSResponder:
@ -113,6 +114,8 @@ NSString* GSNetServiceDotTerminatedNSStringFromString(const char* string);
name: (NSString*)name name: (NSString*)name
avahiIfIndex: (int)anIfIndex avahiIfIndex: (int)anIfIndex
avahiProtocol: (int)aProtocol; avahiProtocol: (int)aProtocol;
- (id<NSObject,GSNetServiceDelegate>)delegate;
@end @end
/** /**