diff --git a/ChangeLog b/ChangeLog index 2fb49fec9..679a18a9a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-03-01 Niels Grewe + * 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 * Source/NSAutoreleasePool.m: diff --git a/Headers/Additions/GNUstepBase/NSNetServices+GNUstepBase.h b/Headers/Additions/GNUstepBase/NSNetServices+GNUstepBase.h index 72837b193..2f1820386 100644 --- a/Headers/Additions/GNUstepBase/NSNetServices+GNUstepBase.h +++ b/Headers/Additions/GNUstepBase/NSNetServices+GNUstepBase.h @@ -3,24 +3,24 @@ Written by: Niels Grewe Date: March 2010 - + This file is part of the GNUstep Base Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. - */ + */ #import #import @@ -78,4 +78,38 @@ */ - (NSString*) fullServiceName; @end + + +@protocol GSNetServiceDelegate +#ifdef __clang__ +@optional +#else +@end +@interface NSObject (GSNetServiceDelegateMethods) +#endif // __clang__ + +/** + * Notifies the delegate that the addresses for the service have + * changed. + */ +- (void)netService: (NSNetService*)service +didUpdateAddresses: (NSArray*)addresses; + +/** + * Notifies the delegate that the record of the type 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 type for updates. + */ +- (void)netService: (NSNetService*)service + didNotMonitor: (NSDictionary*)errorDict + forRecordType: (NSString*)type; +@end + #endif // GS_USE_AVAHI diff --git a/Source/GSNetServices.h b/Source/GSNetServices.h index 1b2012e1c..2fa5d39e9 100644 --- a/Source/GSNetServices.h +++ b/Source/GSNetServices.h @@ -3,29 +3,30 @@ Written by: Niels Grewe Date: March 2010 - + This file is part of the GNUstep Base Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. - */ + */ #import "common.h" #define EXPOSE_NSNetService_IVARS 1 #define EXPOSE_NSNetServiceBrowser_IVARS 1 #import "Foundation/NSNetServices.h" +#import "GNUstepBase/NSNetServices+GNUstepBase.h" // Subclasses using mDNSResponder: @@ -113,6 +114,8 @@ NSString* GSNetServiceDotTerminatedNSStringFromString(const char* string); name: (NSString*)name avahiIfIndex: (int)anIfIndex avahiProtocol: (int)aProtocol; + +- (id)delegate; @end /**