forked from erkyrath/Inform7-IDE-Mac
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIFProjectType.h
50 lines (36 loc) · 1.95 KB
/
IFProjectType.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//
// IFProjectType.h
// Inform
//
// Created by Andrew Hunter on Sat Sep 13 2003.
// Copyright (c) 2003 Andrew Hunter. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "IFProjectFile.h"
@protocol IFProjectSetupView;
//
// Objects implementing this protocol specify a type of project that can be created via the
// new project dialog.
//
@protocol IFProjectType
- (NSString*) projectName; // The name of the project that appears in the project type list
- (NSString*) projectHeading; // The heading that the name comes under
- (NSAttributedString*) projectDescription; // A more detailed description that is displayed when the project is selected
- (NSObject<IFProjectSetupView>*) configView; // nil, or a project type-specific view that can be used to customise the new project. Should be reallocated every time this is called.
- (void) setupFile: (IFProjectFile*) file // Request to setup a file from the given IFProjectSetupView (which will have been previously created by configView)
fromView: (NSObject<IFProjectSetupView>*) view;
@end
@protocol IFProjectSetupView
- (NSView*) view; // The view that's displayed for this projects custom settings
@end
//
// Objects implementing the IFProjectType protocol may also implement these functions.
//
@interface NSObject(IFProjectTypeOptionalMethods)
- (BOOL) showFinalPage; // Defaults to YES. If NO, the 'save project' page is not shown
- (NSString*) confirmationMessage; // Return a string to display an 'are you sure' type message
- (NSString*) errorMessage; // Return a string to indicate an error with the way things are set up
- (NSString*) saveFilename; // If showFinalPage is NO, this is the filename to create
- (NSString*) openAsType; // If present, the file type to open this project as
- (BOOL) createAndOpenDocument: (NSString*) filename; // If present, creates and opens the document associated with this view
@end