ProjectManager  0.2
ProjectType.h
1 /*
2  ProjectType.h
3 
4  Protocol declaration of the ProjectType protocol for the
5  ProjectManager application.
6 
7  Copyright (C) 2005, 2006 Saso Kiselkov
8 
9  This program is free software; you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation; either version 2 of the License, or
12  (at your option) any later version.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program; if not, write to the Free Software
21  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23 
24 #import <Foundation/NSObject.h>
25 #import <Foundation/NSString.h>
26 #import <Foundation/NSDictionary.h>
27 
28 @class NSArray, NSDictionary, NSImage;
29 
30 @class ProjectDocument;
31 
40 @protocol ProjectType <NSObject>
41 
42 // ======== Class Methods =========
43 
45 + (NSString *) projectTypeID;
46 
51 + (NSString *) humanReadableProjectTypeName;
52 
54 + (NSString *) projectTypeDescription;
55 
57 + (NSImage *) projectTypeIcon;
58 
63 + (NSArray *) projectModules;
64 
70 + (NSDictionary *) projectTemplateDescriptions;
71 
76 + (NSString *) pathToProjectTemplate: (NSString *) templateName;
77 
78 
79 // ========= Instance Methods ==========
80 
95 - initWithDocument: (ProjectDocument *) aProject
96  infoDictionary: (NSDictionary *) infoDict
97  projectModules: (NSArray *) modules;
98 
105 - (NSDictionary *) infoDictionary;
106 
116 - (BOOL) regenerateDerivedFiles;
117 
125 - (NSString *) pathToSubprojectsDirectory;
126 
127 @end
128 
145 static inline NSDictionary *
146 PMCreateTemplateDescription(NSString * templateDescription,
147  NSImage * templateIcon)
148 {
149  return [NSDictionary dictionaryWithObjectsAndKeys:
150  templateDescription, @"Description",
151  // templateIcon can be `nil' here!
152  templateIcon, @"Icon",
153  nil];
154 }
This class is the principal document class for project files.
Definition: ProjectDocument.h:44
This protocol is adopted by project type support objects.
Definition: ProjectType.h:40
NSDictionary * projectTemplateDescriptions()
The project type should return a dictionary where keys are project template names and values are desc...
BOOL regenerateDerivedFiles()
Instructs the project to regenerate any of it's derived files, if necessary.
NSString * projectTypeID()
Should return the project type ID.
NSString * humanReadableProjectTypeName()
Should return a human-readable, perhaps localized descriptive name of the project type.
NSDictionary * infoDictionary()
Should return the project's info dictionary which is suitable for being written into the project file...
NSString * projectTypeDescription()
Should return a more detailed description of the project type.
NSString * pathToSubprojectsDirectory()
In case the project type supports subprojects, this method should return a path to a directory where ...
NSArray * projectModules()
Should return an OR'ed set of project capabilities provided by this project type.
NSImage * projectTypeIcon()
Should return an icon of the project type (max 48x48 pixels).