home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextLibrary / Frameworks / NEXTIME.framework / Versions / A / Headers / NTComponentManager.h < prev    next >
Encoding:
Text File  |  1995-08-30  |  2.1 KB  |  79 lines

  1. /*
  2.  *  NTComponentManager.h
  3.  *     Copyright 1992, NeXT Computer, Inc.
  4.  *    
  5.  *    Protocol and default implementation for a finder of loadable
  6.  *    objects.
  7.  *
  8.  *    17 Sept 1992 mpaque Created.
  9.  */
  10.  
  11. #import <Foundation/NSObject.h>
  12. #import <Foundation/NSDictionary.h>
  13. #import <Foundation/NSArray.h>
  14. #import <Foundation/NSString.h>
  15. #import "NTValueDictionary.h"
  16. #import "NTComponent.h"
  17.  
  18. @protocol NTComponentManager <NSObject>
  19. //
  20. // Default component access methods, as convenience methods
  21. //
  22. - init;
  23. - (void)dealloc;
  24.  
  25. - defaultComponentWithDescription:(in bycopy NSDictionary *)description;
  26. - defaultComponentClassWithDescription:
  27.                 (in bycopy NSDictionary *)description;
  28. - defaultComponentInstanceWithDescription:
  29.                 (in bycopy NSDictionary *)description;
  30.  
  31.  
  32. - componentInstance: comp;    // Given a component, return an instance
  33.  
  34. // Method to set a default Component Item
  35. - (BOOL)setDefaultComponentItem:(in id)item;
  36.  
  37. // Register a component bundle.  Returns a list of component item instances
  38. // built from the bundle.  Unregister using the returned instance
  39. - (NSArray *)registerComponentBundle:(in NSString *)bundleDir;
  40.  
  41. // Register a component item
  42. - registerComponent:item;
  43.  
  44. // Unregister a component item
  45. - unregisterComponent:item;
  46.  
  47. // map from a class back to a component
  48. - componentForClass:class;
  49.  
  50. //
  51. // The following routines generate sublists of type (NSArray *)
  52. // holding copies of all components.
  53. //
  54. - (NSArray *)components; // Returns a copy of the master list of all components
  55.  
  56. // Return a list of all components in master list which match description
  57. - (NSArray *)componentsWithDescription    :(in bycopy NSDictionary *)description;
  58.  
  59. // Return a list of all components in argument list which match description
  60. - (NSArray *)componentsWithDescription    :(in bycopy NSDictionary *)description
  61.         fromList    :(NSArray *)list;
  62.  
  63. @end
  64.  
  65. @class NSLock;
  66.  
  67. @interface NTComponentManager:NSObject <NTComponentManager>
  68. {
  69. @private
  70.     NSMutableArray *    componentList;
  71.     NSLock *        instLock;
  72.     int            _refcount;
  73. }
  74.  
  75. + (void)startup;
  76. - initWithDirectory:(NSString *)dirname;
  77. - initWithDirectories:(NSArray *)dirnames; // designated initializer
  78. @end
  79.