home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / OpenStepConversion / IntermediateFrameworks3 / AppKit.framework / Headers / NSColorList.h < prev    next >
Text File  |  1995-12-21  |  2KB  |  80 lines

  1. /*
  2.     NXColorList.h
  3.     Application Kit, Release 3.0
  4.     Copyright (c) 1988, 1989, 1990, 1991 NeXT, Inc.  All rights reserved. 
  5. */
  6.  
  7. #import <Foundation/NSObject.h>
  8. #import <objc/List.h>
  9. #import "NSColor.h"
  10.  
  11. @interface NSColorList : NSObject
  12. {
  13. @private
  14.     char *_name;
  15.     char *_printerType;
  16.     char *_fileName;
  17.     id _hashTable;
  18.     id _colors;
  19.     id _delegate;
  20.     id _editor;
  21.     struct _colorListFlags {
  22.     unsigned int colorsLoaded:1;
  23.     unsigned int editable:1;
  24.     unsigned int hasDeviceSpecificLists:1;
  25.     unsigned int generatesNamedColors:1;
  26.     unsigned int dirty:1;
  27.     unsigned int hasFrozen:1;
  28.     unsigned int :0;
  29.     } _flags;
  30.     id _localNames;
  31.     unsigned _reserved[3];
  32. }
  33.  
  34. + (NSArray *)availableColorLists;
  35. + colorListNamed:(NSString *)name;
  36.  
  37. - initWithName:(NSString *)name;
  38. - initWithName:(NSString *)name fromFile:(NSString *)path;
  39.  
  40. - (NSString *)name;
  41.  
  42. /* If key already exists, sets the corresponding color. Otherwise inserts the color at the end.
  43. */
  44. - (void)setColor:(NSColor *)color forKey:(NSString *)colorName;
  45.  
  46. /* Inserts color at the specified location. If a color by the same key is already in the list but at a different location it is removed from there.
  47. */
  48. - (void)insertColor:(NSColor *)color key:(NSString *)key atIndex:(unsigned)loc;
  49.  
  50. /* No-op if key doesn't exist.
  51. */
  52. - (void)removeColorWithKey:(NSString *)colorName;
  53.  
  54. /* Returns nil if key doesn't exist.
  55. */
  56. - (NSColor *)colorWithKey:(NSString *)colorName;
  57.  
  58. /* Use this array to get count of colors and enumerate them according to the ordering specified when inserting.
  59. */
  60. - (NSArray *)allKeys;
  61.  
  62. /* Depends on the source of the colorlist file
  63. */
  64. - (BOOL)isEditable;
  65.  
  66. /* Use "nil" to save to the user's private colorlists directory.
  67. */
  68. - (BOOL)writeToFile:(NSString *)path;    
  69.  
  70. /* Removes the corresponding file in user's private colorlists directory.
  71. */
  72. - (void)removeFile;    
  73.  
  74. @end
  75.  
  76. /* Notifications */
  77. extern NSString *NSColorListDidChangeNotification;
  78.  
  79.  
  80.