1 /** 2 <title>NSNib.h</title> 3 4 <abstract> 5 This class serves as a container for a nib file. It's possible 6 to load a nib file from a URL or from a bundle. Using this 7 class the nib file can now be "preloaded" and instantiated 8 multiple times when/if needed. Also, since it's possible to 9 initialize this class using a NSURL it's possible to load 10 nib files from remote locations. 11 <b/> 12 This class uses: NSNibOwner and NSNibTopLevelObjects to allow 13 the caller to specify the owner of the nib during instantiation 14 and receive an array containing the top level objects of the nib 15 file. 16 </abstract> 17 18 Copyright (C) 2004 Free Software Foundation, Inc. 19 20 Author: Gregory John Casamento <greg_casamento@yahoo.com> 21 Date: 2004 22 23 This file is part of the GNUstep GUI Library. 24 25 This library is free software; you can redistribute it and/or 26 modify it under the terms of the GNU Lesser General Public 27 License as published by the Free Software Foundation; either 28 version 2 of the License, or (at your option) any later version. 29 30 This library is distributed in the hope that it will be useful, 31 but WITHOUT ANY WARRANTY; without even the implied warranty of 32 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 33 Lesser General Public License for more details. 34 35 You should have received a copy of the GNU Lesser General Public 36 License along with this library; see the file COPYING.LIB. 37 If not, see <http://www.gnu.org/licenses/> or write to the 38 Free Software Foundation, 51 Franklin Street, Fifth Floor, 39 Boston, MA 02110-1301, USA. 40 */ 41 42 #ifndef _GNUstep_H_NSNib 43 #define _GNUstep_H_NSNib 44 #import <GNUstepBase/GSVersionMacros.h> 45 46 #import <Foundation/NSObject.h> 47 #import <Foundation/NSZone.h> 48 #import <AppKit/AppKitDefines.h> 49 50 @class NSData; 51 @class NSDictionary; 52 @class NSString; 53 @class NSBundle; 54 @class NSURL; 55 @class NSArray; 56 @class NSMutableArray; 57 58 #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) 59 APPKIT_EXPORT NSString *NSNibTopLevelObjects; 60 APPKIT_EXPORT NSString *NSNibOwner; 61 #endif 62 63 @interface NSNib : NSObject <NSCoding> 64 { 65 NSData *_nibData; 66 id _loader; 67 NSURL *_url; 68 NSBundle *_bundle; 69 } 70 71 // reading the data... 72 - (id)initWithContentsOfURL: (NSURL *)nibFileURL; 73 - (id)initWithNibNamed: (NSString *)nibNamed bundle: (NSBundle *)bundle; 74 75 // instantiating the nib. 76 - (BOOL)instantiateNibWithExternalNameTable: (NSDictionary *)externalNameTable; 77 - (BOOL)instantiateNibWithOwner: (id)owner topLevelObjects: (NSArray **)topLevelObjects; 78 79 #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) 80 - (BOOL)instantiateNibWithExternalNameTable: (NSDictionary *)externalNameTable withZone: (NSZone *)zone; 81 #endif 82 83 @end 84 85 #endif /* _GNUstep_H_NSNib */ 86