home *** CD-ROM | disk | FTP | other *** search
/ OpenStep (Enterprise) / OpenStepENTCD.toast / OEDEV / EODEV.Z / EOModelerEditor.h < prev    next >
Encoding:
Text File  |  1996-09-09  |  3.0 KB  |  83 lines

  1. // EOModelerEditor.h
  2. // Copyright (c) 1995, NeXT Software, Inc. All rights reserved. 
  3.  
  4. #import <EOInterface/EOInterface.h>
  5.  
  6. @class EOModelerDocument;
  7.  
  8. @interface EOModelerEditor : NSObject
  9. {
  10.     EOModelerDocument *_document;
  11. }
  12. - initWithDocument:(EOModelerDocument *)document;
  13.  
  14. - (EOModelerDocument *)document;
  15.  
  16. // Must be implemented by subclasses:
  17. - (void)setSelectionPath:(NSArray *)newSelection;
  18. - (NSArray *)selectionPath;
  19.     // An array of model objects making up the selection, starting with the EOModel.
  20.     // The final element of the array will itself be an array (to support multiple
  21.     // selection).  E.g.: (EOModel, EOEntity, EORelationship, (EOAttribute, EOAttribute))
  22.     // or (EOModel, (EOEntity)).
  23.     // Sublclasses must override these methods.
  24.  
  25. - (void)activate;
  26.     // this editor should become active
  27. @end
  28.  
  29. @class EOModelerEmbedibleEditor;
  30.  
  31. @interface EOModelerCompoundEditor : EOModelerEditor
  32. {
  33.     NSMutableArray *_editors;
  34.     EOModelerEmbedibleEditor *_activeEditor;
  35.     NSArray *_viewedObjectPath;
  36.     NSArray *_selectionWithinViewedObject;
  37. }
  38. - (EOModelerEmbedibleEditor *)activeEditor;
  39. - (void)activateEditorWithClass:(Class)embedibleEditorClass;
  40.    // finds existing registered editor with given class if it exists, or
  41.    // creates it and registers it.  Then activates it.
  42. - (void)registerEmbedibleEditor:(EOModelerEmbedibleEditor *)editor;
  43. - (void)activateEmbededEditor:(EOModelerEmbedibleEditor *)editor;
  44.  
  45. - (NSArray *)viewedObjectPath;
  46. - (void)setViewedObjectPath:(NSArray *)newSelection;
  47.     // returns selelection path for currently viewed object.
  48.     // E.g. if panel is showing all entities, viewedObjectPath return (<EOModel>)
  49.     // regardless of whether an entity is selected.
  50.     // Cleans the selectionWithinViewedObject.
  51. - (NSArray *)selectionWithinViewedObject;
  52. - (void)setSelectionWithinViewedObject:(NSArray *)newSelection;
  53.     // just the selection for the current viewed object.  E.g. in the example
  54.     // above, this would return an array of 0 or more entities.
  55. - (NSArray *)selectionPath;
  56.     // concatenation of the viewedObjectPath and the selectionWithinViewedObject.
  57. - (void)setSelectionPath:(NSArray *)newSelection;
  58.     // sets the setViewedObjectPath to the first n-1 elements of the array, and the
  59.     // selectionWithinViewedObject to the last
  60. - (void)viewSelectedObject;
  61.     // makes the currently selected object into the viewed object
  62.  
  63. @end
  64.  
  65.  
  66. @interface EOModelerEmbedibleEditor : EOModelerEditor
  67. {
  68.     EOModelerCompoundEditor *_parentEditor;
  69. }
  70. - initWithParentEditor:(EOModelerCompoundEditor *)parentEditor;
  71. - (EOModelerCompoundEditor *)parentEditor;
  72.  
  73. - (void)selectionDidChange:(NSNotification *)notification;
  74.     // called when parent editor broadcasts selectionDidChange notification.
  75.     // default implementation calls [self active] if this editor is active
  76.  
  77. // Must be implemented by subclasses
  78. - (NSView *)mainView;
  79.     // the view to map into the compound editor when this editor is active
  80. - (BOOL)wantsIconPath;
  81.     // whether this editor wants the icon path visible
  82. @end
  83.