ProjectManager  0.2
ProjectCreator.h
1 /*
2  ProjectCreator.h
3 
4  Copyright (C) 2005 Saso Kiselkov
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20 
21 #import <Foundation/NSObject.h>
22 
23 
24 @class WKWizardPanel;
25 
26 @class NSDictionary,
27  NSString,
28  NSOutlineView,
29  NSTableColumn,
30  NSView,
31  NSError;
32 
33 extern NSString * const ProjectCreatorErrorDomain;
34 enum {
35  ProjectFileImportError,
36  ProjectDirectoryCreationError
37 };
38 
39 @interface ProjectCreator : NSObject
40 {
41  WKWizardPanel * wizard;
42 
43  id projectNameCell,
44  projectNameForm,
45  projectNameNotice,
46  projectNameMistake,
47  projectNameView,
48  projectTypes,
49  projectTypeView,
50  projectTypeIcon,
51  projectTypeDescription,
52  window1,
53  window2,
54  templateNeededNotice;
55 
56  id finishButton,
57  backToLocationButton,
58  toProjectTypeSelectionButton;
59 
60  // an array of ProjectTypeDescription objects
61  NSArray * projectTypesCache;
62 
63  NSString * location;
64  NSString * projectName;
65 }
66 
67 + shared;
68 
69 + (BOOL) createNewProjectAtPath: (NSString *) aProjectPath
70  projectName: (NSString *) aProjectName
71  fromTemplate: (NSString *) aTemplatePath
72  error: (NSError **) error;
73 
74 - (NSDictionary *) getNewProjectSetupWithLocation: (BOOL) withLocation;
75 
76 - (void) cancel: sender;
77 - (void) goToProjectLocationSelection: sender;
78 - (void) projectTypeSelected: sender;
79 - (void) doubleClickedProjectType: sender;
80 
81 - (void) validateProjectName: sender;
82 
83 // wizard panel delegate methods
84 - (NSView *) wizardPanel: (WKWizardPanel *) sender
85  viewForStage: (NSString *) aStage;
86 - (NSView *) wizardPanel: (WKWizardPanel *) sender
87  initialFirstResponderForStage: (NSString *) aStage;
88 
89 // outline view data source methods
90 - (int) outlineView: (NSOutlineView *) outlineView
91  numberOfChildrenOfItem: (id) item;
92 - (BOOL) outlineView: (NSOutlineView *) outlineView
93  isItemExpandable: (id) item;
94 - (id) outlineView: (NSOutlineView *) outlineView
95  child: (int) index
96  ofItem: (id) item;
97 - (id) outlineView: (NSOutlineView *) outlineView
98  objectValueForTableColumn: (NSTableColumn *) tableColumn
99  byItem: (id) item;
100 
101 @end
102 
103 BOOL
104 CreateDirectoryAndIntermediateDirectories(NSString * dirPath,
105  NSError ** error);
106 
107 BOOL
108 ImportProjectFile(NSString * sourceFile,
109  NSString * destinationFile,
110  NSString * projectName,
111  NSError ** error);
Definition: ProjectCreator.h:40