home *** CD-ROM | disk | FTP | other *** search
- /*
- NXColorList.h
- Application Kit, Release 3.0
- Copyright (c) 1988, 1989, 1990, 1991 NeXT, Inc. All rights reserved.
- */
-
- #import <Foundation/NSObject.h>
- #import <objc/List.h>
- #import "NSColor.h"
-
- @interface NSColorList : NSObject
- {
- @private
- char *_name;
- char *_printerType;
- char *_fileName;
- id _hashTable;
- id _colors;
- id _delegate;
- id _editor;
- struct _colorListFlags {
- unsigned int colorsLoaded:1;
- unsigned int editable:1;
- unsigned int hasDeviceSpecificLists:1;
- unsigned int generatesNamedColors:1;
- unsigned int dirty:1;
- unsigned int hasFrozen:1;
- unsigned int :0;
- } _flags;
- id _localNames;
- unsigned _reserved[3];
- }
-
- + (NSArray *)availableColorLists;
- + colorListNamed:(NSString *)name;
-
- - initWithName:(NSString *)name;
- - initWithName:(NSString *)name fromFile:(NSString *)path;
-
- - (NSString *)name;
-
- /* If key already exists, sets the corresponding color. Otherwise inserts the color at the end.
- */
- - (void)setColor:(NSColor *)color forKey:(NSString *)colorName;
-
- /* 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.
- */
- - (void)insertColor:(NSColor *)color key:(NSString *)key atIndex:(unsigned)loc;
-
- /* No-op if key doesn't exist.
- */
- - (void)removeColorWithKey:(NSString *)colorName;
-
- /* Returns nil if key doesn't exist.
- */
- - (NSColor *)colorWithKey:(NSString *)colorName;
-
- /* Use this array to get count of colors and enumerate them according to the ordering specified when inserting.
- */
- - (NSArray *)allKeys;
-
- /* Depends on the source of the colorlist file
- */
- - (BOOL)isEditable;
-
- /* Use "nil" to save to the user's private colorlists directory.
- */
- - (BOOL)writeToFile:(NSString *)path;
-
- /* Removes the corresponding file in user's private colorlists directory.
- */
- - (void)removeFile;
-
- @end
-
- /* Notifications */
- extern NSString *NSColorListDidChangeNotification;
-
-
-