1 |
/* GormDocument.h |
2 |
* |
3 |
* Copyright (C) 1999, 2003 Free Software Foundation, Inc. |
4 |
* |
5 |
* Author: Richard Frith-Macdonald <richard@brainstrom.co.uk> |
6 |
* Author: Gregory John Casamento <greg_casamento@yahoo.com> |
7 |
* Date: 1999, 2003 |
8 |
* |
9 |
* This file is part of GNUstep. |
10 |
* |
11 |
* This program is free software; you can redistribute it and/or modify |
12 |
* it under the terms of the GNU General Public License as published by |
13 |
* the Free Software Foundation; either version 2 of the License, or |
14 |
* (at your option) any later version. |
15 |
* |
16 |
* This program is distributed in the hope that it will be useful, |
17 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
18 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
19 |
* GNU General Public License for more details. |
20 |
* |
21 |
* You should have received a copy of the GNU General Public License |
22 |
* along with this program; if not, write to the Free Software |
23 |
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
24 |
*/ |
25 |
|
26 |
#ifndef INCLUDED_GormDocument_h |
27 |
#define INCLUDED_GormDocument_h |
28 |
|
29 |
#include <AppKit/AppKit.h> |
30 |
#include <Foundation/Foundation.h> |
31 |
#include <GNUstepGUI/GSNibTemplates.h> |
32 |
|
33 |
@class GormClassManager, GormClassEditor; |
34 |
|
35 |
/* |
36 |
* Each document has a GormFirstResponder object that is used as a placeholder |
37 |
* for the first responder at any instant. |
38 |
*/ |
39 |
@interface GormFirstResponder : NSObject |
40 |
{ |
41 |
} |
42 |
@end |
43 |
|
44 |
/* |
45 |
* Each document may have a GormFontManager object that is used as a |
46 |
* placeholder for the current font manager. |
47 |
*/ |
48 |
@interface GormFontManager : NSObject |
49 |
{ |
50 |
} |
51 |
@end |
52 |
|
53 |
@interface GormDocument : GSNibContainer <IBDocuments> |
54 |
{ |
55 |
GormClassManager *classManager; |
56 |
GormFilesOwner *filesOwner; |
57 |
GormFirstResponder *firstResponder; |
58 |
GormFontManager *fontManager; |
59 |
GormClassEditor *classEditor; // perhaps should not be here... |
60 |
NSString *documentPath; |
61 |
NSMapTable *objToName; |
62 |
NSWindow *window; |
63 |
NSMatrix *selectionView; |
64 |
NSBox *selectionBox; |
65 |
NSScrollView *scrollView; |
66 |
NSScrollView *classesScrollView; |
67 |
NSScrollView *soundsScrollView; |
68 |
NSScrollView *imagesScrollView; |
69 |
id classesView; |
70 |
id objectsView; |
71 |
id soundsView; |
72 |
id imagesView; |
73 |
BOOL hasSetDefaults; |
74 |
BOOL isActive; |
75 |
NSMenu *savedMenu; |
76 |
NSMenuItem *quitItem; /* Replaced during test */ |
77 |
NSMutableArray *savedEditors; |
78 |
NSMutableArray *hidden; |
79 |
NSMutableSet *sounds; |
80 |
NSMutableSet *images; |
81 |
// NSFileWrapper *wrapper; |
82 |
} |
83 |
- (void) addConnector: (id<IBConnectors>)aConnector; |
84 |
- (NSArray*) allConnectors; |
85 |
- (void) attachObject: (id)anObject toParent: (id)aParent; |
86 |
- (void) attachObjects: (NSArray*)anArray toParent: (id)aParent; |
87 |
- (void) beginArchiving; |
88 |
- (GormClassManager*) classManager; |
89 |
- (NSArray*) connectorsForDestination: (id)destination; |
90 |
- (NSArray*) connectorsForDestination: (id)destination |
91 |
ofClass: (Class)aConnectorClass; |
92 |
- (NSArray*) connectorsForSource: (id)source; |
93 |
- (NSArray*) connectorsForSource: (id)source |
94 |
ofClass: (Class)aConnectorClass; |
95 |
- (BOOL) containsObject: (id)anObject; |
96 |
- (BOOL) containsObjectWithName: (NSString*)aName forParent: (id)parent; |
97 |
- (BOOL) copyObject: (id)anObject |
98 |
type: (NSString*)aType |
99 |
toPasteboard: (NSPasteboard*)aPasteboard; |
100 |
- (BOOL) copyObjects: (NSArray*)anArray |
101 |
type: (NSString*)aType |
102 |
toPasteboard: (NSPasteboard*)aPasteboard; |
103 |
- (void) detachObject: (id)anObject; |
104 |
- (void) detachObjects: (NSArray*)anArray; |
105 |
- (NSString*) documentPath; |
106 |
- (void) endArchiving; |
107 |
- (void) handleNotification: (NSNotification*)aNotification; |
108 |
- (BOOL) isActive; |
109 |
- (NSString*) nameForObject: (id)anObject; |
110 |
- (id) objectForName: (NSString*)aString; |
111 |
- (BOOL) objectIsVisibleAtLaunch: (id)anObject; |
112 |
- (BOOL) objectIsDeferred: (id)anObject; |
113 |
- (NSArray*) objects; |
114 |
- (id) loadDocument: (NSString*)path; |
115 |
- (id) openDocument: (id)sender; |
116 |
- (id) parentOfObject: (id)anObject; |
117 |
- (NSArray*) pasteType: (NSString*)aType |
118 |
fromPasteboard: (NSPasteboard*)aPasteboard |
119 |
parent: (id)parent; |
120 |
- (void) removeConnector: (id<IBConnectors>)aConnector; |
121 |
- (id) revertDocument: (id)sender; |
122 |
- (BOOL) saveAsDocument: (id)sender; |
123 |
- (BOOL) saveGormDocument: (id)sender; |
124 |
- (void) setupDefaults: (NSString*)type; |
125 |
- (void) setDocumentActive: (BOOL)flag; |
126 |
- (void) setName: (NSString*)aName forObject: (id)object; |
127 |
- (void) setObject: (id)anObject isVisibleAtLaunch: (BOOL)flag; |
128 |
- (void) setObject: (id)anObject isDeferred: (BOOL)flag; |
129 |
- (void) touch; /* Mark document as having been changed. */ |
130 |
- (NSWindow*) window; |
131 |
- (BOOL) couldCloseDocument; |
132 |
- (BOOL) windowShouldClose: (id)sender; |
133 |
|
134 |
// classes support.. |
135 |
- (id) createSubclass: (id)sender; |
136 |
- (id) instantiateClass: (id)sender; |
137 |
- (id) editClass: (id)sender; |
138 |
- (id) createClassFiles: (id)sender; |
139 |
- (void) changeCurrentClass: (id)sender; |
140 |
- (id) addAttributeToClass: (id)sender; |
141 |
- (id) remove: (id)sender; |
142 |
- (id) createClassFiles: (id)sender; |
143 |
- (id) instantiateClass: (id)sender; |
144 |
- (void) selectClassWithObject: (id)obj; |
145 |
|
146 |
// sound & image support |
147 |
- (id) openSound: (id)sender; |
148 |
- (id) openImage: (id)sender; |
149 |
|
150 |
// Internals support |
151 |
- (void) rebuildObjToNameMapping; |
152 |
- (id) parseHeader: (NSString *)headerPath; |
153 |
- (BOOL) removeConnectionsWithLabel: (NSString *)name |
154 |
forClassNamed: (NSString *)className |
155 |
isAction: (BOOL)action; |
156 |
- (BOOL) removeConnectionsForClassNamed: (NSString *)name; |
157 |
- (BOOL) renameConnectionsForClassNamed: (NSString *)name |
158 |
toName: (NSString *)newName; |
159 |
// class loading |
160 |
- (id) loadClass: (id)sender; |
161 |
|
162 |
// services/windows menus... |
163 |
- (void) setServicesMenu: (NSMenu *)menu; |
164 |
- (NSMenu *) servicesMenu; |
165 |
- (void) setWindowsMenu: (NSMenu *)menu; |
166 |
- (NSMenu *) windowsMenu; |
167 |
@end |
168 |
|
169 |
@interface GormDocument (MenuValidation) |
170 |
- (BOOL) isEditingObjects; |
171 |
- (BOOL) isEditingImages; |
172 |
- (BOOL) isEditingSounds; |
173 |
- (BOOL) isEditingClasses; |
174 |
@end |
175 |
|
176 |
#endif |