2003-07-15 04:20:09 +00:00
|
|
|
/* GormDocument.h
|
|
|
|
*
|
|
|
|
* Copyright (C) 1999, 2003 Free Software Foundation, Inc.
|
|
|
|
*
|
|
|
|
* Author: Richard Frith-Macdonald <richard@brainstrom.co.uk>
|
|
|
|
* Author: Gregory John Casamento <greg_casamento@yahoo.com>
|
|
|
|
* Date: 1999, 2003
|
|
|
|
*
|
|
|
|
* This file is part of GNUstep.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
*/
|
2003-05-23 02:25:34 +00:00
|
|
|
|
2003-03-03 09:15:48 +00:00
|
|
|
#ifndef INCLUDED_GormDocument_h
|
|
|
|
#define INCLUDED_GormDocument_h
|
1999-12-08 15:04:57 +00:00
|
|
|
|
2003-05-23 02:25:34 +00:00
|
|
|
#include <AppKit/AppKit.h>
|
|
|
|
#include <Foundation/Foundation.h>
|
2003-08-01 03:20:43 +00:00
|
|
|
#include <GNUstepGUI/GSNibTemplates.h>
|
2003-05-23 02:25:34 +00:00
|
|
|
|
2004-03-24 20:44:23 +00:00
|
|
|
@class GormClassManager, GormClassEditor, GormObjectProxy;
|
2001-05-08 09:43:11 +00:00
|
|
|
|
1999-12-13 17:01:35 +00:00
|
|
|
/*
|
|
|
|
* Each document has a GormFirstResponder object that is used as a placeholder
|
|
|
|
* for the first responder at any instant.
|
|
|
|
*/
|
2004-03-22 04:20:17 +00:00
|
|
|
@interface GormFirstResponder : NSObject
|
1999-12-20 15:21:26 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
@end
|
1999-12-13 17:01:35 +00:00
|
|
|
|
1999-12-08 15:04:57 +00:00
|
|
|
@interface GormDocument : GSNibContainer <IBDocuments>
|
|
|
|
{
|
2001-05-08 09:43:11 +00:00
|
|
|
GormClassManager *classManager;
|
1999-12-13 17:01:35 +00:00
|
|
|
GormFilesOwner *filesOwner;
|
|
|
|
GormFirstResponder *firstResponder;
|
2004-03-24 20:44:23 +00:00
|
|
|
GormObjectProxy *fontManager;
|
2001-05-08 09:43:11 +00:00
|
|
|
GormClassEditor *classEditor; // perhaps should not be here...
|
1999-12-08 15:04:57 +00:00
|
|
|
NSString *documentPath;
|
|
|
|
NSMapTable *objToName;
|
1999-12-14 19:55:18 +00:00
|
|
|
NSWindow *window;
|
2004-05-20 02:34:03 +00:00
|
|
|
// NSMatrix *selectionView;
|
2001-05-08 09:43:11 +00:00
|
|
|
NSBox *selectionBox;
|
1999-12-14 19:55:18 +00:00
|
|
|
NSScrollView *scrollView;
|
2001-05-08 09:43:11 +00:00
|
|
|
NSScrollView *classesScrollView;
|
2002-11-04 13:52:31 +00:00
|
|
|
NSScrollView *soundsScrollView;
|
2002-11-18 20:54:26 +00:00
|
|
|
NSScrollView *imagesScrollView;
|
2001-05-08 09:43:11 +00:00
|
|
|
id classesView;
|
1999-12-14 19:55:18 +00:00
|
|
|
id objectsView;
|
2002-11-04 13:52:31 +00:00
|
|
|
id soundsView;
|
2002-11-18 20:54:26 +00:00
|
|
|
id imagesView;
|
2000-01-13 21:19:03 +00:00
|
|
|
BOOL hasSetDefaults;
|
2000-01-04 16:25:39 +00:00
|
|
|
BOOL isActive;
|
1999-12-16 18:06:22 +00:00
|
|
|
NSMenu *savedMenu;
|
1999-12-15 15:29:27 +00:00
|
|
|
NSMenuItem *quitItem; /* Replaced during test */
|
2000-01-03 11:00:14 +00:00
|
|
|
NSMutableArray *savedEditors;
|
2000-02-03 17:04:37 +00:00
|
|
|
NSMutableArray *hidden;
|
2004-05-13 22:48:14 +00:00
|
|
|
NSMutableArray *openEditors;
|
2004-05-20 02:34:03 +00:00
|
|
|
NSToolbar *toolbar;
|
2004-06-03 22:37:14 +00:00
|
|
|
id lastEditor;
|
2004-07-01 00:53:42 +00:00
|
|
|
BOOL willUpgradeArchive;
|
1999-12-08 15:04:57 +00:00
|
|
|
}
|
|
|
|
- (void) addConnector: (id<IBConnectors>)aConnector;
|
|
|
|
- (NSArray*) allConnectors;
|
|
|
|
- (void) attachObject: (id)anObject toParent: (id)aParent;
|
|
|
|
- (void) attachObjects: (NSArray*)anArray toParent: (id)aParent;
|
2000-01-03 11:00:14 +00:00
|
|
|
- (void) beginArchiving;
|
2001-05-08 09:43:11 +00:00
|
|
|
- (GormClassManager*) classManager;
|
1999-12-08 15:04:57 +00:00
|
|
|
- (NSArray*) connectorsForDestination: (id)destination;
|
|
|
|
- (NSArray*) connectorsForDestination: (id)destination
|
|
|
|
ofClass: (Class)aConnectorClass;
|
|
|
|
- (NSArray*) connectorsForSource: (id)source;
|
|
|
|
- (NSArray*) connectorsForSource: (id)source
|
|
|
|
ofClass: (Class)aConnectorClass;
|
|
|
|
- (BOOL) containsObject: (id)anObject;
|
|
|
|
- (BOOL) containsObjectWithName: (NSString*)aName forParent: (id)parent;
|
|
|
|
- (BOOL) copyObject: (id)anObject
|
|
|
|
type: (NSString*)aType
|
|
|
|
toPasteboard: (NSPasteboard*)aPasteboard;
|
|
|
|
- (BOOL) copyObjects: (NSArray*)anArray
|
|
|
|
type: (NSString*)aType
|
|
|
|
toPasteboard: (NSPasteboard*)aPasteboard;
|
|
|
|
- (void) detachObject: (id)anObject;
|
|
|
|
- (void) detachObjects: (NSArray*)anArray;
|
|
|
|
- (NSString*) documentPath;
|
2000-01-03 11:00:14 +00:00
|
|
|
- (void) endArchiving;
|
1999-12-14 19:55:18 +00:00
|
|
|
- (void) handleNotification: (NSNotification*)aNotification;
|
2000-01-04 16:25:39 +00:00
|
|
|
- (BOOL) isActive;
|
1999-12-08 15:04:57 +00:00
|
|
|
- (NSString*) nameForObject: (id)anObject;
|
|
|
|
- (id) objectForName: (NSString*)aString;
|
2000-01-03 11:00:14 +00:00
|
|
|
- (BOOL) objectIsVisibleAtLaunch: (id)anObject;
|
2003-01-16 04:09:07 +00:00
|
|
|
- (BOOL) objectIsDeferred: (id)anObject;
|
1999-12-08 15:04:57 +00:00
|
|
|
- (NSArray*) objects;
|
2000-01-04 17:46:26 +00:00
|
|
|
- (id) loadDocument: (NSString*)path;
|
1999-12-08 15:04:57 +00:00
|
|
|
- (id) openDocument: (id)sender;
|
|
|
|
- (id) parentOfObject: (id)anObject;
|
|
|
|
- (NSArray*) pasteType: (NSString*)aType
|
|
|
|
fromPasteboard: (NSPasteboard*)aPasteboard
|
|
|
|
parent: (id)parent;
|
|
|
|
- (void) removeConnector: (id<IBConnectors>)aConnector;
|
2000-01-04 17:46:26 +00:00
|
|
|
- (id) revertDocument: (id)sender;
|
2003-05-20 03:57:37 +00:00
|
|
|
- (BOOL) saveAsDocument: (id)sender;
|
|
|
|
- (BOOL) saveGormDocument: (id)sender;
|
2000-01-13 21:19:03 +00:00
|
|
|
- (void) setupDefaults: (NSString*)type;
|
1999-12-08 15:04:57 +00:00
|
|
|
- (void) setDocumentActive: (BOOL)flag;
|
|
|
|
- (void) setName: (NSString*)aName forObject: (id)object;
|
2000-01-03 11:00:14 +00:00
|
|
|
- (void) setObject: (id)anObject isVisibleAtLaunch: (BOOL)flag;
|
2003-01-16 04:09:07 +00:00
|
|
|
- (void) setObject: (id)anObject isDeferred: (BOOL)flag;
|
1999-12-08 15:04:57 +00:00
|
|
|
- (void) touch; /* Mark document as having been changed. */
|
2000-01-04 16:25:39 +00:00
|
|
|
- (NSWindow*) window;
|
2003-05-20 03:57:37 +00:00
|
|
|
- (BOOL) couldCloseDocument;
|
2000-01-04 16:25:39 +00:00
|
|
|
- (BOOL) windowShouldClose: (id)sender;
|
2001-05-08 09:43:11 +00:00
|
|
|
|
2002-10-13 06:04:05 +00:00
|
|
|
// classes support..
|
2001-05-08 09:43:11 +00:00
|
|
|
- (id) createSubclass: (id)sender;
|
|
|
|
- (id) instantiateClass: (id)sender;
|
|
|
|
- (id) editClass: (id)sender;
|
2001-07-06 17:10:51 +00:00
|
|
|
- (id) createClassFiles: (id)sender;
|
2001-05-08 09:43:11 +00:00
|
|
|
- (void) changeCurrentClass: (id)sender;
|
2003-05-10 21:19:25 +00:00
|
|
|
- (id) addAttributeToClass: (id)sender;
|
|
|
|
- (id) remove: (id)sender;
|
|
|
|
- (id) createClassFiles: (id)sender;
|
|
|
|
- (id) instantiateClass: (id)sender;
|
2003-08-23 06:31:53 +00:00
|
|
|
- (void) selectClassWithObject: (id)obj;
|
2004-04-26 05:03:53 +00:00
|
|
|
- (void) selectClass: (NSString *)className;
|
2004-05-19 01:36:37 +00:00
|
|
|
- (BOOL) classIsSelected;
|
2002-11-04 13:52:31 +00:00
|
|
|
|
2003-01-04 00:17:43 +00:00
|
|
|
// sound & image support
|
2002-11-04 13:52:31 +00:00
|
|
|
- (id) openSound: (id)sender;
|
2003-01-04 00:17:43 +00:00
|
|
|
- (id) openImage: (id)sender;
|
2002-11-05 05:42:45 +00:00
|
|
|
|
2002-11-13 16:10:22 +00:00
|
|
|
// Internals support
|
|
|
|
- (void) rebuildObjToNameMapping;
|
2002-11-23 23:33:17 +00:00
|
|
|
- (BOOL) removeConnectionsWithLabel: (NSString *)name
|
2002-11-23 04:45:04 +00:00
|
|
|
forClassNamed: (NSString *)className
|
|
|
|
isAction: (BOOL)action;
|
2002-11-30 00:49:55 +00:00
|
|
|
- (BOOL) removeConnectionsForClassNamed: (NSString *)name;
|
2002-12-05 05:23:08 +00:00
|
|
|
- (BOOL) renameConnectionsForClassNamed: (NSString *)name
|
|
|
|
toName: (NSString *)newName;
|
2003-12-24 02:50:34 +00:00
|
|
|
- (BOOL) isTopLevelObject: (id)obj;
|
2004-05-15 15:39:57 +00:00
|
|
|
- (void) closeAllEditors;
|
2003-12-24 02:50:34 +00:00
|
|
|
|
2003-05-10 21:19:25 +00:00
|
|
|
// class loading
|
|
|
|
- (id) loadClass: (id)sender;
|
|
|
|
|
2003-09-28 23:31:35 +00:00
|
|
|
// services/windows menus...
|
|
|
|
- (void) setServicesMenu: (NSMenu *)menu;
|
|
|
|
- (NSMenu *) servicesMenu;
|
|
|
|
- (void) setWindowsMenu: (NSMenu *)menu;
|
|
|
|
- (NSMenu *) windowsMenu;
|
2004-01-05 03:36:24 +00:00
|
|
|
|
|
|
|
// utility methods...
|
|
|
|
+ (NSString*) identifierString: (NSString*)str;
|
|
|
|
+ (NSString *)formatAction: (NSString *)action;
|
|
|
|
+ (NSString *)formatOutlet: (NSString *)outlet;
|
2004-03-21 15:33:28 +00:00
|
|
|
|
|
|
|
// first responder/font manager
|
|
|
|
- (id) fontManager;
|
|
|
|
- (id) firstResponder;
|
1999-12-08 15:04:57 +00:00
|
|
|
@end
|
|
|
|
|
2003-01-01 17:50:17 +00:00
|
|
|
@interface GormDocument (MenuValidation)
|
|
|
|
- (BOOL) isEditingObjects;
|
|
|
|
- (BOOL) isEditingImages;
|
|
|
|
- (BOOL) isEditingSounds;
|
|
|
|
- (BOOL) isEditingClasses;
|
|
|
|
@end
|
|
|
|
|
1999-12-08 15:04:57 +00:00
|
|
|
#endif
|