DrawKit
Vector and illustration framework for Mac OS X
Instance Methods | Class Methods | List of all members
DKCategoryManager Class Reference

The cat manager supports a UI based on menu(s). More...

Inheritance diagram for DKCategoryManager:
Inheritance graph
[legend]

Instance Methods

(void) - addCategories:
 Create a new categories with the given names. More...
 
(void) - addCategory:
 Create a new category with the given name. More...
 
(void) - addDefaultCategories
 Add the default categories defined for this class or object. More...
 
(void) - addKey:toCategories:createCategories:
 Adds a new key to several categories, optionally creating any if necessary. More...
 
(void) - addKey:toCategory:createCategory:
 Adds a new key to a category, optionally creating it if necessary. More...
 
(BOOL- addKey:toRecentList:
 Add a key to one of the 'recent' lists. More...
 
(void) - addObject:forKey:toCategories:createCategories:
 Add an object to the container, associating with a key and optionally a number of categories. More...
 
(void) - addObject:forKey:toCategory:createCategory:
 Add an object to the container, associating with a key and optionally a category. More...
 
(NSArray *) - allCategories
 Get a list of all categories. More...
 
(NSArray *) - allKeys
 
(NSArray *) - allKeysInCategories:
 Return all of the keys in all given categories. More...
 
(NSArray *) - allKeysInCategory:
 Return all of the keys in a given category. More...
 
(NSArray *) - allObjects
 Return all of the objects. More...
 
(NSArray *) - allSortedKeysInCategory:
 Return all of the keys in a given category, sorted into some useful order. More...
 
(NSArray *) - allSortedNamesInCategory:
 Return all of the names in a given category, sorted into some useful order. More...
 
(BOOL- appendContentsWithData:
 Retain all existing content, and load additional content from the archive data passed. More...
 
(NSArray *) - categoriesContainingKey:
 Get a list of all categories that contain a given key. More...
 
(NSArray *) - categoriesContainingKey:withSorting:
 
(NSMenu *) - categoriesMenuWithSelector:target:
 Creates a menu of categories, recent items and All Items. More...
 
(NSMenu *) - categoriesMenuWithSelector:target:options:
 Creates a menu of categories, recent items and All Items. More...
 
(BOOL- categoryExists:
 Test whether there is a category of the given name. More...
 
(void) - checkItemsInMenu:forCategoriesContainingKey:
 Sets the checkmarks in a menu of category names to reflect the presence of <key> in those categories. More...
 
(BOOL- containsKey:
 
(void) - copyItemsFromCategoryManager:
 Retain all existing content, and load additional content from the cat manager passed. More...
 
(NSUInteger- count
 Return total number of stored objects in container. More...
 
(NSUInteger- countOfCategories
 Get the count of all categories. More...
 
(NSUInteger- countOfObjectsInCategory:
 Count how many objects in the category of the given name. More...
 
(NSMenu *) - createMenuWithItemDelegate:isPopUpMenu:
 Creates a complete menu of the entire contents of the receiver, arranged by category. More...
 
(NSMenu *) - createMenuWithItemDelegate:itemTarget:itemAction:options:
 
(NSMenu *) - createMenuWithItemDelegate:options:
 
(NSData *) - data
 Archives the container to a data object (for saving, etc) More...
 
(NSData *) - dataWithFormat:
 
(NSArray *) - defaultCategories
 Return the default categories defined for this class or object. More...
 
(NSDictionary *) - dictionary
 Return a copy of the master dictionary. More...
 
(NSString *) - fileType
 Return the filetype (for saving, etc) More...
 
(void) - fixUpCategories
 Checks that all keys refer to real objects, removing any that do not. More...
 
(id- initWithData:
 Initialized a category manager object from archive data. More...
 
(id- initWithDictionary:
 Initialized a category manager object from an existing dictionary. More...
 
(BOOL- key:existsInCategory:
 Query whether a given key is present in a particular category. More...
 
(NSArray *) - keysForObject:
 Returns a list of all unique keys that refer to the given object. More...
 
(id- mergeObject:mergeDelegate:
 Asks delegate to make decision about the merging of an object. More...
 
(NSSet *) - mergeObjectsFromSet:inCategories:mergeOptions:mergeDelegate:
 Smartly merges objects into the category manager. More...
 
(id- objectForKey:
 Return the object for the given key, but do not remember it in the "recently used" list. More...
 
(id- objectForKey:addToRecentlyUsedItems:
 Return the object for the given key, optionally remembering it in the "recently used" list. More...
 
(NSArray *) - objectsInCategories:
 Return all of the objects belonging to the given categories. More...
 
(NSArray *) - objectsInCategory:
 Return all of the objects belonging to a given category. More...
 
(NSArray *) - recentlyAddedItems
 Return the list of recently added items. More...
 
(NSArray *) - recentlyUsedItems
 Return the list of recently used items. More...
 
(void) - removeAllCategories
 Removes all categories and objects from the CM. More...
 
(void) - removeAllObjects
 Removes all objects from the container. More...
 
(void) - removeCategory:
 Remove a category with the given name. More...
 
(void) - removeKey:fromCategories:
 Removes a key from a number of categories. More...
 
(void) - removeKey:fromCategory:
 Removes a key from a category. More...
 
(void) - removeKey:fromRecentList:
 Remove a key from one of the 'recent' lists. More...
 
(void) - removeKeyFromAllCategories:
 Removes a key from all categories. More...
 
(void) - removeMenu:
 Removes the menu from the list of managed menus. More...
 
(void) - removeObjectForKey:
 Remove an object from the container. More...
 
(void) - removeObjectsForKeys:
 Remove multiple objects from the container. More...
 
(void) - renameCategory:to:
 Change a category's name. More...
 
(void) - renameKey:to:
 Renames an object's key throughout. More...
 
(BOOL- replaceContentsWithData:
 Discard all existing content, then reload from the archive data passed. More...
 
(NSArray *) - reservedCategories
 Get a list of reserved categories - those that should not be deleted or renamed. More...
 
(void) - setRecentList:maxItems:
 Sets the maximum length of on eof the 'recent' lists. More...
 
(void) - setRecentlyAddedItems:
 Replaces the recently added items with new items, up to the current max. More...
 
(void) - setRecentlyAddedListEnabled:
 Set whether the "recent;y added" list accepts new items or not. More...
 
(void) - updateMenusForKey:
 Synchronises the menus to reflect any change of the object referenced by <key> More...
 
- Instance Methods inherited from NSObject
(NSString *) - address
 
(DKStyleRegistry *) - applicationWillReturnStyleRegistry
 
(BOOL- canBeUsedWithSelectionTool
 
(id- categoryManager:shouldReplaceObject:withObject:
 
(Class- classForCoder
 
(NSColor *) - colorValue
 
(NSColor *) - colourValue
 
(id- copy
 
(void) - dealloc
 
(id- deepCopy
 
(NSDictionary *) - dimensionValuesForArrowStroke:
 
(CGFloat- drawing:convertDistanceToExternalCoordinates:
 
(NSPoint) - drawing:convertLocationToExternalCoordinates:
 
(void) - drawing:didDrawRect:inView:
 
(void) - drawing:willDrawRect:inView:
 
(NSString *) - drawing:willReturnAbbreviationForUnit:
 
(NSString *) - drawing:willReturnFormattedCoordinateForDistance:
 
(CGFloat- drawingWillReturnUnitToPointsConversonFactor:
 
(void) - finalize
 
(NSString *) - hexString
 
(void) - hotspot:didEndTrackingWithEvent:inView:
 
(void) - hotspot:isTrackingWithEvent:inView:
 
(void) - hotspot:willBeginTrackingWithEvent:inView:
 
(NSData *) - imageData
 
(NSImage *) - imageResourceNamed:
 
(id- init
 
(id- initWithExpression:
 
(id- instantiateObjectWithShortName:parameters:
 
(BOOL- isLiteralValue
 
(void) - layoutManager:willPlaceGlyphAtIndex:atLocation:pathAngle:yOffset:
 
(void) - menuItem:wasAddedForObject:inCategory:
 
(BOOL- moveObjectTo:position:slope:userInfo:
 
(id- mutableCopy
 
(void) - oneShotComplete
 
(void) - oneShotHasReached:
 
(void) - oneShotWillBegin
 
(void) - path:elementIndex:type:points:subPathIndex:subPathClosed:contextInfo:
 
(id- placeLinkFromPoint:toPoint:onPath:linkNumber:userInfo:
 
(id- placeObjectAtPoint:onPath:position:slope:userInfo:
 
(NSPoint) - point
 
(NSPoint) - pointForTextLayout
 
(DKStyle *) - registry:shouldReplaceStyle:withStyle:
 
(NSBezierPath *) - renderer:willRenderPath:
 
(void) - routeFinder:progressHasReached:
 
(void) - setValue:forNumericParameter:
 
(NSString *) - stringValue
 
(CGFloat- taperFactorAtDistance:onPath:ofLength:
 
(void) - toolDidPerformUndoableAction:
 
(void) - toolWillPerformUndoableAction:
 
(NSURL *) - url
 
- Instance Methods inherited from <NSObject>
(NSString *) - description
 
(NSUInteger- hash
 
(BOOL- isEqual:
 
- Instance Methods inherited from <NSKeyValueBindingCreation>
(void) - bind:toObject:withKeyPath:options:
 
(NSArray *) - exposedBindings
 
(NSDictionary *) - infoForBinding:
 
(NSArray *) - optionDescriptionsForBinding:
 
(void) - unbind:
 
(Class- valueClassForBinding:
 
- Instance Methods inherited from <NSCoding>
(void) - encodeWithCoder:
 
(id- initWithCoder:
 
- Instance Methods inherited from <NSCopying>
(id- copyWithZone:
 

Class Methods

(DKCategoryManager *) + categoryManager
 Returns a new category manager object. More...
 
(NSString *) + categoryManagerKeyForObject:
 Given an object, return a key that can be used to store it in the category manager. More...
 
(DKCategoryManager *) + categoryManagerWithDictionary:
 Returns a new category manager object based on an existing dictionary. More...
 
(id+ dearchivingHelper
 
(NSArray *) + defaultCategories
 Return the default categories defined for this class. More...
 
(void) + setDearchivingHelper:
 
- Class Methods inherited from NSObject
(id+ alloc
 
(Class+ class
 
(void) + initialize
 
(void) + load
 
(id+ new
 
- Class Methods inherited from <NSKeyValueBindingCreation>
(void) + exposeBinding:
 

Detailed Description

The cat manager supports a UI based on menu(s).

The cat manager supports a UI based on menu(s). To assist, the DKCategoryManagerMenuInfo class is used to "own" a menu - the cat manager keeps a list of these.

When the CM is asked for a menu, this helper object is used to create and manage it. As the CM is used (items and categories added/removed) the menu helpers are informed of the changes and in turn update the menus to match by adding or deleting menu items. This is necessary because when the CM grows to a significant number of items, rebuilding the menus is very time-consuming. This way performance is much better.

Method Documentation

- (void) addCategories: (NSArray *)  catNames

Create a new categories with the given names.

Parameters
catNamesa list of the names of the new categories
- (void) addCategory: (NSString *)  catName

Create a new category with the given name.

If the name is already a category name, this does nothing

Parameters
catNamethe name of the new category
- (void) addDefaultCategories

Add the default categories defined for this class or object.

Is called as part of the initialisation of the CM object

- (void) addKey: (NSString *)  key
toCategories: (NSArray *)  catNames
createCategories: (BOOL cg 

Adds a new key to several categories, optionally creating any if necessary.

Parameters
keythe key to add
catNamesa list of categories to add it to
cgYES to create the category if it doesn't exist, NO otherwise
- (void) addKey: (NSString *)  key
toCategory: (NSString *)  catName
createCategory: (BOOL cg 

Adds a new key to a category, optionally creating it if necessary.

Parameters
keythe key to add
catNamethe category to add it to
cgYES to create the category if it doesn't exist, NO otherwise
- (BOOL) addKey: (NSString *)  key
toRecentList: (NSInteger whichList 

Add a key to one of the 'recent' lists.

Acceptable list IDs are kDKListRecentlyAdded and kDKListRecentlyUsed

Parameters
keythe key to add
whichListan identifier for the list in question
Returns
return YES if the key was added, otherwise NO (i.e. if list already contains item)
- (void) addObject: (id obj
forKey: (NSString *)  name
toCategories: (NSArray *)  catNames
createCategories: (BOOL cg 

Add an object to the container, associating with a key and optionally a number of categories.

<obj> and <name> cannot be nil. All objects are added to the default category regardless of <catNames>

Parameters
objthe object to add
namethe object's key
catNamesthe names of the categories to add it to, or nil for defaults
cgYES to create the categories if they don't exist. NO not to do so
- (void) addObject: (id obj
forKey: (NSString *)  name
toCategory: (NSString *)  catName
createCategory: (BOOL cg 

Add an object to the container, associating with a key and optionally a category.

<obj> and <name> cannot be nil. All objects are added to the default category regardless of <catName>

Parameters
objthe object to add
namethe object's key
catNamethe name of the category to add it to, or nil for defaults only
cgYES to create the category if it doesn't exist. NO not to do so
- (NSArray*) allCategories

Get a list of all categories.

The list is alphabetically sorted for the convenience of a user interface

Returns
an array containg a list of all category names
- (NSArray*) allKeys
- (NSArray*) allKeysInCategories: (NSArray *)  catNames

Return all of the keys in all given categories.

Returned objects are in no particular order.

Parameters
catNamesan array of category names
Returns
an array, the union of keys in listed categories. May be empty.
- (NSArray*) allKeysInCategory: (NSString *)  catName

Return all of the keys in a given category.

Returned objects are in no particular order. This also treats the "recently used" and "recently added" items as pseudo-category names, returning these arrays if the catName matches.

Parameters
catNamethe category name
Returns
an array, the list of keys indicated by the category. May be empty.Return all of the keys

Returned objects are in no particular order. The keys are obtained by enumerating the categories because the master list contains case-modified keys that may not be matched with categories.

Returns
an array, all keys (listed only once)
- (NSArray*) allObjects

Return all of the objects.

Returns
an array, all objects (listed only once, in arbitrary order)
- (NSArray*) allSortedKeysInCategory: (NSString *)  catName

Return all of the keys in a given category, sorted into some useful order.

By default the keys are sorted alphabetically. The UI-building methods call this, so a subclass can override it and return keys sorted by some other criteria if required.

Parameters
catNamethe category name
Returns
an array, the list of keys indicated by the category. May be empty.
- (NSArray*) allSortedNamesInCategory: (NSString *)  catName

Return all of the names in a given category, sorted into some useful order.

For an ordinary DKCategoryManager, names == keys. However, subclasses may store keys in some other fashion (hint: they do) and so another method is needed to convert keys to names. Those subclasses must override this and do what's appropriate.

Parameters
catNamethe category name
Returns
an array, the list of names indicated by the category. May be empty.
- (BOOL) appendContentsWithData: (NSData *)  data

Retain all existing content, and load additional content from the archive data passed.

Because at this level DKCategoryManager has no knowledge of the objects it is storing, it has no means to be smart about merging objects that are the same in some higher abstract way. Thus it's entirely possible to end up with multiple copies of the "same" object after this operation. Subclasses may prefer to do something smarter. Note however that duplicate categories are not created.

Parameters
datadata, being an archive earlier obtained using -data
Returns
YES if the archive could be read, NO otherwise
- (NSArray*) categoriesContainingKey: (NSString *)  key

Get a list of all categories that contain a given key.

The list is alphabetically sorted for the convenience of a user interface

Parameters
keythe key in question
Returns
an array containing a list of categories which contain the key
- (NSArray*) categoriesContainingKey: (NSString *)  key
withSorting: (BOOL sortIt 
- (NSMenu*) categoriesMenuWithSelector: (SEL sel
target: (id target 

Creates a menu of categories, recent items and All Items.

Sel and target may be nil

Parameters
selthe selector which is set as the action for each added item
targetthe target of category item actions
Returns
a menu populated with category and other names
- (NSMenu*) categoriesMenuWithSelector: (SEL sel
target: (id target
options: (NSInteger options 

Creates a menu of categories, recent items and All Items.

Sel and target may be nil, options may be 0

Parameters
selthe selector which is set as the action for each category item
targetthe target of category item actions
optionsvarious flags which set which items are added
Returns
a menu populated with category and other names
- (BOOL) categoryExists: (NSString *)  catName

Test whether there is a category of the given name.

Parameters
catNamethe category name
Returns
YES if a category exists with the name, NO otherwise
+ (DKCategoryManager*) categoryManager

Returns a new category manager object.

Convenience method. Initial categories only consist of "All Items"

Returns
a category manager object
+ (NSString*) categoryManagerKeyForObject: (id obj

Given an object, return a key that can be used to store it in the category manager.

Subclasses will need to define this differently - used for merging.

Parameters
objan object
Returns
a key string
+ (DKCategoryManager*) categoryManagerWithDictionary: (NSDictionary *)  dict

Returns a new category manager object based on an existing dictionary.

Convenience method. Initial categories only consist of "All Items"

Parameters
dictan existign dictionary
Returns
a category manager object
- (void) checkItemsInMenu: (NSMenu *)  menu
forCategoriesContainingKey: (NSString *)  key 

Sets the checkmarks in a menu of category names to reflect the presence of <key> in those categories.

Assumes that item names will be the category names. For localized names, you should handle the localization external to this class so that both category names and menu items use the same strings.

Parameters
menuthe menu to examine
keythe key to test against
- (BOOL) containsKey: (NSString *)  name
- (void) copyItemsFromCategoryManager: (DKCategoryManager *)  cm

Retain all existing content, and load additional content from the cat manager passed.

Categories not present in the receiver but exist in <cm> are created, and objects present in <cm> are added to the receiver if not already present (as determined solely by address). This method disables the "recently added" list while it adds the items.

Parameters
cma category manager object
- (NSUInteger) count

Return total number of stored objects in container.

Returns
the number of objects
- (NSUInteger) countOfCategories

Get the count of all categories.

Returns
the number of categories currently defined
- (NSUInteger) countOfObjectsInCategory: (NSString *)  catName

Count how many objects in the category of the given name.

Parameters
catNamethe category name
Returns
the number of objects in the category
- (NSMenu*) createMenuWithItemDelegate: (id del
isPopUpMenu: (BOOL isPopUp 

Creates a complete menu of the entire contents of the receiver, arranged by category.

The menu returned lists the categories, each of which is a submenu containing the actual objects corresponding to the category contents. It also populates a recent items and added items submenu. the callback object needs to set up the menu item based on the object itself. The object is added automatically as the menu item's represented object. This is one easy way to create a simple UI to the cat manager, where you can simply pick an item from the menu. Note that the returned menu is fully managed - as objects are added and removed the menu will be directly managed to keep in synch. Thus the client code does not need to bother doing this just to keep the menus up to date. The menu updating is done very efficiently for performance. If the content of a menu item needs to change, call -updateMenusForKey: for the object key in question. When the client is dealloc'd, it should call -removeMenu: for any menus it obtained using this, so that stale references to the callback object are cleared out.

Parameters
idan object that is called back with each menu item created (may be nil)
isPopUpset YES if menu is destined for use as a popup (adds extra zeroth item)
Returns
a menu object
- (NSMenu*) createMenuWithItemDelegate: (id del
itemTarget: (id target
itemAction: (SEL action
options: (DKCategoryMenuOptions)  options 
- (NSMenu*) createMenuWithItemDelegate: (id del
options: (DKCategoryMenuOptions)  options 
- (NSData*) data

Archives the container to a data object (for saving, etc)

Returns
a data object, the archive of the container
- (NSData*) dataWithFormat: (NSPropertyListFormat)  format
+ (id) dearchivingHelper
- (NSArray*) defaultCategories

Return the default categories defined for this class or object.

Returns
an array of categories
+ (NSArray*) defaultCategories

Return the default categories defined for this class.

Returns
an array of categories
- (NSDictionary*) dictionary

Return a copy of the master dictionary.

Returns
the main dictionary
- (NSString*) fileType

Return the filetype (for saving, etc)

Subclasses should override to change the filetype used for specific examples of this object

- (void) fixUpCategories

Checks that all keys refer to real objects, removing any that do not.

Rarely needed, but can correct for corrupted registries where objects got removed but not all keys that refer to it did for some reason (such as an exception).

- (id) initWithData: (NSData *)  data

Initialized a category manager object from archive data.

Data is permitted also to be an archived dictionary

Parameters
datadata containing a correctly archived category manager
Returns
the category manager object
- (id) initWithDictionary: (NSDictionary *)  dict

Initialized a category manager object from an existing dictionary.

No categories other than "All Items" are created by default. The recently added list is empty.

Parameters
dictdictionary containing a set of objects and keys
Returns
the category manager object
- (BOOL) key: (NSString *)  key
existsInCategory: (NSString *)  catName 

Query whether a given key is present in a particular category.

Parameters
keythe key
catNamethe category name
Returns
YES if the category contains <key>, NO if it doesn't
- (NSArray*) keysForObject: (id obj

Returns a list of all unique keys that refer to the given object.

The result may contain no keys if the object is unknown

Parameters
objthe object
Returns
an array, listing all the unique keys that refer to the object.
- (id) mergeObject: (id obj
mergeDelegate: (id aDelegate 

Asks delegate to make decision about the merging of an object.

Subclasses must override this to make use of it. Returning nil means use existing object.

Parameters
objthe object to consider
aDelegatethe delegate to ask
Returns
an equivalent object or nil. May be the supplied object or another having an identical ID.
- (NSSet*) mergeObjectsFromSet: (NSSet *)  aSet
inCategories: (NSArray *)  categories
mergeOptions: (DKCatManagerMergeOptions)  options
mergeDelegate: (id aDelegate 

Smartly merges objects into the category manager.

Parameters
aSeta set of objects of the same kind as the current contents
categoriesan optional list of categories to add th eobjects to. Categories will be created if needed.
optionsreplacxement options. Delegate may override these.
adelegatean optional delegate that can be asked to make decisions about which objects get replaced.
Returns
a set, possibly empty. The set contains those objects that already existed in the CM that should replace equivalent items in the supplied set.
- (id) objectForKey: (NSString *)  key

Return the object for the given key, but do not remember it in the "recently used" list.

Parameters
keythe object's key
Returns
the object if available, else nil
- (id) objectForKey: (NSString *)  key
addToRecentlyUsedItems: (BOOL add 

Return the object for the given key, optionally remembering it in the "recently used" list.

Use this method when you wish this access of the object to result in it being added to "recently used"

Parameters
keythe object's key
addif YES, object's key is added to recently used items
Returns
the object if available, else nil
- (NSArray*) objectsInCategories: (NSArray *)  catNames

Return all of the objects belonging to the given categories.

Returned objects are in no particular order, but do match the key order obtained by -allKeysInCategories:. Should any key not exist (which should never normally occur), the entry will be represented by a NSNull object

Parameters
catNameslist of categories
Returns
an array, the list of objects indicated by the categories. May be empty.
- (NSArray*) objectsInCategory: (NSString *)  catName

Return all of the objects belonging to a given category.

Returned objects are in no particular order, but do match the key order obtained by -allkeysInCategory. Should any key not exist (which should never normally occur), the entry will be represented by a NSNull object

Parameters
catNamethe category name
Returns
an array, the list of objects indicated by the category. May be empty.
- (NSArray*) recentlyAddedItems

Return the list of recently added items.

Returned objects are in order of addition, most recent first.

Returns
an array, the list of keys recently added.
- (NSArray*) recentlyUsedItems

Return the list of recently used items.

Returned objects are in order of use, most recent first.

Returns
an array, the list of keys recently used.
- (void) removeAllCategories

Removes all categories and objects from the CM.

After this the CM is entirely empty.

- (void) removeAllObjects

Removes all objects from the container.

Does not remove the categories, but leaves them all empty.

- (void) removeCategory: (NSString *)  catName

Remove a category with the given name.

The objects listed in the category are not removed, as they may also be listed by other categories. If they are not, they can become orphaned however. To avoid this, never delete the "All Items" category.

Parameters
catNamethe category to remove
- (void) removeKey: (NSString *)  key
fromCategories: (NSArray *)  catNames 

Removes a key from a number of categories.

Parameters
keythe key to remove
catNamesthe list of categories to remove it from
- (void) removeKey: (NSString *)  key
fromCategory: (NSString *)  catName 

Removes a key from a category.

Parameters
keythe key to remove
catNamethe category to remove it from
- (void) removeKey: (NSString *)  key
fromRecentList: (NSInteger whichList 

Remove a key from one of the 'recent' lists.

Acceptable list IDs are kDKListRecentlyAdded and kDKListRecentlyUsed

Parameters
keythe key to remove
whichListan identifier for the list in question
- (void) removeKeyFromAllCategories: (NSString *)  key

Removes a key from all categories.

Parameters
keythe key to remove
- (void) removeMenu: (NSMenu *)  menu

Removes the menu from the list of managed menus.

An object using a menu created by the category manager must remove it from management when it is no longer needed as a stale reference can cause a crash.

Parameters
menua menu managed by this object
- (void) removeObjectForKey: (NSString *)  key

Remove an object from the container.

After this the key will not be found in any category or either list

Parameters
keythe object's key
- (void) removeObjectsForKeys: (NSArray *)  keys

Remove multiple objects from the container.

After this no keys will not be found in any category or either list

Parameters
keysa list of keys
- (void) renameCategory: (NSString *)  catName
to: (NSString *)  newname 

Change a category's name.

If <newname> already exists, it will be replaced by the entries in <catname>

Parameters
catNamethe category's old name
newnamethe category's new name
- (void) renameKey: (NSString *)  key
to: (NSString *)  newKey 

Renames an object's key throughout.

If <key> doesn't exist, or if <newkey> already exists, throws an exception. After this the same object that could be located using <key> can be located using <newKey> in the same categories as it appeared in originally.

Parameters
keythe existing key
newKeythe new key
- (BOOL) replaceContentsWithData: (NSData *)  data

Discard all existing content, then reload from the archive data passed.

Parameters
datadata, being an archive earlier obtained using -data
Returns
YES if the archive could be read, NO otherwise
- (NSArray*) reservedCategories

Get a list of reserved categories - those that should not be deleted or renamed.

This list is advisory - a UI is responsible for honouring it, the cat manager itself ignores it. The default implementation returns the same as the default categories, thus reserving all default cats. Subclasses can change this as they wish.

Returns
an array containing a list of the reserved categories
+ (void) setDearchivingHelper: (id helper
- (void) setRecentList: (NSInteger whichList
maxItems: (NSUInteger max 

Sets the maximum length of on eof the 'recent' lists.

Acceptable list IDs are kDKListRecentlyAdded and kDKListRecentlyUsed

Parameters
whichListan identifier for the list in question
maxthe maximum length to which a list may grow
- (void) setRecentlyAddedItems: (NSArray *)  array

Replaces the recently added items with new items, up to the current max.

Parameters
arrayan array of suitable objects
- (void) setRecentlyAddedListEnabled: (BOOL enable

Set whether the "recent;y added" list accepts new items or not.

This allows the recently added items to be temporarily disabled when bulk adding items to the manager. By default the recently added items list is enabled.

Parameters
enableYES to allow new items to be added, NO otherwise
- (void) updateMenusForKey: (NSString *)  key

Synchronises the menus to reflect any change of the object referenced by <key>

Any change to a stored object that affects the menus' appearance can be handled by calling this. this only changes the menu items that represent the object, and not the entire menu, so is an efficient way to keep menus up to date with changes.

Parameters
keyan object's key