home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc / Developer Documentation / Recipes, Tech Notes & Articles / Tech Notes / Utilities Documentation / Editor Set Utilities < prev    next >
Encoding:
Text File  |  1996-07-16  |  2.5 KB  |  86 lines  |  [TEXT/ttxt]

  1. OpenDocâ„¢ Utilities Documentation
  2.  
  3. Editor Set Utilities
  4. by The OpenDoc Design Team
  5.  
  6. © 1993-1996  Apple Computer, Inc. All Rights Reserved.
  7. Apple, the Apple logo, and Macintosh are registered trademarks of Apple Computer, Inc.
  8. Mac and OpenDoc are trademarks of Apple Computer, Inc.
  9.  
  10.  
  11. Introduction
  12.  
  13. The Editor Set Utilities provide a C++ collection and iterator for storing ODEditors.
  14.  
  15.  
  16. EditorSet
  17.  
  18. The EditorSet class implements a collection of ODEditors.  It is implemented using OrderedCollection, documented
  19. elsewhere in this folder.
  20.  
  21. Constructors and Destructors
  22.  
  23.     EditorSet();
  24.         // Constructs an empty EditorSet
  25.  
  26.     ~EditorSet();
  27.         // Destructs the collection, deleting the links, but not the ODEditors themselves.
  28.     
  29.  
  30. Initialization
  31.  
  32.     void InitEditorSet(); 
  33.         // Allocates a new OrderedCollection to hold the ODEditors.  You can use this method (with RemoveAllEditors)
  34. to resuse existing EditorSets where it's inconvenient to create them from scratch each time.
  35.  
  36. Adding and removing elements
  37.  
  38.     void AddEditor(ODEditor editor); 
  39.         // Adds an editor to the collection.
  40.  
  41.     void AddEditorSet(EditorSet* editors); 
  42.         // Adds one set to another, producing a union of the two (no duplicates).
  43.  
  44.     void RemoveEditor(ODEditor editor);
  45.         // Removes the specified editor from the collection.
  46.  
  47.     void RemoveEditor(EditorSet* editors);
  48.         // Removes all editors in the set passed in.  This method should probably be named
  49. RemoveEditorSet.  Note that if you call AddEditorSet and then RemoveEditorSet with the same
  50. parameter you will be left with a smaller collection than you began with if the two sets
  51. had any editors in common before the call to AddEditorSet.
  52.  
  53.     void RemoveAllEditors();
  54.         // Removes all editors, leaving the EditorSet empty but ready to accept additions.
  55.  
  56. Accessing elements
  57.  
  58.     ODBoolean    ContainsEditor(ODEditor editor); 
  59.         // Returns true if the editor is in the EditorSet.
  60.  
  61.     ODULong    GetEditorCount();
  62.         // Returns the number of editors in the EditorSet.
  63.         
  64.     EditorSetIterator*    CreateIterator();    
  65.         // Returns a new EditorSetIterator that can be used to iterate over the EditorSet.
  66.  
  67. EditorSetIterator
  68.  
  69. This class iterates over an EditorSet.  It is imlemented using OrderedCollectionIterator.
  70.  
  71.     EditorSetIterator(EditorSet* set);     
  72.         // Constructor
  73.  
  74.     ~EditorSetIterator();     
  75.         // Destructor
  76.  
  77.     ODEditor First();        
  78.         // Returns (duh) the first editor.
  79.         
  80.     ODEditor Next();        
  81.         // Returns the next editor (i.e. the first among those not yet visited).
  82.         
  83.     ODBoolean IsNotComplete();        
  84.         // returns true if there remain editors not yet retreived with Next() or First().
  85.         
  86.