home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2 / Openstep-4.2-Intel-Developer.iso / NextLibrary / Frameworks / AppKit.framework / Versions / B / Headers / NSColorPicking.h < prev    next >
Text File  |  1996-10-17  |  2KB  |  65 lines

  1. /*
  2.     NSColorPicking.h
  3.     Application Kit
  4.     Copyright (c) 1994-1996, NeXT Software, Inc.
  5.     All rights reserved.
  6. */
  7.  
  8.  
  9. #import <Foundation/NSObject.h>
  10.  
  11. @class NSColorList;
  12. @class NSColor;
  13. @class NSButtonCell;
  14. @class NSColorPanel;
  15. @class NSImage;
  16. @class NSView;
  17.  
  18. @protocol NSColorPickingDefault
  19.  
  20. // The following methods are implemented by the generic base class:
  21. // NSColorPicker, and only need be implemented (overridden) by the CustomPicker
  22. // developer if there is a need.
  23.  
  24. // "mask" is the mask (if any) passed to the ColorPanel by the
  25. // + setPickerMask: method.  If your picker supports any of the bits in
  26. // the mask, return "self", otherwise, return "nil" (default is "self" if not
  27. // overridden, since if the "setPickerMask" method is never called, the
  28. // ColorPanel will just start off with the normal picker modes, of which
  29. // your custom mode will not be a part). This method can be used to turn
  30. // off some (or all) of your subpickers, if you have any (like sliders).
  31. // If this method returns "nil", the object will be freed.
  32. // 
  33. // "owningColorPanel" is the id of the instantiating ColorPanel.  
  34. // if this method is overridden, the base class' (NSColorPicker's) 
  35. // initFromPickerMask method should be called before any subclass processing.
  36. // The instance variable "colorPanel" is set in this method.
  37. // FOR PERFORMANCE, DO NOT LOAD .NIBS, ETC. HERE!!  WAIT 'TILL PROVIDENEWVIEW!
  38. - (id)initWithPickerMask:(int)mask colorPanel:(NSColorPanel *)owningColorPanel;
  39. - (NSImage *)provideNewButtonImage;
  40. - (void)insertNewButtonImage:(NSImage *)newButtonImage in:(NSButtonCell *)buttonCell;
  41. - (void)viewSizeChanged:(id)sender;
  42. - (void)alphaControlAddedOrRemoved:(id)sender;
  43. - (void)attachColorList:(NSColorList *)colorList;
  44. - (void)detachColorList:(NSColorList *)colorList;
  45. - (void)setMode:(int)mode;   
  46.  
  47. @end
  48.  
  49.  
  50.  
  51. @protocol NSColorPickingCustom
  52.  
  53. // These methods *MUST* be implemented by the CustomPicker, or an error
  54. // will occur!
  55.  
  56. // Return No if "mode" not supported.
  57. - (BOOL)supportsMode:(int)mode;   
  58. - (int)currentMode;
  59. // "Yes" on very first call (load your .nibs etc when "YES").
  60. - (NSView *)provideNewView:(BOOL)initialRequest;  // "Yes" on very first call.
  61. - (void)setColor:(NSColor *)newColor;
  62.  
  63. @end
  64.  
  65.