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

  1. // EOModelerDocument.h
  2. // Copyright (c) 1995, NeXT Software, Inc. All rights reserved. 
  3.  
  4. #import <EOInterface/EOInterface.h>
  5. #import <EOAccess/EOAccess.h>
  6.  
  7. @class EOModelerEditor;
  8.  
  9. @interface EOModelerDocument : NSObject
  10. {
  11.     EOModel *_model;
  12.     EOEditingContext *_editingContext;
  13.     NSMutableArray *_editors;
  14. }
  15.  
  16. - initWithModel:(EOModel *)model;
  17.  
  18. // Model
  19. - (EOModel *)model;
  20. - (EOEditingContext *)editingContext;
  21.  
  22. - (BOOL)isDirty;
  23. - (BOOL)prepareToSave;
  24.     // returns NO if save should be aborted (e.g. failed consistency check)
  25. - (NSString *)documentPath;
  26. - (BOOL)saveToPath:(NSString *)path;
  27.     // programmatic saveAs
  28. - (BOOL)checkCloseDocument;
  29.     // try to close.  Returns NO if user refuses.
  30. - (void)activate;
  31.     // called to make the doc active (e.g. order its main editor to front)
  32.  
  33. // Editors
  34. - (NSArray *)editors;
  35. - (void)addEditor:(EOModelerEditor *)editor;
  36. - (void)closeEditor:(EOModelerEditor *)editor;
  37. - (BOOL)checkCloseEditor:(EOModelerEditor *)editor;
  38.     // returns NO if the editor should not be allowed to close
  39. - (EOModelerEditor *)addDefaultEditor;
  40.     // creates a fresh instance of the default editor and adds it
  41.  
  42. // Only works if the current currentEditor is in the document
  43. - (void)addEntity:(id)sender;
  44. - (void)addAttribute:(id)sender;
  45. - (void)addRelationship:(id)sender;
  46. - (void)addStoredProcedure:(id)sender;
  47. - (void)addArgument:(id)sender;
  48.  
  49. // when all editors are removed, the document will close
  50. // Target/action
  51. - (void)save:(id)sender;
  52. - (void)saveAs:(id)sender;
  53. - (void)revertToSaved:(id)sender;
  54. - (void)close:(id)sender;
  55.  
  56. //
  57. // Callbacks used by client consistency checking extensions
  58. //
  59. - (void)appendConsistencyCheckErrorText:(NSAttributedString *)errorText;
  60.     // Use this method from notification handlers for EOMCheckConsistencyForEntity, EOMCheckConsistencyForStoredProcedure, and EOMCheckConsistencyForModel
  61. - (void)appendConsistencyCheckSuccessText:(NSAttributedString *)successText;
  62.     // Use this method to report the consistency checks that succeeded. This should be called when you receive the EOMCheckConsistencyEnd notification
  63.  
  64. + (void)setDefaultEditorClass:(Class)editorClass;
  65. + (Class)defaultEditorClass;
  66.     // class of editor to assign to a newly created document
  67. @end
  68.  
  69.  
  70. // Notifications
  71. EOMODELER_EXTERN NSString *EOMDocumentWillSaveNotification;
  72. EOMODELER_EXTERN NSString *EOMDocumentDidSaveNotification;
  73. EOMODELER_EXTERN NSString *EOMDocumentDidOpenNotification;
  74. EOMODELER_EXTERN NSString *EOMCheckConsistencyBeginNotification;
  75. EOMODELER_EXTERN NSString *EOMCheckConsistencyEndNotification;
  76. EOMODELER_EXTERN NSString *EOMCheckConsistencyForEntityNotification;
  77. EOMODELER_EXTERN NSString *EOMCheckConsistencyForStoredProcedureNotification;
  78. EOMODELER_EXTERN NSString *EOMCheckConsistencyForModelNotification;
  79.  
  80. // key for model object in userInfo of notifications
  81. EOMODELER_EXTERN NSString *EOMConsistencyModelObjectKey;
  82.