home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1994 June / NEBULA_SE.ISO / SourceCode / MiscKit / Headers / misckit / MiscNibController.h < prev    next >
Encoding:
Text File  |  1994-03-23  |  2.5 KB  |  81 lines

  1. //
  2. //    MiscNibController.h -- an abstract superclass to load .nib files with
  3. //            windows in them
  4. //        Written by Mike Ferris Copyright (c) 1994 by Mike Ferris.
  5. //        Modified from original MOKit "MOController" class by Don Yacktman.
  6. //                Version 1.0.  All rights reserved.
  7. //
  8. //        This notice may not be removed from this source code.
  9. //
  10. //    This object is included in the MiscKit by permission from the author
  11. //    and its use is governed by the MiscKit license, found in the file
  12. //    "LICENSE.rtf" in the MiscKit distribution.  Please refer to that file
  13. //    for a list of all applicable permissions and restrictions.
  14. //    
  15.  
  16.  
  17. // This class is meant to be a File's owner for a .nib.  Typically, you
  18. // will probably want to subclass this class to add outlets and other
  19. // added features; this class just provides a mechanism to load .nib files.
  20. // Use +setClassNib: to change the .nib file name that will be used when
  21. // loading; each subclass can change the name. If it doesn't, the default
  22. // is to use [class name].nib... note that the .nib name is a true class
  23. // variable, so each subclass will have it's own value for it.
  24.  
  25. #import <appkit/appkit.h>
  26.  
  27. // Forward declarations of class names we'll use for static typing.
  28. @class MiscString;
  29.  
  30. @interface MiscNibController:Object
  31. {
  32.     id window;                // IB outlet
  33.     MiscString *frameName;    // name for frame of "window" to save in defaults
  34.     
  35.     BOOL nibIsLoaded;        // true if .nib has been loaded already
  36. }
  37.  
  38. // setting up and cleaning up the class
  39. + initialize;
  40. + startUnloading;
  41.  
  42. // setting the name of the .nib loaded by this class (or subclass)
  43. + setClassNib:(const char *)nibName;
  44. + (const char *)classNib;
  45.  
  46. // initializing and freeing
  47. - init;
  48. - initWithFrameName:(const char *)theFrameName;
  49. - free;
  50.  
  51. // archiving to a stream
  52. - awake;
  53. - read:(NXTypedStream *)strm;
  54. - write:(NXTypedStream *)strm;
  55.  
  56. // handling window's with (autosave) frame names automatically...
  57. - setFrameName:(const char *)theFrameName;
  58. - (const char *)frameName;
  59.  
  60. // the main outlet set when the .nib is loaded is "window"
  61. - window;
  62. - window:(BOOL)loadFlag;
  63. - showWindow:sender;
  64.  
  65. // the core methods which do all the interesting work
  66. - loadNibIfNeeded;
  67. - loadNib:(const char *)name withOwner:owner fromBundle:(NXBundle *)bundle;
  68.  
  69. // cover methods:  (are any of these actually useful?)
  70. - loadNib;
  71. - loadNib:(const char *)name;
  72. - loadNib:(const char *)name withOwner:owner;
  73. - loadNib:(const char *)name fromBundle:bundle;
  74.  
  75. // Override these to hook into the guts of operations...be sure to call super!
  76. - nibWillLoad;
  77. - nibDidLoad;
  78.  
  79. @end
  80.  
  81.